From owner-svn-src-head@freebsd.org Sun Apr 24 01:38:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCA3FB11B8B; Sun, 24 Apr 2016 01:38:46 +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 AE5821A0D; Sun, 24 Apr 2016 01:38:46 +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 u3O1cj0J002617; Sun, 24 Apr 2016 01:38:45 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3O1cj1i002616; Sun, 24 Apr 2016 01:38:45 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201604240138.u3O1cj1i002616@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 24 Apr 2016 01:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298526 - head/sys/contrib/ncsw/user/env X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 01:38:47 -0000 Author: jhibbits Date: Sun Apr 24 01:38:45 2016 New Revision: 298526 URL: https://svnweb.freebsd.org/changeset/base/298526 Log: Zero the newly allocated spinlock. Not sure how this worked testing with DIAGNOSTIC set, but with it disabled this fails due to the spinlock being "initialized" with 0xdeadc0de. Modified: head/sys/contrib/ncsw/user/env/xx.c Modified: head/sys/contrib/ncsw/user/env/xx.c ============================================================================== --- head/sys/contrib/ncsw/user/env/xx.c Sat Apr 23 22:57:54 2016 (r298525) +++ head/sys/contrib/ncsw/user/env/xx.c Sun Apr 24 01:38:45 2016 (r298526) @@ -561,7 +561,7 @@ XX_InitSpinlock(void) { struct mtx *m; - m = malloc(sizeof(*m), M_NETCOMMSW, M_NOWAIT); + m = malloc(sizeof(*m), M_NETCOMMSW, M_NOWAIT | M_ZERO); if (!m) return (0); From owner-svn-src-head@freebsd.org Sun Apr 24 04:08:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21A10B12046; Sun, 24 Apr 2016 04:08:38 +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 E6EE318E9; Sun, 24 Apr 2016 04:08:37 +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 u3O48bSM047525; Sun, 24 Apr 2016 04:08:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3O48bPQ047524; Sun, 24 Apr 2016 04:08:37 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604240408.u3O48bPQ047524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 24 Apr 2016 04:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298530 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 04:08:38 -0000 Author: pfg Date: Sun Apr 24 04:08:36 2016 New Revision: 298530 URL: https://svnweb.freebsd.org/changeset/base/298530 Log: patch(1): avoid signed integer overflow when debugging. Integer i is used to index p_end of type LINENUM (actually long). Match the types. MFC after: 5 days Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Sun Apr 24 03:15:10 2016 (r298529) +++ head/usr.bin/patch/pch.c Sun Apr 24 04:08:36 2016 (r298530) @@ -1142,7 +1142,7 @@ hunk_done: say("Not enough memory to swap next hunk!\n"); #ifdef DEBUGGING if (debug & 2) { - int i; + LINENUM i; char special; for (i = 0; i <= p_end; i++) { @@ -1150,7 +1150,7 @@ hunk_done: special = '^'; else special = ' '; - fprintf(stderr, "%3d %c %c %s", i, p_char[i], + fprintf(stderr, "%3ld %c %c %s", i, p_char[i], special, p_line[i]); fflush(stderr); } From owner-svn-src-head@freebsd.org Sun Apr 24 04:28:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 462AFB1273B; Sun, 24 Apr 2016 04:28:05 +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 0979E10F5; Sun, 24 Apr 2016 04:28:04 +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 u3O4S4oV053624; Sun, 24 Apr 2016 04:28:04 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3O4S4c6053623; Sun, 24 Apr 2016 04:28:04 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604240428.u3O4S4c6053623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 24 Apr 2016 04:28:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298531 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 04:28:05 -0000 Author: pfg Date: Sun Apr 24 04:28:04 2016 New Revision: 298531 URL: https://svnweb.freebsd.org/changeset/base/298531 Log: Adjust a type from r267490. Independent of the maximum length, the return type for strnlen(3) is always size_t. Modified: head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Sun Apr 24 04:08:36 2016 (r298530) +++ head/usr.bin/patch/patch.c Sun Apr 24 04:28:04 2016 (r298531) @@ -746,7 +746,7 @@ abort_context_hunk(void) static void rej_line(int ch, LINENUM i) { - unsigned short len; + size_t len; const char *line = pfetch(i); len = strnlen(line, USHRT_MAX); From owner-svn-src-head@freebsd.org Sun Apr 24 08:31:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0F73B11DF7; Sun, 24 Apr 2016 08:31:33 +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 BE38D1BEB; Sun, 24 Apr 2016 08:31:33 +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 u3O8VWQO029400; Sun, 24 Apr 2016 08:31:32 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3O8VW8r029399; Sun, 24 Apr 2016 08:31:32 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201604240831.u3O8VW8r029399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Sun, 24 Apr 2016 08:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298532 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 08:31:34 -0000 Author: brueffer Date: Sun Apr 24 08:31:32 2016 New Revision: 298532 URL: https://svnweb.freebsd.org/changeset/base/298532 Log: Correct types for g_example_start() and g_example_access(). PR: 203498 Submitted by: chadf@triularity.org, ae MFC after: 1 week Sponsored by: Essen Hackathon 2016 Modified: head/share/man/man9/g_geom.9 Modified: head/share/man/man9/g_geom.9 ============================================================================== --- head/share/man/man9/g_geom.9 Sun Apr 24 04:28:04 2016 (r298531) +++ head/share/man/man9/g_geom.9 Sun Apr 24 08:31:32 2016 (r298532) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2004 +.Dd April 24, 2016 .Dt G_GEOM 9 .Os .Sh NAME @@ -123,7 +123,7 @@ returns a pointer to the newly created g .Sh EXAMPLES Create an example geom. .Bd -literal -offset indent -static struct geom * +static void g_example_start(struct bio *bp) { @@ -148,7 +148,7 @@ g_example_spoiled(struct g_consumer *cp) [...] } -static void +static int g_example_access(struct g_provider *pp, int dr, int dw, int de) { From owner-svn-src-head@freebsd.org Sun Apr 24 09:02:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 866DAB12E02; Sun, 24 Apr 2016 09:02:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D08116E; Sun, 24 Apr 2016 09:02:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3O92HEN038405; Sun, 24 Apr 2016 09:02:17 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3O92HXA038401; Sun, 24 Apr 2016 09:02:17 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201604240902.u3O92HXA038401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 24 Apr 2016 09:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298535 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 09:02:18 -0000 Author: ae Date: Sun Apr 24 09:02:17 2016 New Revision: 298535 URL: https://svnweb.freebsd.org/changeset/base/298535 Log: Handle non-compressed packets for IPComp in tunnel mode. RFC3173 says that the IP datagram MUST be sent in the original non-compressed form, when the total size of a compressed payload and the IPComp header is not smaller than the size of the original payload. In tunnel mode for small packets IPComp will send encapsulated IP datagrams without IPComp header. Add ip_encap handler for IPPROTO_IPV4 and IPPROTO_IPV6 to handle these datagrams. The handler does lookup for SA related to IPComp protocol and given from mbuf source and destination addresses as tunnel endpoints. It decapsulates packets only when corresponding SA is found. Reported by: gnn Reviewed by: gnn Differential Revision: https://reviews.freebsd.org/D6062 Modified: head/sys/netipsec/key.c head/sys/netipsec/key.h head/sys/netipsec/xform_ipcomp.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Sun Apr 24 08:45:43 2016 (r298534) +++ head/sys/netipsec/key.c Sun Apr 24 09:02:17 2016 (r298535) @@ -1158,6 +1158,66 @@ done: return sav; } +struct secasvar * +key_allocsa_tunnel(union sockaddr_union *src, union sockaddr_union *dst, + u_int proto, const char* where, int tag) +{ + struct secashead *sah; + struct secasvar *sav; + u_int stateidx, arraysize, state; + const u_int *saorder_state_valid; + + IPSEC_ASSERT(src != NULL, ("null src address")); + IPSEC_ASSERT(dst != NULL, ("null dst address")); + KEYDEBUG(KEYDEBUG_IPSEC_STAMP, + printf("DP %s from %s:%u\n", __func__, where, tag)); + + SAHTREE_LOCK(); + if (V_key_preferred_oldsa) { + saorder_state_valid = saorder_state_valid_prefer_old; + arraysize = _ARRAYLEN(saorder_state_valid_prefer_old); + } else { + saorder_state_valid = saorder_state_valid_prefer_new; + arraysize = _ARRAYLEN(saorder_state_valid_prefer_new); + } + LIST_FOREACH(sah, &V_sahtree, chain) { + /* search valid state */ + for (stateidx = 0; stateidx < arraysize; stateidx++) { + state = saorder_state_valid[stateidx]; + LIST_FOREACH(sav, &sah->savtree[state], chain) { + /* sanity check */ + KEY_CHKSASTATE(sav->state, state, __func__); + /* do not return entries w/ unusable state */ + if (sav->state != SADB_SASTATE_MATURE && + sav->state != SADB_SASTATE_DYING) + continue; + if (IPSEC_MODE_TUNNEL != sav->sah->saidx.mode) + continue; + if (proto != sav->sah->saidx.proto) + continue; + /* check src address */ + if (key_sockaddrcmp(&src->sa, + &sav->sah->saidx.src.sa, 0) != 0) + continue; + /* check dst address */ + if (key_sockaddrcmp(&dst->sa, + &sav->sah->saidx.dst.sa, 0) != 0) + continue; + sa_addref(sav); + goto done; + } + } + } + sav = NULL; +done: + SAHTREE_UNLOCK(); + + KEYDEBUG(KEYDEBUG_IPSEC_STAMP, + printf("DP %s return SA:%p; refcnt %u\n", __func__, + sav, sav ? sav->refcnt : 0)); + return (sav); +} + /* * Must be called after calling key_allocsp(). * For both the packet without socket and key_freeso(). Modified: head/sys/netipsec/key.h ============================================================================== --- head/sys/netipsec/key.h Sun Apr 24 08:45:43 2016 (r298534) +++ head/sys/netipsec/key.h Sun Apr 24 09:02:17 2016 (r298535) @@ -76,11 +76,15 @@ extern void _key_freesp(struct secpolicy extern struct secasvar *key_allocsa(union sockaddr_union *, u_int, u_int32_t, const char*, int); +extern struct secasvar *key_allocsa_tunnel(union sockaddr_union *, + union sockaddr_union *, u_int, const char*, int); extern void key_addrefsa(struct secasvar *, const char*, int); extern void key_freesav(struct secasvar **, const char*, int); #define KEY_ALLOCSA(dst, proto, spi) \ key_allocsa(dst, proto, spi, __FILE__, __LINE__) +#define KEY_ALLOCSA_TUNNEL(src, dst, proto) \ + key_allocsa_tunnel(src, dst, proto, __FILE__, __LINE__) #define KEY_ADDREFSA(sav) \ key_addrefsa(sav, __FILE__, __LINE__) #define KEY_FREESAV(psav) \ Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sun Apr 24 08:45:43 2016 (r298534) +++ head/sys/netipsec/xform_ipcomp.c Sun Apr 24 09:02:17 2016 (r298535) @@ -47,7 +47,10 @@ #include #include #include +#include +#include +#include #include #include @@ -98,6 +101,75 @@ ipcomp_algorithm_lookup(int alg) return NULL; } +#if defined(INET) || defined(INET6) +/* + * RFC 3173 p 2.2. Non-Expansion Policy: + * If the total size of a compressed payload and the IPComp header, as + * defined in section 3, is not smaller than the size of the original + * payload, the IP datagram MUST be sent in the original non-compressed + * form. + * + * When we use IPComp in tunnel mode, for small packets we will receive + * encapsulated IP-IP datagrams without any compression and without IPComp + * header. + */ +static int +ipcomp_encapcheck(union sockaddr_union *src, union sockaddr_union *dst) +{ + struct secasvar *sav; + + sav = KEY_ALLOCSA_TUNNEL(src, dst, IPPROTO_IPCOMP); + if (sav == NULL) + return (0); + KEY_FREESAV(&sav); + + if (src->sa.sa_family == AF_INET) + return (sizeof(struct in_addr) << 4); + else + return (sizeof(struct in6_addr) << 4); +} + +static int +ipcomp_nonexp_input(struct mbuf **mp, int *offp, int proto) +{ + int isr; + + switch (proto) { +#ifdef INET + case IPPROTO_IPV4: + isr = NETISR_IP; + break; +#endif +#ifdef INET6 + case IPPROTO_IPV6: + isr = NETISR_IPV6; + break; +#endif + default: + IPCOMPSTAT_INC(ipcomps_nopf); + m_freem(*mp); + return (IPPROTO_DONE); + } + m_adj(*mp, *offp); + IPCOMPSTAT_ADD(ipcomps_ibytes, (*mp)->m_pkthdr.len); + IPCOMPSTAT_INC(ipcomps_input); + netisr_dispatch(isr, *mp); + return (IPPROTO_DONE); +} + +extern struct domain inetdomain; +static struct protosw ipcomp_protosw = { + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = 0 /* IPPROTO_IPV[46] */, + .pr_flags = PR_ATOMIC | PR_ADDR | PR_LASTHDR, + .pr_input = ipcomp_nonexp_input, + .pr_output = rip_output, + .pr_ctloutput = rip_ctloutput, + .pr_usrreqs = &rip_usrreqs +}; +#endif /* INET || INET6 */ + /* * ipcomp_init() is called when an CPI is being set up. */ @@ -628,11 +700,75 @@ static struct xformsw ipcomp_xformsw = { ipcomp_output }; +#ifdef INET +static const struct encaptab *ipe4_cookie = NULL; +static int +ipcomp4_nonexp_encapcheck(const struct mbuf *m, int off, int proto, + void *arg __unused) +{ + union sockaddr_union src, dst; + const struct ip *ip; + + if (V_ipcomp_enable == 0) + return (0); + bzero(&src, sizeof(src)); + bzero(&dst, sizeof(dst)); + src.sa.sa_family = dst.sa.sa_family = AF_INET; + src.sin.sin_len = dst.sin.sin_len = sizeof(struct sockaddr_in); + ip = mtod(m, const struct ip *); + src.sin.sin_addr = ip->ip_src; + dst.sin.sin_addr = ip->ip_dst; + return (ipcomp_encapcheck(&src, &dst)); +} +#endif +#ifdef INET6 +static const struct encaptab *ipe6_cookie = NULL; +static int +ipcomp6_nonexp_encapcheck(const struct mbuf *m, int off, int proto, + void *arg __unused) +{ + union sockaddr_union src, dst; + const struct ip6_hdr *ip6; + + if (V_ipcomp_enable == 0) + return (0); + bzero(&src, sizeof(src)); + bzero(&dst, sizeof(dst)); + src.sa.sa_family = dst.sa.sa_family = AF_INET; + src.sin6.sin6_len = dst.sin6.sin6_len = sizeof(struct sockaddr_in6); + ip6 = mtod(m, const struct ip6_hdr *); + src.sin6.sin6_addr = ip6->ip6_src; + dst.sin6.sin6_addr = ip6->ip6_dst; + if (IN6_IS_SCOPE_LINKLOCAL(&src.sin6.sin6_addr)) { + /* XXX: sa6_recoverscope() */ + src.sin6.sin6_scope_id = + ntohs(src.sin6.sin6_addr.s6_addr16[1]); + src.sin6.sin6_addr.s6_addr16[1] = 0; + } + if (IN6_IS_SCOPE_LINKLOCAL(&dst.sin6.sin6_addr)) { + /* XXX: sa6_recoverscope() */ + dst.sin6.sin6_scope_id = + ntohs(dst.sin6.sin6_addr.s6_addr16[1]); + dst.sin6.sin6_addr.s6_addr16[1] = 0; + } + return (ipcomp_encapcheck(&src, &dst)); +} +#endif + static void ipcomp_attach(void) { +#ifdef INET + ipe4_cookie = encap_attach_func(AF_INET, IPPROTO_IPV4, + ipcomp4_nonexp_encapcheck, &ipcomp_protosw, NULL); +#endif +#ifdef INET6 + ipe6_cookie = encap_attach_func(AF_INET6, IPPROTO_IPV6, + ipcomp6_nonexp_encapcheck, &ipcomp_protosw, NULL); +#endif xform_register(&ipcomp_xformsw); } -SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, ipcomp_attach, NULL); +SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, + ipcomp_attach, NULL); From owner-svn-src-head@freebsd.org Sun Apr 24 09:05:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D93BB12FAA; Sun, 24 Apr 2016 09:05:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50BB71499; Sun, 24 Apr 2016 09:05:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3O95T1Y038698; Sun, 24 Apr 2016 09:05:29 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3O95Txr038697; Sun, 24 Apr 2016 09:05:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201604240905.u3O95Txr038697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 24 Apr 2016 09:05:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298536 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 09:05:30 -0000 Author: ae Date: Sun Apr 24 09:05:29 2016 New Revision: 298536 URL: https://svnweb.freebsd.org/changeset/base/298536 Log: Use ipsec_address() function to print IP addresses. Modified: head/sys/netipsec/key_debug.c Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Sun Apr 24 09:02:17 2016 (r298535) +++ head/sys/netipsec/key_debug.c Sun Apr 24 09:05:29 2016 (r298536) @@ -506,6 +506,8 @@ kdebug_secpolicy(struct secpolicy *sp) void kdebug_secpolicyindex(struct secpolicyindex *spidx) { + char buf[INET6_ADDRSTRLEN]; + /* sanity check */ if (spidx == NULL) panic("%s: NULL pointer was passed.\n", __func__); @@ -513,19 +515,15 @@ kdebug_secpolicyindex(struct secpolicyin printf("secpolicyindex{ dir=%u prefs=%u prefd=%u ul_proto=%u\n", spidx->dir, spidx->prefs, spidx->prefd, spidx->ul_proto); - ipsec_hexdump((caddr_t)&spidx->src, - ((struct sockaddr *)&spidx->src)->sa_len); - printf("\n"); - ipsec_hexdump((caddr_t)&spidx->dst, - ((struct sockaddr *)&spidx->dst)->sa_len); - printf("}\n"); - - return; + printf("%s -> ", ipsec_address(&spidx->src, buf, sizeof(buf))); + printf("%s }\n", ipsec_address(&spidx->dst, buf, sizeof(buf))); } void kdebug_secasindex(struct secasindex *saidx) { + char buf[INET6_ADDRSTRLEN]; + /* sanity check */ if (saidx == NULL) panic("%s: NULL pointer was passed.\n", __func__); @@ -533,14 +531,8 @@ kdebug_secasindex(struct secasindex *sai printf("secasindex{ mode=%u proto=%u\n", saidx->mode, saidx->proto); - ipsec_hexdump((caddr_t)&saidx->src, - ((struct sockaddr *)&saidx->src)->sa_len); - printf("\n"); - ipsec_hexdump((caddr_t)&saidx->dst, - ((struct sockaddr *)&saidx->dst)->sa_len); - printf("\n"); - - return; + printf("%s -> ", ipsec_address(&saidx->src, buf, sizeof(buf))); + printf("%s }\n", ipsec_address(&saidx->dst, buf, sizeof(buf))); } static void From owner-svn-src-head@freebsd.org Sun Apr 24 10:53:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 210B4B19ED5; Sun, 24 Apr 2016 10:53:01 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E69A71ADE; Sun, 24 Apr 2016 10:53:00 +0000 (UTC) (envelope-from schweikh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3OAr0qe072181; Sun, 24 Apr 2016 10:53:00 GMT (envelope-from schweikh@FreeBSD.org) Received: (from schweikh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OAr0bn072180; Sun, 24 Apr 2016 10:53:00 GMT (envelope-from schweikh@FreeBSD.org) Message-Id: <201604241053.u3OAr0bn072180@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: schweikh set sender to schweikh@FreeBSD.org using -f From: Jens Schweikhardt Date: Sun, 24 Apr 2016 10:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298537 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 10:53:01 -0000 Author: schweikh Date: Sun Apr 24 10:52:59 2016 New Revision: 298537 URL: https://svnweb.freebsd.org/changeset/base/298537 Log: Cosmetics: - no need to escape the newline after '|' - parenthesize the "case" string for symmetry and improved search for matching paren (e.g. with vi's %) Modified: head/etc/rc.d/zvol Modified: head/etc/rc.d/zvol ============================================================================== --- head/etc/rc.d/zvol Sun Apr 24 09:05:29 2016 (r298536) +++ head/etc/rc.d/zvol Sun Apr 24 10:52:59 2016 (r298537) @@ -19,10 +19,10 @@ required_modules="zfs" zvol_start() { # Enable swap on ZVOLs with property org.freebsd:swap=on. - zfs list -H -o org.freebsd:swap,name -t volume | \ + zfs list -H -o org.freebsd:swap,name -t volume | while read state name; do case "${state}" in - [oO][nN]) + ([oO][nN]) swapon /dev/zvol/${name} ;; esac @@ -32,10 +32,10 @@ zvol_start() zvol_stop() { # Disable swap on ZVOLs with property org.freebsd:swap=on. - zfs list -H -o org.freebsd:swap,name -t volume | \ + zfs list -H -o org.freebsd:swap,name -t volume | while read state name; do case "${state}" in - [oO][nN]) + ([oO][nN]) swapoff /dev/zvol/${name} ;; esac From owner-svn-src-head@freebsd.org Sun Apr 24 11:41:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABEDEB1B8DD; Sun, 24 Apr 2016 11:41:37 +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 7CEF41CEF; Sun, 24 Apr 2016 11:41:37 +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 u3OBfa1o084479; Sun, 24 Apr 2016 11:41:36 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OBfaHE084478; Sun, 24 Apr 2016 11:41:36 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201604241141.u3OBfaHE084478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Sun, 24 Apr 2016 11:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298538 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 11:41:37 -0000 Author: brueffer Date: Sun Apr 24 11:41:36 2016 New Revision: 298538 URL: https://svnweb.freebsd.org/changeset/base/298538 Log: MLINK mfi.4 to mfi_linux.4 and mfip.4 to cover these kernel modules. The mfi(4) manpage doesn't explain the modules yet, but at least we direct users to the right place. PR: 205925 Submitted by: dvl MFC after: 1 week Sponsored by: Essen Hackathon 2016 Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Apr 24 10:52:59 2016 (r298537) +++ head/share/man/man4/Makefile Sun Apr 24 11:41:36 2016 (r298538) @@ -660,6 +660,8 @@ MLINKS+=lp.4 plip.4 MLINKS+=malo.4 if_malo.4 MLINKS+=md.4 vn.4 MLINKS+=mem.4 kmem.4 +MLINKS+=mfi.4 mfi_linux.4 \ + mfi.4 mfip.4 MLINKS+=mlx5en.4 mce.4 MLINKS+=mn.4 if_mn.4 MLINKS+=mos.4 if_mos.4 From owner-svn-src-head@freebsd.org Sun Apr 24 12:07:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADBA6B10353; Sun, 24 Apr 2016 12:07:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F4551E03; Sun, 24 Apr 2016 12:07:45 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3OC7iKU093886; Sun, 24 Apr 2016 12:07:44 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OC7iHq093885; Sun, 24 Apr 2016 12:07:44 GMT (envelope-from se@FreeBSD.org) Message-Id: <201604241207.u3OC7iHq093885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: Stefan Esser Date: Sun, 24 Apr 2016 12:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298539 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 12:07:45 -0000 Author: se Date: Sun Apr 24 12:07:44 2016 New Revision: 298539 URL: https://svnweb.freebsd.org/changeset/base/298539 Log: Fix typo (forgotten "=" after desc). Modified: head/etc/rc.d/ccd Modified: head/etc/rc.d/ccd ============================================================================== --- head/etc/rc.d/ccd Sun Apr 24 11:41:36 2016 (r298538) +++ head/etc/rc.d/ccd Sun Apr 24 12:07:44 2016 (r298539) @@ -9,7 +9,7 @@ . /etc/rc.subr name="ccd" -desc"Concatenated disks setup" +desc="Concatenated disks setup" start_cmd="ccd_start" stop_cmd=":" From owner-svn-src-head@freebsd.org Sun Apr 24 14:49:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4772B1B48E; Sun, 24 Apr 2016 14:49:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9566B16E8; Sun, 24 Apr 2016 14:49:02 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3OEn1Gs043101; Sun, 24 Apr 2016 14:49:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OEn1Jm043100; Sun, 24 Apr 2016 14:49:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201604241449.u3OEn1Jm043100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 24 Apr 2016 14:49:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298542 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 14:49:02 -0000 Author: manu Date: Sun Apr 24 14:49:01 2016 New Revision: 298542 URL: https://svnweb.freebsd.org/changeset/base/298542 Log: Add myself as src commiter. Approved by: cognet (mentor) Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Apr 24 13:19:30 2016 (r298541) +++ head/share/misc/committers-src.dot Sun Apr 24 14:49:01 2016 (r298542) @@ -222,6 +222,7 @@ le [label="Lukas Ertl\nle@FreeBSD.org\n2 lidl [label="Kurt Lidl\nlidl@FreeBSD.org\n2015/10/21"] loos [label="Luiz Otavio O Souza\nloos@FreeBSD.org\n2013/07/03"] lstewart [label="Lawrence Stewart\nlstewart@FreeBSD.org\n2008/10/06"] +manu [label="Emmanuel Vadot\nmanu@FreeBSD.org\n2016/04/24"] marcel [label="Marcel Moolenaar\nmarcel@FreeBSD.org\n1999/07/03"] marius [label="Marius Strobl\nmarius@FreeBSD.org\n2004/04/17"] markj [label="Mark Johnston\nmarkj@FreeBSD.org\n2012/12/18"] @@ -358,6 +359,8 @@ alc -> davide andre -> qingli +andrew -> manu + anholt -> jkim avg -> art @@ -396,6 +399,7 @@ cognet -> br cognet -> jceel cognet -> kevlo cognet -> ian +cognet -> manu cognet -> wkoszek cognet -> wma cognet -> zbb From owner-svn-src-head@freebsd.org Sun Apr 24 15:55:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C5ACB19C55; Sun, 24 Apr 2016 15:55:48 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EF8E213DC; Sun, 24 Apr 2016 15:55:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 3A4D525D3888; Sun, 24 Apr 2016 15:55:43 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 646D3D1F7F7; Sun, 24 Apr 2016 15:55:42 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id BhcPoG6JxNob; Sun, 24 Apr 2016 15:55:40 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:9c8d:8bbc:f224:ce42] (unknown [IPv6:fde9:577b:c1a9:4410:9c8d:8bbc:f224:ce42]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 04723C7BF64; Sun, 24 Apr 2016 15:55:39 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn commit: r298535 - head/sys/netipsec From: "Bjoern A. Zeeb" In-Reply-To: <201604240902.u3O92HXA038401@repo.freebsd.org> Date: Sun, 24 Apr 2016 15:55:20 +0000 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, George Neville-Neil Content-Transfer-Encoding: quoted-printable Message-Id: References: <201604240902.u3O92HXA038401@repo.freebsd.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 15:55:48 -0000 > On 24 Apr 2016, at 09:02 , Andrey V. Elsukov wrote: >=20 > Author: ae > Date: Sun Apr 24 09:02:17 2016 > New Revision: 298535 > URL: https://svnweb.freebsd.org/changeset/base/298535 >=20 > Log: > Handle non-compressed packets for IPComp in tunnel mode. >=20 > RFC3173 says that the IP datagram MUST be sent in the original > non-compressed form, when the total size of a compressed payload > and the IPComp header is not smaller than the size of the original > payload. In tunnel mode for small packets IPComp will send > encapsulated IP datagrams without IPComp header. > Add ip_encap handler for IPPROTO_IPV4 and IPPROTO_IPV6 to handle > these datagrams. The handler does lookup for SA related to IPComp > protocol and given from mbuf source and destination addresses as > tunnel endpoints. It decapsulates packets only when corresponding SA > is found. >=20 > Reported by: gnn > Reviewed by: gnn > Differential Revision: https://reviews.freebsd.org/D6062 For one this breaks NOINET kernels, for the other > static void > ipcomp_attach(void) > { >=20 > +#ifdef INET > + ipe4_cookie =3D encap_attach_func(AF_INET, IPPROTO_IPV4, > + ipcomp4_nonexp_encapcheck, &ipcomp_protosw, NULL); > +#endif > +#ifdef INET6 > + ipe6_cookie =3D encap_attach_func(AF_INET6, IPPROTO_IPV6, > + ipcomp6_nonexp_encapcheck, &ipcomp_protosw, NULL); This looks wrong to me but also with regards to NOINET kernels won=E2=80=99= t compile. > +#endif > xform_register(&ipcomp_xformsw); > } >=20 > -SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, = ipcomp_attach, NULL); > +SYSINIT(ipcomp_xform_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_MIDDLE, > + ipcomp_attach, NULL); >=20 =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@freebsd.org Sun Apr 24 15:56:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F35DB19CA5; Sun, 24 Apr 2016 15:56:07 +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 E5FA316B9; Sun, 24 Apr 2016 15:56:06 +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 u3OFu6SO064648; Sun, 24 Apr 2016 15:56:06 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OFu6Gk064647; Sun, 24 Apr 2016 15:56:06 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201604241556.u3OFu6Gk064647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 24 Apr 2016 15:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298543 - head/sys/ofed/drivers/infiniband/core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 15:56:07 -0000 Author: bz Date: Sun Apr 24 15:56:05 2016 New Revision: 298543 URL: https://svnweb.freebsd.org/changeset/base/298543 Log: Fix NOIP kernels to compile. Modified: head/sys/ofed/drivers/infiniband/core/cma.c Modified: head/sys/ofed/drivers/infiniband/core/cma.c ============================================================================== --- head/sys/ofed/drivers/infiniband/core/cma.c Sun Apr 24 14:49:01 2016 (r298542) +++ head/sys/ofed/drivers/infiniband/core/cma.c Sun Apr 24 15:56:05 2016 (r298543) @@ -2319,6 +2319,7 @@ static int cma_bind_addr(struct rdma_cm_ if (!cma_any_addr(src_addr)) return rdma_bind_addr(id, src_addr); else { +#if defined(INET6) || defined(INET) union { #ifdef INET struct sockaddr_in in; @@ -2327,6 +2328,7 @@ static int cma_bind_addr(struct rdma_cm_ struct sockaddr_in6 in6; #endif } addr; +#endif switch(dst_addr->sa_family) { #ifdef INET From owner-svn-src-head@freebsd.org Sun Apr 24 16:04:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD755B19EEB; Sun, 24 Apr 2016 16:04:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B46811B89; Sun, 24 Apr 2016 16:04:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id AA6AB653F6; Sun, 24 Apr 2016 16:04:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r298535 - head/sys/netipsec To: "Bjoern A. Zeeb" References: <201604240902.u3O92HXA038401@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, George Neville-Neil From: "Andrey V. Elsukov" Message-ID: <571CEE06.6000503@FreeBSD.org> Date: Sun, 24 Apr 2016 19:02:14 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q5Ov2siOPEBgjkag9Sjqk5crcsIoMiFsI" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 16:04:27 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --q5Ov2siOPEBgjkag9Sjqk5crcsIoMiFsI Content-Type: multipart/mixed; boundary="I99XBh5taco0jkX8PplmCKlJFbKU2x9g4" From: "Andrey V. Elsukov" To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, George Neville-Neil Message-ID: <571CEE06.6000503@FreeBSD.org> Subject: Re: svn commit: r298535 - head/sys/netipsec References: <201604240902.u3O92HXA038401@repo.freebsd.org> In-Reply-To: --I99XBh5taco0jkX8PplmCKlJFbKU2x9g4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 24.04.16 18:55, Bjoern A. Zeeb wrote: >> +#ifdef INET >> + ipe4_cookie =3D encap_attach_func(AF_INET, IPPROTO_IPV4, >> + ipcomp4_nonexp_encapcheck, &ipcomp_protosw, NULL); >> +#endif >> +#ifdef INET6 >> + ipe6_cookie =3D encap_attach_func(AF_INET6, IPPROTO_IPV6, >> + ipcomp6_nonexp_encapcheck, &ipcomp_protosw, NULL); >=20 > This looks wrong to me but also with regards to NOINET kernels won=E2=80= =99t compile. Thanks, I'll fix NOINET kernels, but what wrong here? --=20 WBR, Andrey V. Elsukov --I99XBh5taco0jkX8PplmCKlJFbKU2x9g4-- --q5Ov2siOPEBgjkag9Sjqk5crcsIoMiFsI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXHO4GAAoJEAHF6gQQyKF6AmsIAIYLVtxad7i1d3fh2YVzOLrG RjbN7TInnt7uLxzZj9z6QR0/ejiwExSMc89jkfyWvH15enqv0fgmUUTtqLI/8fSH 5/fAslQTBVgnceKcLZ4Q559HUo2KJ04FsZDu12chjE6cGuv/vH4hz3fcEbn/gSe9 0pPNJvIbxgyQn7cEf9UWPwkRTC/k+AWt4pJ4lbIMDjkS0vEohFAofkZ6Llq+wz1y wzFeeTyGufv2+zjk++vxw4Jy64Bp/lgLDczNa4kjZ2BRj0rnuhU1Qa3shNyC+fXf KrZE753i66+1tMD2add/cVcuVy5zTJpn+9xssjK7ujP+J+EUfIODwh7NwKsY52s= =+dOy -----END PGP SIGNATURE----- --q5Ov2siOPEBgjkag9Sjqk5crcsIoMiFsI-- From owner-svn-src-head@freebsd.org Sun Apr 24 16:11:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83CF6B1B0BB; Sun, 24 Apr 2016 16:11:21 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from forward11h.cmail.yandex.net (forward11h.cmail.yandex.net [IPv6:2a02:6b8:0:f35::9c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "forwards.mail.yandex.net", Issuer "Yandex CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F40CE1FE9; Sun, 24 Apr 2016 16:11:20 +0000 (UTC) (envelope-from bu7cher@yandex.ru) Received: from smtp1h.mail.yandex.net (smtp1h.mail.yandex.net [84.201.187.144]) by forward11h.cmail.yandex.net (Yandex) with ESMTP id B962020DE4; Sun, 24 Apr 2016 19:11:06 +0300 (MSK) Received: from smtp1h.mail.yandex.net (localhost [127.0.0.1]) by smtp1h.mail.yandex.net (Yandex) with ESMTP id 3624C1340327; Sun, 24 Apr 2016 19:11:04 +0300 (MSK) Received: by smtp1h.mail.yandex.net (nwsmtp/Yandex) with ESMTPSA id Qr71CUGggk-B4H4b6x3; Sun, 24 Apr 2016 19:11:04 +0300 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client certificate not present) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1461514264; bh=bwTUBu1EnItBsYwST+OdoGzH6fHh4qPaCpl+AJbkLOQ=; h=Subject:To:References:Cc:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type; b=hS/ZPwzliXmrQcTPOp0yl1kKEcODzxuLS2uWfbkHxxBow367qzGyWqkf+hQagydA8 h2GEnskZyTtw5PSWKRUscbjsPkArYG4sAD/eypzHvQ/3hczSFc7F62/u6mP8Wexl90 xSgbZE/EeOxPQj7GchTFB4pQA6LYbyrOy+zVEukw= Authentication-Results: smtp1h.mail.yandex.net; dkim=pass header.i=@yandex.ru X-Yandex-ForeignMX: US X-Yandex-Suid-Status: 1 0,1 0,1 0,1 0,1 0 Subject: Re: svn commit: r298535 - head/sys/netipsec To: "Bjoern A. Zeeb" References: <201604240902.u3O92HXA038401@repo.freebsd.org> <571CEE06.6000503@FreeBSD.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, George Neville-Neil From: "Andrey V. Elsukov" Message-ID: <571CEF96.8030503@yandex.ru> Date: Sun, 24 Apr 2016 19:08:54 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <571CEE06.6000503@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="QvTfMN4xREOFRQjNJNbNeGQSIPrAICpgS" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 16:11:21 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QvTfMN4xREOFRQjNJNbNeGQSIPrAICpgS Content-Type: multipart/mixed; boundary="VPldFtaK0PoLc2la5CW0WpCW01qd18vrk" From: "Andrey V. Elsukov" To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, George Neville-Neil Message-ID: <571CEF96.8030503@yandex.ru> Subject: Re: svn commit: r298535 - head/sys/netipsec References: <201604240902.u3O92HXA038401@repo.freebsd.org> <571CEE06.6000503@FreeBSD.org> In-Reply-To: <571CEE06.6000503@FreeBSD.org> --VPldFtaK0PoLc2la5CW0WpCW01qd18vrk Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 24.04.16 19:02, Andrey V. Elsukov wrote: > On 24.04.16 18:55, Bjoern A. Zeeb wrote: >>> +#ifdef INET >>> + ipe4_cookie =3D encap_attach_func(AF_INET, IPPROTO_IPV4, >>> + ipcomp4_nonexp_encapcheck, &ipcomp_protosw, NULL); >>> +#endif >>> +#ifdef INET6 >>> + ipe6_cookie =3D encap_attach_func(AF_INET6, IPPROTO_IPV6, >>> + ipcomp6_nonexp_encapcheck, &ipcomp_protosw, NULL); >> >> This looks wrong to me but also with regards to NOINET kernels won=E2=80= =99t compile. >=20 > Thanks, I'll fix NOINET kernels, but what wrong here? I think I understand what you mean. I will fix, thanks again. --=20 WBR, Andrey V. Elsukov --VPldFtaK0PoLc2la5CW0WpCW01qd18vrk-- --QvTfMN4xREOFRQjNJNbNeGQSIPrAICpgS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXHO+WAAoJEAHF6gQQyKF6FhcIAJBafkCTKqvjsUxOaa5ofslr 3o1KdhtoPaZAT/AeNzaxO9N/d9+l4a1iyVgGCltJRbyuqN3IkBW90qhBptIg/+2y v+rEf/zS/XCDKQBPQAb+Phu2DAxcKZ40rfYYjWRD/XznIh3uoOWE9kWb2d80Onwe hxFg3MKLn/E9YJ3a13m7kbYXNGkaqftpGfvtlyw+E8q/VPQVtuEISF478J9w/LqI 5Yk7bkl1ymdXsAw3GsyLIVXmA8jL5NKiQGQqdi4AIkZ0F1xmxfXGjrAHQusVQ1kH PZqudoHxOYvIMCEiraWMziqUO3LT3lQbjjuTEheUQCMNS/o2hCMg+Dl9SAy63wE= =AxZi -----END PGP SIGNATURE----- --QvTfMN4xREOFRQjNJNbNeGQSIPrAICpgS-- From owner-svn-src-head@freebsd.org Sun Apr 24 17:01:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 225D7B1BDEA for ; Sun, 24 Apr 2016 17:01:46 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: from vfemail.net (onethreetwo.vfemail.net [199.16.11.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7D0A1FAC for ; Sun, 24 Apr 2016 17:01:45 +0000 (UTC) (envelope-from jbeich@vfemail.net) Received: (qmail 37210 invoked by uid 89); 24 Apr 2016 17:01:44 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 24 Apr 2016 17:01:44 -0000 Received: (qmail 37193 invoked by uid 89); 24 Apr 2016 17:01:26 -0000 Received: by simscan 1.3.1 ppid: 37185, pid: 37190, t: 0.1007s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 24 Apr 2016 17:01:26 -0000 Received: (qmail 5744 invoked by uid 89); 24 Apr 2016 17:01:26 -0000 Received: by simscan 1.4.0 ppid: 5665, pid: 5733, t: 1.5639s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by mail.vfemail.net with ESMTPA; 24 Apr 2016 17:01:25 -0000 From: Jan Beich To: Jens Schweikhardt Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298537 - head/etc/rc.d References: <201604241053.u3OAr0bn072180@repo.freebsd.org> Date: Sun, 24 Apr 2016 19:01:02 +0200 In-Reply-To: <201604241053.u3OAr0bn072180@repo.freebsd.org> (Jens Schweikhardt's message of "Sun, 24 Apr 2016 10:53:00 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 17:01:46 -0000 --=-=-= Content-Type: text/plain Jens Schweikhardt writes: > - parenthesize the "case" string for symmetry and improved > search for matching paren (e.g. with vi's %) [...] > case "${state}" in > - [oO][nN]) > + ([oO][nN]) > swapon /dev/zvol/${name} > ;; For style consistency is more important. Why this case is special unlike the rest of rc.d/* or rc.subr ? --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJXHPvPXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bfEcIAIbtP/5UT5IwJsFrq9XnnFZg tLIxr92wn0sYRP5v2a8tg9dvqvuk3g1LH/Fz4MDGP7MeTSbxcG7z1PkZor3uWkTR qSibgtFNFeO9LjZYioBYcAYfaI5fA4NHT+dX6/LCdG5XH3EtJaOwZnf+TNB/3UQv 9UrqQYKT7LGL6t5XS21WWQ7XjfxV4qMS/URfGDSxFa1d5v4wergV8eOUgxd6w2FQ WEpplEhtAGDWsdCLQxbPf3itUGuqweB5Fua0HKeT2ruzmGmzSG8PtHzZCqwU5ENW 2coPoqaR12Tg+QZgDk7PUHzOInm7sxBYCCz3cPQRP6kvZr0tBqtWcoC4PFmZl44= =M9FN -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-head@freebsd.org Sun Apr 24 17:09:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC6CEB1BF00; Sun, 24 Apr 2016 17:09:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BB8331224; Sun, 24 Apr 2016 17:09:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3OH9peG087193; Sun, 24 Apr 2016 17:09:51 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OH9pj4087192; Sun, 24 Apr 2016 17:09:51 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201604241709.u3OH9pj4087192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Sun, 24 Apr 2016 17:09:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298549 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 17:09:53 -0000 Author: ae Date: Sun Apr 24 17:09:51 2016 New Revision: 298549 URL: https://svnweb.freebsd.org/changeset/base/298549 Log: Fix build for NOINET and NOINET6 kernels. Use own protosw structures for both address families. Check proto in encapcheck function and use -1 as proto argument in encap_attach_func(), both address families can have IPPROTO_IPV4 and IPPROTO_IPV6 protocols. Reported by: bz Modified: head/sys/netipsec/xform_ipcomp.c Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Sun Apr 24 16:41:54 2016 (r298548) +++ head/sys/netipsec/xform_ipcomp.c Sun Apr 24 17:09:51 2016 (r298549) @@ -50,7 +50,6 @@ #include #include -#include #include #include @@ -58,6 +57,7 @@ #ifdef INET6 #include +#include #include #endif @@ -65,7 +65,6 @@ #include #include -#include #include #include @@ -101,7 +100,6 @@ ipcomp_algorithm_lookup(int alg) return NULL; } -#if defined(INET) || defined(INET6) /* * RFC 3173 p 2.2. Non-Expansion Policy: * If the total size of a compressed payload and the IPComp header, as @@ -157,19 +155,6 @@ ipcomp_nonexp_input(struct mbuf **mp, in return (IPPROTO_DONE); } -extern struct domain inetdomain; -static struct protosw ipcomp_protosw = { - .pr_type = SOCK_RAW, - .pr_domain = &inetdomain, - .pr_protocol = 0 /* IPPROTO_IPV[46] */, - .pr_flags = PR_ATOMIC | PR_ADDR | PR_LASTHDR, - .pr_input = ipcomp_nonexp_input, - .pr_output = rip_output, - .pr_ctloutput = rip_ctloutput, - .pr_usrreqs = &rip_usrreqs -}; -#endif /* INET || INET6 */ - /* * ipcomp_init() is called when an CPI is being set up. */ @@ -702,6 +687,18 @@ static struct xformsw ipcomp_xformsw = { #ifdef INET static const struct encaptab *ipe4_cookie = NULL; +extern struct domain inetdomain; +static struct protosw ipcomp4_protosw = { + .pr_type = SOCK_RAW, + .pr_domain = &inetdomain, + .pr_protocol = 0 /* IPPROTO_IPV[46] */, + .pr_flags = PR_ATOMIC | PR_ADDR | PR_LASTHDR, + .pr_input = ipcomp_nonexp_input, + .pr_output = rip_output, + .pr_ctloutput = rip_ctloutput, + .pr_usrreqs = &rip_usrreqs +}; + static int ipcomp4_nonexp_encapcheck(const struct mbuf *m, int off, int proto, void *arg __unused) @@ -711,6 +708,8 @@ ipcomp4_nonexp_encapcheck(const struct m if (V_ipcomp_enable == 0) return (0); + if (proto != IPPROTO_IPV4 && proto != IPPROTO_IPV6) + return (0); bzero(&src, sizeof(src)); bzero(&dst, sizeof(dst)); src.sa.sa_family = dst.sa.sa_family = AF_INET; @@ -723,6 +722,18 @@ ipcomp4_nonexp_encapcheck(const struct m #endif #ifdef INET6 static const struct encaptab *ipe6_cookie = NULL; +extern struct domain inet6domain; +static struct protosw ipcomp6_protosw = { + .pr_type = SOCK_RAW, + .pr_domain = &inet6domain, + .pr_protocol = 0 /* IPPROTO_IPV[46] */, + .pr_flags = PR_ATOMIC | PR_ADDR | PR_LASTHDR, + .pr_input = ipcomp_nonexp_input, + .pr_output = rip6_output, + .pr_ctloutput = rip6_ctloutput, + .pr_usrreqs = &rip6_usrreqs +}; + static int ipcomp6_nonexp_encapcheck(const struct mbuf *m, int off, int proto, void *arg __unused) @@ -732,6 +743,8 @@ ipcomp6_nonexp_encapcheck(const struct m if (V_ipcomp_enable == 0) return (0); + if (proto != IPPROTO_IPV4 && proto != IPPROTO_IPV6) + return (0); bzero(&src, sizeof(src)); bzero(&dst, sizeof(dst)); src.sa.sa_family = dst.sa.sa_family = AF_INET; @@ -760,12 +773,12 @@ ipcomp_attach(void) { #ifdef INET - ipe4_cookie = encap_attach_func(AF_INET, IPPROTO_IPV4, - ipcomp4_nonexp_encapcheck, &ipcomp_protosw, NULL); + ipe4_cookie = encap_attach_func(AF_INET, -1, + ipcomp4_nonexp_encapcheck, &ipcomp4_protosw, NULL); #endif #ifdef INET6 - ipe6_cookie = encap_attach_func(AF_INET6, IPPROTO_IPV6, - ipcomp6_nonexp_encapcheck, &ipcomp_protosw, NULL); + ipe6_cookie = encap_attach_func(AF_INET6, -1, + ipcomp6_nonexp_encapcheck, &ipcomp6_protosw, NULL); #endif xform_register(&ipcomp_xformsw); } From owner-svn-src-head@freebsd.org Sun Apr 24 17:31:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E942BB1B2EF; Sun, 24 Apr 2016 17:31:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id ACD961E3E; Sun, 24 Apr 2016 17:31:37 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id B2B3F25D3857; Sun, 24 Apr 2016 17:31:35 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D7170D1F812; Sun, 24 Apr 2016 17:31:34 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id FISL3P6HbnMO; Sun, 24 Apr 2016 17:31:33 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:9c8d:8bbc:f224:ce42] (unknown [IPv6:fde9:577b:c1a9:4410:9c8d:8bbc:f224:ce42]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2F9EED1F7FB; Sun, 24 Apr 2016 17:31:32 +0000 (UTC) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn commit: r298549 - head/sys/netipsec From: "Bjoern A. Zeeb" In-Reply-To: <201604241709.u3OH9pj4087192@repo.freebsd.org> Date: Sun, 24 Apr 2016 17:31:10 +0000 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <58AE996A-956E-450C-83BF-942DDFC2D735@FreeBSD.org> References: <201604241709.u3OH9pj4087192@repo.freebsd.org> To: "Andrey V. Elsukov" X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 17:31:38 -0000 > On 24 Apr 2016, at 17:09 , Andrey V. Elsukov wrote: > > Author: ae > Date: Sun Apr 24 17:09:51 2016 > New Revision: 298549 > URL: https://svnweb.freebsd.org/changeset/base/298549 > > Log: > Fix build for NOINET and NOINET6 kernels. > > Use own protosw structures for both address families. > Check proto in encapcheck function and use -1 as proto argument in > encap_attach_func(), both address families can have IPPROTO_IPV4 > and IPPROTO_IPV6 protocols. > > Reported by: bz Thanks for both fixes! :) Bjoern From owner-svn-src-head@freebsd.org Sun Apr 24 19:25:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B647B1BAEF; Sun, 24 Apr 2016 19:25:13 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BFAC01324; Sun, 24 Apr 2016 19:25:12 +0000 (UTC) (envelope-from lme@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3OJPBAL030210; Sun, 24 Apr 2016 19:25:11 GMT (envelope-from lme@FreeBSD.org) Received: (from lme@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OJPBu8030209; Sun, 24 Apr 2016 19:25:11 GMT (envelope-from lme@FreeBSD.org) Message-Id: <201604241925.u3OJPBu8030209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lme set sender to lme@FreeBSD.org using -f From: Lars Engels Date: Sun, 24 Apr 2016 19:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298550 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 19:25:13 -0000 Author: lme (ports committer) Date: Sun Apr 24 19:25:11 2016 New Revision: 298550 URL: https://svnweb.freebsd.org/changeset/base/298550 Log: Fix duplicate "name" variable that sneaked in with the rc description commit. Approved by: jhibbits Modified: head/etc/rc.d/geli2 Modified: head/etc/rc.d/geli2 ============================================================================== --- head/etc/rc.d/geli2 Sun Apr 24 17:09:51 2016 (r298549) +++ head/etc/rc.d/geli2 Sun Apr 24 19:25:11 2016 (r298550) @@ -34,7 +34,7 @@ . /etc/rc.subr name="geli2" -name="GELI disk encryption" +desc="GELI disk encryption" start_cmd="geli2_start" stop_cmd=":" From owner-svn-src-head@freebsd.org Sun Apr 24 20:31:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C002B1BAB9; Sun, 24 Apr 2016 20:31:23 +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 1DCB217B7; Sun, 24 Apr 2016 20:31:23 +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 u3OKVMaW048970; Sun, 24 Apr 2016 20:31:22 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OKVMFC048969; Sun, 24 Apr 2016 20:31:22 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604242031.u3OKVMFC048969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 24 Apr 2016 20:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298551 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 20:31:23 -0000 Author: pfg Date: Sun Apr 24 20:31:22 2016 New Revision: 298551 URL: https://svnweb.freebsd.org/changeset/base/298551 Log: fsck_ffs: Adopt some type safety for the journalling checks. fs_ncg is of type uint32, and we were indexing it with an int. Fixed this using an unsigned type and adopt some other unsigned indexes to remind us when we are dealing with unsigned numbers. Reviewed by: mckusick MFC after: 5 days Modified: head/sbin/fsck_ffs/suj.c Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Sun Apr 24 19:25:11 2016 (r298550) +++ head/sbin/fsck_ffs/suj.c Sun Apr 24 20:31:22 2016 (r298551) @@ -217,7 +217,7 @@ static void closedisk(const char *devnam) { struct csum *cgsum; - int i; + u_int i; /* * Recompute the fs summary info from correct cs summaries. @@ -2252,7 +2252,7 @@ suj_build(void) struct suj_seg *seg; union jrec *rec; int off; - int i; + u_int i; TAILQ_FOREACH(seg, &allsegs, ss_next) { if (debug) @@ -2540,10 +2540,10 @@ suj_read(void) struct jsegrec *rec; ufs2_daddr_t blk; int readsize; - int blocks; + u_int blocks; int recsize; int size; - int i; + u_int i; /* * Read records until we exhaust the journal space. If we find From owner-svn-src-head@freebsd.org Sun Apr 24 21:19:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D591B1B866; Sun, 24 Apr 2016 21:19:01 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FBEA1136; Sun, 24 Apr 2016 21:19:01 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3OLJ0gU063977; Sun, 24 Apr 2016 21:19:00 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OLJ0Pn063976; Sun, 24 Apr 2016 21:19:00 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201604242119.u3OLJ0Pn063976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Sun, 24 Apr 2016 21:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298552 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 21:19:01 -0000 Author: gordon (ports committer) Date: Sun Apr 24 21:19:00 2016 New Revision: 298552 URL: https://svnweb.freebsd.org/changeset/base/298552 Log: Add myself (finally) to the port committer's dot file. Approved by: mat (mentor) Differential Revision: https://reviews.freebsd.org/D6074 Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sun Apr 24 20:31:22 2016 (r298551) +++ head/share/misc/committers-ports.dot Sun Apr 24 21:19:00 2016 (r298552) @@ -110,6 +110,7 @@ gerald [label="Gerald Pfeifer\ngerald@Fr gjb [label="Glen Barber\ngjb@FreeBSD.org\n2012/06/19"] glarkin [label="Greg Larkin\nglarkin@FreeBSD.org\n2008/07/17"] glewis [label="Greg Lewis\nglewis@FreeBSD.org\n2002/04/08"] +gordon [label="Gordon Tetlow\ngordon@FreeBSD.org\n2014/10/14"] grembo [label="Michael Gmelin\ngrembo@FreeBSD.org\n2014/01/21"] gnn [label="George Neville-Neil\ngnn@FreeBSD.org\n2013/09/04"] hq [label="Herve Quiroz\nhq@FreeBSD.org\n2004/08/05"] @@ -347,6 +348,7 @@ eik -> trhodes erwin -> brix erwin -> clement erwin -> gabor +erwin -> gordon erwin -> lbr erwin -> lth erwin -> simon @@ -456,6 +458,7 @@ makc -> rakuco mat -> bmah mat -> dvl +mat -> gordon mat -> thierry mezz -> tmclaugh From owner-svn-src-head@freebsd.org Sun Apr 24 21:35:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E5DFB1BCA3; Sun, 24 Apr 2016 21:35:02 +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 4FDC81D74; Sun, 24 Apr 2016 21:35:02 +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 u3OLZ1pM070579; Sun, 24 Apr 2016 21:35:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3OLZ1ma070578; Sun, 24 Apr 2016 21:35:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604242135.u3OLZ1ma070578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 24 Apr 2016 21:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298553 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Apr 2016 21:35:02 -0000 Author: cem Date: Sun Apr 24 21:35:01 2016 New Revision: 298553 URL: https://svnweb.freebsd.org/changeset/base/298553 Log: AMD64 pmap: Use howmany() macro Use param.h howmany() instead of hand-rolled version. Sponsored by: EMC / Isilon Storage Division Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Apr 24 21:19:00 2016 (r298552) +++ head/sys/amd64/amd64/pmap.c Sun Apr 24 21:35:01 2016 (r298553) @@ -721,7 +721,7 @@ create_pagetables(vm_paddr_t *firstaddr) pml4_entry_t *p4_p; /* Allocate page table pages for the direct map */ - ndmpdp = (ptoa(Maxmem) + NBPDP - 1) >> PDPSHIFT; + ndmpdp = howmany(ptoa(Maxmem), NBPDP); if (ndmpdp < 4) /* Minimum 4GB of dirmap */ ndmpdp = 4; ndmpdpphys = howmany(ndmpdp, NPDPEPG); From owner-svn-src-head@freebsd.org Mon Apr 25 00:41:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A19CB1C7D1; Mon, 25 Apr 2016 00:41:25 +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 D901513E4; Mon, 25 Apr 2016 00:41:24 +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 u3P0fOH3024583; Mon, 25 Apr 2016 00:41:24 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P0fOte024582; Mon, 25 Apr 2016 00:41:24 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604250041.u3P0fOte024582@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 25 Apr 2016 00:41:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298556 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 00:41:25 -0000 Author: pfg Date: Mon Apr 25 00:41:23 2016 New Revision: 298556 URL: https://svnweb.freebsd.org/changeset/base/298556 Log: ifconfig: prevent some improbable signed integer overflows. ic_nchans, from struct:ieee80211req_chaninfo, is an unsigned int. Use an unsigned index to prevent overflowing the index. Adopt unsigned integers in other cases where it is useful to be aware of the unsigned quantities and there is no risk of the values being negative. MFC after: 1 week Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Sun Apr 24 22:13:55 2016 (r298555) +++ head/sbin/ifconfig/ifieee80211.c Mon Apr 25 00:41:23 2016 (r298556) @@ -225,7 +225,7 @@ static int canpromote(int i, int from, int to) { const struct ieee80211_channel *fc = &chaninfo->ic_chans[i]; - int j; + u_int j; if ((fc->ic_flags & from) != from) return i; @@ -304,7 +304,7 @@ promote(int i) static void mapfreq(struct ieee80211_channel *chan, int freq, int flags) { - int i; + u_int i; for (i = 0; i < chaninfo->ic_nchans; i++) { const struct ieee80211_channel *c = &chaninfo->ic_chans[i]; @@ -324,7 +324,7 @@ mapfreq(struct ieee80211_channel *chan, static void mapchan(struct ieee80211_channel *chan, int ieee, int flags) { - int i; + u_int i; for (i = 0; i < chaninfo->ic_nchans; i++) { const struct ieee80211_channel *c = &chaninfo->ic_chans[i]; @@ -3047,7 +3047,7 @@ copy_essid(char buf[], size_t bufsize, c { const u_int8_t *p; size_t maxlen; - int i; + u_int i; if (essid_len > bufsize) maxlen = bufsize; @@ -4251,7 +4251,7 @@ static void printkey(const struct ieee80211req_key *ik) { static const uint8_t zerodata[IEEE80211_KEYBUF_SIZE]; - int keylen = ik->ik_keylen; + u_int keylen = ik->ik_keylen; int printcontents; printcontents = printkeys && @@ -4288,7 +4288,7 @@ printkey(const struct ieee80211req_key * break; } if (printcontents) { - int i; + u_int i; printf(" <"); for (i = 0; i < keylen; i++) From owner-svn-src-head@freebsd.org Mon Apr 25 00:55:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D122B1CA5B; Mon, 25 Apr 2016 00:55:53 +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 E36431DDA; Mon, 25 Apr 2016 00:55:52 +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 u3P0tqRU030428; Mon, 25 Apr 2016 00:55:52 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P0tqqJ030427; Mon, 25 Apr 2016 00:55:52 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201604250055.u3P0tqqJ030427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 25 Apr 2016 00:55:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298559 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 00:55:53 -0000 Author: jhibbits Date: Mon Apr 25 00:55:51 2016 New Revision: 298559 URL: https://svnweb.freebsd.org/changeset/base/298559 Log: Init static compiled-in env when no metadata present. With this, a static environment can be compiled in via config(5). This allows, among other things, the use of a compiled-in debug console (hw.uart.dbgport) for kgdb. Modified: head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Mon Apr 25 00:52:37 2016 (r298558) +++ head/sys/powerpc/powerpc/machdep.c Mon Apr 25 00:55:51 2016 (r298559) @@ -274,6 +274,7 @@ powerpc_init(vm_offset_t fdt, vm_offset_ } else { bzero(__sbss_start, __sbss_end - __sbss_start); bzero(__bss_start, _end - __bss_start); + init_static_kenv(NULL, 0); } #ifdef BOOKE tlb1_init(); From owner-svn-src-head@freebsd.org Mon Apr 25 03:01:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEA38B1B2E0; Mon, 25 Apr 2016 03:01:58 +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 9E50516D2; Mon, 25 Apr 2016 03:01:58 +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 u3P31vkW067902; Mon, 25 Apr 2016 03:01:57 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P31vfA067901; Mon, 25 Apr 2016 03:01:57 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201604250301.u3P31vfA067901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 25 Apr 2016 03:01:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298560 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 03:01:58 -0000 Author: jhibbits Date: Mon Apr 25 03:01:57 2016 New Revision: 298560 URL: https://svnweb.freebsd.org/changeset/base/298560 Log: OR in the unsigned form of the MCAR lower register. When ORing in a register_t to a wider integer (vm_paddr_t), it gets sign extended, so high addresses overwrite the upper word with all 0xf. Cast to the unsigned form (u_register_t), to avoid this problem, and get correct addresses printed. Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Mon Apr 25 00:55:51 2016 (r298559) +++ head/sys/powerpc/powerpc/trap.c Mon Apr 25 03:01:57 2016 (r298560) @@ -434,7 +434,7 @@ printtrap(u_int vector, struct trapframe (u_long)mfspr(SPR_MSSSR0)); #elif defined(BOOKE) pa = mfspr(SPR_MCARU); - pa = (pa << 32) | mfspr(SPR_MCAR); + pa = (pa << 32) | (u_register_t)mfspr(SPR_MCAR); printf(" mcsr = 0x%lx\n", (u_long)mfspr(SPR_MCSR)); printf(" mcar = 0x%jx\n", (uintmax_t)pa); #endif From owner-svn-src-head@freebsd.org Mon Apr 25 03:14:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7958CB1B59C; Mon, 25 Apr 2016 03:14:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49FB91C7F; Mon, 25 Apr 2016 03:14:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3P3EtbZ072898; Mon, 25 Apr 2016 03:14:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P3EtRv072897; Mon, 25 Apr 2016 03:14:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604250314.u3P3EtRv072897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Apr 2016 03:14:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298561 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 03:14:56 -0000 Author: sephe Date: Mon Apr 25 03:14:55 2016 New Revision: 298561 URL: https://svnweb.freebsd.org/changeset/base/298561 Log: hn: Increase odrops for if_transmit method if drbr_enqueue fails. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 25 03:01:57 2016 (r298560) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 25 03:14:55 2016 (r298561) @@ -2700,8 +2700,10 @@ hn_transmit(struct ifnet *ifp, struct mb txr = &sc->hn_tx_ring[idx]; error = drbr_enqueue(ifp, txr->hn_mbuf_br, m); - if (error) + if (error) { + if_inc_counter(ifp, IFCOUNTER_OQDROPS, 1); return error; + } if (txr->hn_oactive) return 0; From owner-svn-src-head@freebsd.org Mon Apr 25 03:24:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D2D3B1B817; Mon, 25 Apr 2016 03:24:49 +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 3ED521194; Mon, 25 Apr 2016 03:24:49 +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 u3P3Omrg076035; Mon, 25 Apr 2016 03:24:48 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P3OmC9076034; Mon, 25 Apr 2016 03:24:48 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604250324.u3P3OmC9076034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Apr 2016 03:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298562 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 03:24:49 -0000 Author: jamie Date: Mon Apr 25 03:24:48 2016 New Revision: 298562 URL: https://svnweb.freebsd.org/changeset/base/298562 Log: Make jail(8) interpret escape codes in fstab the same as getfsent(3). PR: 208663 MFC after: 3 days Modified: head/usr.sbin/jail/command.c Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Mon Apr 25 03:14:55 2016 (r298561) +++ head/usr.sbin/jail/command.c Mon Apr 25 03:24:48 2016 (r298562) @@ -47,6 +47,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "jailp.h" @@ -444,8 +445,14 @@ run_command(struct cfjail *j) strcpy(comcs, comstring->s); argc = 0; for (cs = strtok(comcs, " \t\f\v\r\n"); cs && argc < 4; - cs = strtok(NULL, " \t\f\v\r\n")) + cs = strtok(NULL, " \t\f\v\r\n")) { + if (argc <= 1 && strunvis(cs, cs) < 0) { + jail_warnx(j, "%s: %s: fstab parse error", + j->intparams[comparam]->name, comstring->s); + return -1; + } argv[argc++] = cs; + } if (argc == 0) return 0; if (argc < 3) { From owner-svn-src-head@freebsd.org Mon Apr 25 03:48:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A63D2B1BDF7; Mon, 25 Apr 2016 03:48:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 561231D4B; Mon, 25 Apr 2016 03:48:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3P3mSR9082017; Mon, 25 Apr 2016 03:48:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P3mSMs082016; Mon, 25 Apr 2016 03:48:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604250348.u3P3mSMs082016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Apr 2016 03:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298563 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 03:48:29 -0000 Author: sephe Date: Mon Apr 25 03:48:28 2016 New Revision: 298563 URL: https://svnweb.freebsd.org/changeset/base/298563 Log: hyperv/hn: Allow users to configure ifq or bufring depth. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 25 03:24:48 2016 (r298562) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 25 03:48:28 2016 (r298563) @@ -291,6 +291,10 @@ static int hn_tx_ring_cnt = 0; SYSCTL_INT(_hw_hn, OID_AUTO, tx_ring_cnt, CTLFLAG_RDTUN, &hn_tx_ring_cnt, 0, "# of TX rings to use"); +static int hn_tx_swq_depth = 0; +SYSCTL_INT(_hw_hn, OID_AUTO, tx_swq_depth, CTLFLAG_RDTUN, + &hn_tx_swq_depth, 0, "Depth of IFQ or BUFRING"); + static u_int hn_cpu_index; /* @@ -348,6 +352,16 @@ hn_set_lro_lenlim(struct hn_softc *sc, i #endif static int +hn_get_txswq_depth(const struct hn_tx_ring *txr) +{ + + KASSERT(txr->hn_txdesc_cnt > 0, ("tx ring is not setup yet")); + if (hn_tx_swq_depth < txr->hn_txdesc_cnt) + return txr->hn_txdesc_cnt; + return hn_tx_swq_depth; +} + +static int hn_ifmedia_upd(struct ifnet *ifp __unused) { @@ -501,9 +515,11 @@ netvsc_attach(device_t dev) /* needed by hv_rf_on_device_add() code */ ifp->if_mtu = ETHERMTU; if (hn_use_if_start) { + int qdepth = hn_get_txswq_depth(&sc->hn_tx_ring[0]); + ifp->if_start = hn_start; - IFQ_SET_MAXLEN(&ifp->if_snd, 512); - ifp->if_snd.ifq_drv_maxlen = 511; + IFQ_SET_MAXLEN(&ifp->if_snd, qdepth); + ifp->if_snd.ifq_drv_maxlen = qdepth - 1; IFQ_SET_READY(&ifp->if_snd); } else { ifp->if_transmit = hn_transmit; @@ -2285,10 +2301,14 @@ hn_create_tx_ring(struct hn_softc *sc, i TASK_INIT(&txr->hn_tx_task, 0, hn_start_taskfunc, txr); TASK_INIT(&txr->hn_txeof_task, 0, hn_start_txeof_taskfunc, txr); } else { + int br_depth; + txr->hn_txeof = hn_xmit_txeof; TASK_INIT(&txr->hn_tx_task, 0, hn_xmit_taskfunc, txr); TASK_INIT(&txr->hn_txeof_task, 0, hn_xmit_txeof_taskfunc, txr); - txr->hn_mbuf_br = buf_ring_alloc(txr->hn_txdesc_cnt, M_NETVSC, + + br_depth = hn_get_txswq_depth(txr); + txr->hn_mbuf_br = buf_ring_alloc(br_depth, M_NETVSC, M_WAITOK, &txr->hn_tx_lock); } From owner-svn-src-head@freebsd.org Mon Apr 25 03:58:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70528B1B088; Mon, 25 Apr 2016 03:58:09 +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 25FE811C6; Mon, 25 Apr 2016 03:58:09 +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 u3P3w8XH084959; Mon, 25 Apr 2016 03:58:08 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P3w8wN084957; Mon, 25 Apr 2016 03:58:08 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604250358.u3P3w8wN084957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Apr 2016 03:58:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298564 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 03:58:09 -0000 Author: jamie Date: Mon Apr 25 03:58:08 2016 New Revision: 298564 URL: https://svnweb.freebsd.org/changeset/base/298564 Log: Remove the PR_REMOVE flag, which was meant as a temporary marker for a jail that might be seen mid-removal. It hasn't been doing the right thing since at least the ability to resurrect dying jails, and such resurrection also makes it unnecessary. Modified: head/sys/kern/kern_jail.c head/sys/sys/jail.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon Apr 25 03:48:28 2016 (r298563) +++ head/sys/kern/kern_jail.c Mon Apr 25 03:58:08 2016 (r298564) @@ -1222,7 +1222,7 @@ kern_jail_set(struct thread *td, struct } created = 1; mtx_lock(&ppr->pr_mtx); - if (ppr->pr_ref == 0 || (ppr->pr_flags & PR_REMOVE)) { + if (ppr->pr_ref == 0) { mtx_unlock(&ppr->pr_mtx); error = ENOENT; vfs_opterror(opts, "parent jail went away!"); @@ -2273,7 +2273,6 @@ sys_jail_remove(struct thread *td, struc /* Remove all descendants of this prison, then remove this prison. */ pr->pr_ref++; - pr->pr_flags |= PR_REMOVE; if (!LIST_EMPTY(&pr->pr_children)) { mtx_unlock(&pr->pr_mtx); lpr = NULL; @@ -2282,7 +2281,6 @@ sys_jail_remove(struct thread *td, struc if (cpr->pr_ref > 0) { tpr = cpr; cpr->pr_ref++; - cpr->pr_flags |= PR_REMOVE; } else { /* Already removed - do not do it again. */ tpr = NULL; Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Mon Apr 25 03:48:28 2016 (r298563) +++ head/sys/sys/jail.h Mon Apr 25 03:58:08 2016 (r298564) @@ -210,7 +210,6 @@ struct prison_racct { /* primary jail address. */ /* Internal flag bits */ -#define PR_REMOVE 0x01000000 /* In process of being removed */ #define PR_IP4 0x02000000 /* IPv4 restricted or disabled */ /* by this jail or an ancestor */ #define PR_IP6 0x04000000 /* IPv6 restricted or disabled */ From owner-svn-src-head@freebsd.org Mon Apr 25 04:24:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C72E8B1B705; Mon, 25 Apr 2016 04:24:01 +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 A39E01065; Mon, 25 Apr 2016 04:24:01 +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 u3P4O0iE093718; Mon, 25 Apr 2016 04:24:00 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P4O0rY093716; Mon, 25 Apr 2016 04:24:00 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604250424.u3P4O0rY093716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Apr 2016 04:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298565 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 04:24:01 -0000 Author: jamie Date: Mon Apr 25 04:24:00 2016 New Revision: 298565 URL: https://svnweb.freebsd.org/changeset/base/298565 Log: Add a new jail OSD method, PR_METHOD_REMOVE. It's called when a jail is removed from the user perspective, i.e. when the last pr_uref goes away, even though the jail mail still exist in the dying state. It will also be called if either PR_METHOD_CREATE or PR_METHOD_SET fail. PR: 48471 MFC after: 5 days Modified: head/sys/kern/kern_jail.c head/sys/sys/jail.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon Apr 25 03:58:08 2016 (r298564) +++ head/sys/kern/kern_jail.c Mon Apr 25 04:24:00 2016 (r298565) @@ -556,7 +556,8 @@ kern_jail_set(struct thread *td, struct #endif unsigned long hid; size_t namelen, onamelen; - int created, cuflags, descend, enforce, error, errmsg_len, errmsg_pos; + int born, created, cuflags, descend, enforce; + int error, errmsg_len, errmsg_pos; int gotchildmax, gotenforce, gothid, gotrsnum, gotslevel; int fi, jid, jsys, len, level; int childmax, osreldt, rsnum, slevel; @@ -1767,6 +1768,7 @@ kern_jail_set(struct thread *td, struct * for now, so new ones will remain unseen until after the module * handlers have completed. */ + born = pr->pr_uref == 0; if (!created && (ch_flags & PR_PERSIST & (pr_flags ^ pr->pr_flags))) { if (pr_flags & PR_PERSIST) { pr->pr_ref++; @@ -1836,15 +1838,20 @@ kern_jail_set(struct thread *td, struct /* Let the modules do their work. */ sx_downgrade(&allprison_lock); - if (created) { + if (born) { error = osd_jail_call(pr, PR_METHOD_CREATE, opts); if (error) { - prison_deref(pr, PD_LIST_SLOCKED); + (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); + prison_deref(pr, created + ? PD_LIST_SLOCKED + : PD_DEREF | PD_LIST_SLOCKED); goto done_errmsg; } } error = osd_jail_call(pr, PR_METHOD_SET, opts); if (error) { + if (born) + (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); prison_deref(pr, created ? PD_LIST_SLOCKED : PD_DEREF | PD_LIST_SLOCKED); @@ -1896,7 +1903,7 @@ kern_jail_set(struct thread *td, struct sx_sunlock(&allprison_lock); } - goto done_errmsg; + goto done_free; done_deref_locked: prison_deref(pr, created @@ -2596,19 +2603,46 @@ static void prison_deref(struct prison *pr, int flags) { struct prison *ppr, *tpr; + int ref, lasturef; if (!(flags & PD_LOCKED)) mtx_lock(&pr->pr_mtx); for (;;) { if (flags & PD_DEUREF) { pr->pr_uref--; + lasturef = pr->pr_uref == 0; + if (lasturef) + pr->pr_ref++; KASSERT(prison0.pr_uref != 0, ("prison0 pr_uref=0")); - } + } else + lasturef = 0; if (flags & PD_DEREF) pr->pr_ref--; - /* If the prison still has references, nothing else to do. */ - if (pr->pr_ref > 0) { + ref = pr->pr_ref; + mtx_unlock(&pr->pr_mtx); + + /* + * Tell the modules if the last user reference was removed + * (even it sticks around in dying state). + */ + if (lasturef) { + if (!(flags & (PD_LIST_SLOCKED | PD_LIST_XLOCKED))) { + if (ref > 1) { + sx_slock(&allprison_lock); + flags |= PD_LIST_SLOCKED; + } else { + sx_xlock(&allprison_lock); + flags |= PD_LIST_XLOCKED; + } + } + (void)osd_jail_call(pr, PR_METHOD_REMOVE, NULL); + mtx_lock(&pr->pr_mtx); + ref = --pr->pr_ref; mtx_unlock(&pr->pr_mtx); + } + + /* If the prison still has references, nothing else to do. */ + if (ref > 0) { if (flags & PD_LIST_SLOCKED) sx_sunlock(&allprison_lock); else if (flags & PD_LIST_XLOCKED) @@ -2616,7 +2650,6 @@ prison_deref(struct prison *pr, int flag return; } - mtx_unlock(&pr->pr_mtx); if (flags & PD_LIST_SLOCKED) { if (!sx_try_upgrade(&allprison_lock)) { sx_sunlock(&allprison_lock); Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Mon Apr 25 03:58:08 2016 (r298564) +++ head/sys/sys/jail.h Mon Apr 25 04:24:00 2016 (r298565) @@ -241,7 +241,8 @@ struct prison_racct { #define PR_METHOD_SET 2 #define PR_METHOD_CHECK 3 #define PR_METHOD_ATTACH 4 -#define PR_MAXMETHOD 5 +#define PR_METHOD_REMOVE 5 +#define PR_MAXMETHOD 6 /* * Lock/unlock a prison. From owner-svn-src-head@freebsd.org Mon Apr 25 04:28:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 166C3B1B7C1; Mon, 25 Apr 2016 04:28:00 +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 CDF9B1205; Mon, 25 Apr 2016 04:27:59 +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 u3P4RxRa093895; Mon, 25 Apr 2016 04:27:59 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P4RxCf093894; Mon, 25 Apr 2016 04:27:59 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604250427.u3P4RxCf093894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Apr 2016 04:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298566 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 04:28:00 -0000 Author: jamie Date: Mon Apr 25 04:27:58 2016 New Revision: 298566 URL: https://svnweb.freebsd.org/changeset/base/298566 Log: Pass the current/new jail to PR_METHOD_CHECK, which pushes the call until after the jail is found or created. This requires unlocking the jail for the call and re-locking it afterward, but that works because nothing in the jail has been changed yet, and other processes won't change the important fields as long as allprison_lock remains held. Keep better track of name vs namelc in kern_jail_set. Name should always be the hierarchical name (relative to the caller), and namelc the last component. PR: 48471 MFC after: 5 days Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Mon Apr 25 04:24:00 2016 (r298565) +++ head/sys/kern/kern_jail.c Mon Apr 25 04:27:58 2016 (r298566) @@ -555,7 +555,7 @@ kern_jail_set(struct thread *td, struct void *op; #endif unsigned long hid; - size_t namelen, onamelen; + size_t namelen, onamelen, pnamelen; int born, created, cuflags, descend, enforce; int error, errmsg_len, errmsg_pos; int gotchildmax, gotenforce, gothid, gotrsnum, gotslevel; @@ -580,7 +580,7 @@ kern_jail_set(struct thread *td, struct error = priv_check(td, PRIV_JAIL_ATTACH); if (error) return (error); - mypr = ppr = td->td_ucred->cr_prison; + mypr = td->td_ucred->cr_prison; if ((flags & JAIL_CREATE) && mypr->pr_childmax == 0) return (EPERM); if (flags & ~JAIL_SET_MASK) @@ -607,6 +607,13 @@ kern_jail_set(struct thread *td, struct #endif g_path = NULL; + cuflags = flags & (JAIL_CREATE | JAIL_UPDATE); + if (!cuflags) { + error = EINVAL; + vfs_opterror(opts, "no valid operation (create or update)"); + goto done_errmsg; + } + error = vfs_copyopt(opts, "jid", &jid, sizeof(jid)); if (error == ENOENT) jid = 0; @@ -1009,42 +1016,18 @@ kern_jail_set(struct thread *td, struct } /* - * Grab the allprison lock before letting modules check their - * parameters. Once we have it, do not let go so we'll have a - * consistent view of the OSD list. - */ - sx_xlock(&allprison_lock); - error = osd_jail_call(NULL, PR_METHOD_CHECK, opts); - if (error) - goto done_unlock_list; - - /* By now, all parameters should have been noted. */ - TAILQ_FOREACH(opt, opts, link) { - if (!opt->seen && strcmp(opt->name, "errmsg")) { - error = EINVAL; - vfs_opterror(opts, "unknown parameter: %s", opt->name); - goto done_unlock_list; - } - } - - /* - * See if we are creating a new record or updating an existing one. + * Find the specified jail, or at least its parent. * This abuses the file error codes ENOENT and EEXIST. */ - cuflags = flags & (JAIL_CREATE | JAIL_UPDATE); - if (!cuflags) { - error = EINVAL; - vfs_opterror(opts, "no valid operation (create or update)"); - goto done_unlock_list; - } pr = NULL; - namelc = NULL; + ppr = mypr; if (cuflags == JAIL_CREATE && jid == 0 && name != NULL) { namelc = strrchr(name, '.'); jid = strtoul(namelc != NULL ? namelc + 1 : name, &p, 10); if (*p != '\0') jid = 0; } + sx_xlock(&allprison_lock); if (jid != 0) { /* * See if a requested jid already exists. There is an @@ -1110,6 +1093,7 @@ kern_jail_set(struct thread *td, struct * and updates keyed by the name itself (where the name must exist * because that is the jail being updated). */ + namelc = NULL; if (name != NULL) { namelc = strrchr(name, '.'); if (namelc == NULL) @@ -1120,7 +1104,6 @@ kern_jail_set(struct thread *td, struct * parent and child names, and make sure the parent * exists or matches an already found jail. */ - *namelc = '\0'; if (pr != NULL) { if (strncmp(name, ppr->pr_name, namelc - name) || ppr->pr_name[namelc - name] != '\0') { @@ -1131,6 +1114,7 @@ kern_jail_set(struct thread *td, struct goto done_unlock_list; } } else { + *namelc = '\0'; ppr = prison_find_name(mypr, name); if (ppr == NULL) { error = ENOENT; @@ -1139,17 +1123,18 @@ kern_jail_set(struct thread *td, struct goto done_unlock_list; } mtx_unlock(&ppr->pr_mtx); + *namelc = '.'; } - name = ++namelc; + namelc++; } - if (name[0] != '\0') { - namelen = + if (namelc[0] != '\0') { + pnamelen = (ppr == &prison0) ? 0 : strlen(ppr->pr_name) + 1; name_again: deadpr = NULL; FOREACH_PRISON_CHILD(ppr, tpr) { if (tpr != pr && tpr->pr_ref > 0 && - !strcmp(tpr->pr_name + namelen, name)) { + !strcmp(tpr->pr_name + pnamelen, namelc)) { if (pr == NULL && cuflags != JAIL_CREATE) { mtx_lock(&tpr->pr_mtx); @@ -1226,7 +1211,8 @@ kern_jail_set(struct thread *td, struct if (ppr->pr_ref == 0) { mtx_unlock(&ppr->pr_mtx); error = ENOENT; - vfs_opterror(opts, "parent jail went away!"); + vfs_opterror(opts, "jail \"%s\" not found", + prison_name(mypr, ppr)); goto done_unlock_list; } ppr->pr_ref++; @@ -1280,8 +1266,8 @@ kern_jail_set(struct thread *td, struct pr->pr_id = jid; /* Set some default values, and inherit some from the parent. */ - if (name == NULL) - name = ""; + if (namelc == NULL) + namelc = ""; if (path == NULL) { path = "/"; root = mypr->pr_root; @@ -1361,7 +1347,7 @@ kern_jail_set(struct thread *td, struct mtx_lock(&pr->pr_mtx); /* * New prisons do not yet have a reference, because we do not - * want other to see the incomplete prison once the + * want others to see the incomplete prison once the * allprison_lock is downgraded. */ } else { @@ -1575,13 +1561,13 @@ kern_jail_set(struct thread *td, struct } #endif onamelen = namelen = 0; - if (name != NULL) { + if (namelc != NULL) { /* Give a default name of the jid. Also allow the name to be * explicitly the jid - but not any other number, and only in * normal form (no leading zero/etc). */ - if (name[0] == '\0') - snprintf(name = numbuf, sizeof(numbuf), "%d", jid); + if (namelc[0] == '\0') + snprintf(namelc = numbuf, sizeof(numbuf), "%d", jid); else if ((strtoul(namelc, &p, 10) != jid || namelc[0] < '1' || namelc[0] > '9') && *p == '\0') { error = EINVAL; @@ -1593,9 +1579,10 @@ kern_jail_set(struct thread *td, struct * Make sure the name isn't too long for the prison or its * children. */ - onamelen = strlen(pr->pr_name); - namelen = strlen(name); - if (strlen(ppr->pr_name) + namelen + 2 > sizeof(pr->pr_name)) { + pnamelen = (ppr == &prison0) ? 0 : strlen(ppr->pr_name) + 1; + onamelen = strlen(pr->pr_name + pnamelen); + namelen = strlen(namelc); + if (pnamelen + namelen + 1 > sizeof(pr->pr_name)) { error = ENAMETOOLONG; goto done_deref_locked; } @@ -1612,6 +1599,30 @@ kern_jail_set(struct thread *td, struct goto done_deref_locked; } + /* + * Let modules check their parameters. This requires unlocking and + * then re-locking the prison, but this is still a valid state as long + * as allprison_lock remains xlocked. + */ + mtx_unlock(&pr->pr_mtx); + error = osd_jail_call(pr, PR_METHOD_CHECK, opts); + if (error != 0) { + prison_deref(pr, created + ? PD_LIST_XLOCKED + : PD_DEREF | PD_LIST_XLOCKED); + goto done_releroot; + } + mtx_lock(&pr->pr_mtx); + + /* At this point, all valid parameters should have been noted. */ + TAILQ_FOREACH(opt, opts, link) { + if (!opt->seen && strcmp(opt->name, "errmsg")) { + error = EINVAL; + vfs_opterror(opts, "unknown parameter: %s", opt->name); + goto done_deref_locked; + } + } + /* Set the parameters of the prison. */ #ifdef INET redo_ip4 = 0; @@ -1685,12 +1696,12 @@ kern_jail_set(struct thread *td, struct FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) tpr->pr_devfs_rsnum = rsnum; } - if (name != NULL) { + if (namelc != NULL) { if (ppr == &prison0) - strlcpy(pr->pr_name, name, sizeof(pr->pr_name)); + strlcpy(pr->pr_name, namelc, sizeof(pr->pr_name)); else snprintf(pr->pr_name, sizeof(pr->pr_name), "%s.%s", - ppr->pr_name, name); + ppr->pr_name, namelc); /* Change this component of child names. */ FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) { bcopy(tpr->pr_name + onamelen, tpr->pr_name + namelen, From owner-svn-src-head@freebsd.org Mon Apr 25 04:36:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B81B7B1B9EC; Mon, 25 Apr 2016 04:36:55 +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 6BBF31737; Mon, 25 Apr 2016 04:36:55 +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 u3P4astu096838; Mon, 25 Apr 2016 04:36:54 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P4asFT096837; Mon, 25 Apr 2016 04:36:54 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604250436.u3P4asFT096837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Apr 2016 04:36:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298567 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 04:36:55 -0000 Author: jamie Date: Mon Apr 25 04:36:54 2016 New Revision: 298567 URL: https://svnweb.freebsd.org/changeset/base/298567 Log: Use the new PR_METHOD_REMOVE to clean up jail handling in POSIX message queues. Modified: head/sys/kern/uipc_mqueue.c Modified: head/sys/kern/uipc_mqueue.c ============================================================================== --- head/sys/kern/uipc_mqueue.c Mon Apr 25 04:27:58 2016 (r298566) +++ head/sys/kern/uipc_mqueue.c Mon Apr 25 04:36:54 2016 (r298567) @@ -154,11 +154,6 @@ struct mqfs_node { #define FPTOMQ(fp) ((struct mqueue *)(((struct mqfs_node *) \ (fp)->f_data)->mn_data)) -struct mqfs_osd { - struct task mo_task; - const void *mo_pr_root; -}; - TAILQ_HEAD(msgq, mqueue_msg); struct mqueue; @@ -244,9 +239,7 @@ static int mqfs_destroy(struct mqfs_node static void mqfs_fileno_alloc(struct mqfs_info *mi, struct mqfs_node *mn); static void mqfs_fileno_free(struct mqfs_info *mi, struct mqfs_node *mn); static int mqfs_allocv(struct mount *mp, struct vnode **vpp, struct mqfs_node *pn); -static int mqfs_prison_create(void *obj, void *data); -static void mqfs_prison_destructor(void *data); -static void mqfs_prison_remove_task(void *context, int pending); +static int mqfs_prison_remove(void *obj, void *data); /* * Message queue construction and maniplation @@ -656,9 +649,8 @@ mqfs_init(struct vfsconf *vfc) { struct mqfs_node *root; struct mqfs_info *mi; - struct prison *pr; osd_method_t methods[PR_MAXMETHOD] = { - [PR_METHOD_CREATE] = mqfs_prison_create, + [PR_METHOD_REMOVE] = mqfs_prison_remove, }; mqnode_zone = uma_zcreate("mqnode", sizeof(struct mqfs_node), @@ -686,13 +678,7 @@ mqfs_init(struct vfsconf *vfc) EVENTHANDLER_PRI_ANY); mq_fdclose = mqueue_fdclose; p31b_setcfg(CTL_P1003_1B_MESSAGE_PASSING, _POSIX_MESSAGE_PASSING); - - /* Note current jails. */ - mqfs_osd_jail_slot = osd_jail_register(mqfs_prison_destructor, methods); - sx_slock(&allprison_lock); - TAILQ_FOREACH(pr, &allprison, pr_list) - (void)mqfs_prison_create(pr, NULL); - sx_sunlock(&allprison_lock); + mqfs_osd_jail_slot = osd_jail_register(NULL, methods); return (0); } @@ -702,14 +688,11 @@ mqfs_init(struct vfsconf *vfc) static int mqfs_uninit(struct vfsconf *vfc) { - unsigned slot; struct mqfs_info *mi; if (!unloadable) return (EOPNOTSUPP); - slot = mqfs_osd_jail_slot; - mqfs_osd_jail_slot = 0; - osd_jail_deregister(slot); + osd_jail_deregister(mqfs_osd_jail_slot); EVENTHANDLER_DEREGISTER(process_exit, exit_tag); mi = &mqfs_data; mqfs_destroy(mi->mi_root); @@ -1563,64 +1546,22 @@ mqfs_rmdir(struct vop_rmdir_args *ap) #endif /* notyet */ - /* - * Set a destructor task with the prison's root + * See if this prison root is obsolete, and clean up associated queues if it is. */ static int -mqfs_prison_create(void *obj, void *data __unused) -{ - struct prison *pr = obj; - struct mqfs_osd *mo; - void *rsv; - - if (pr->pr_root == pr->pr_parent->pr_root) - return(0); - - mo = malloc(sizeof(struct mqfs_osd), M_PRISON, M_WAITOK); - rsv = osd_reserve(mqfs_osd_jail_slot); - TASK_INIT(&mo->mo_task, 0, mqfs_prison_remove_task, mo); - mtx_lock(&pr->pr_mtx); - mo->mo_pr_root = pr->pr_root; - (void)osd_jail_set_reserved(pr, mqfs_osd_jail_slot, rsv, mo); - mtx_unlock(&pr->pr_mtx); - return (0); -} - -/* - * Queue the task for after jail/OSD locks are released - */ -static void -mqfs_prison_destructor(void *data) -{ - struct mqfs_osd *mo = data; - - if (mqfs_osd_jail_slot != 0) - taskqueue_enqueue(taskqueue_thread, &mo->mo_task); - else - free(mo, M_PRISON); -} - -/* - * See if this prison root is obsolete, and clean up associated queues if it is - */ -static void -mqfs_prison_remove_task(void *context, int pending) +mqfs_prison_remove(void *obj, void *data __unused) { - struct mqfs_osd *mo = context; + const struct prison *pr = obj; + const struct prison *tpr; struct mqfs_node *pn, *tpn; - const struct prison *pr; - const void *pr_root; int found; - pr_root = mo->mo_pr_root; found = 0; - sx_slock(&allprison_lock); - TAILQ_FOREACH(pr, &allprison, pr_list) { - if (pr->pr_root == pr_root) + TAILQ_FOREACH(tpr, &allprison, pr_list) { + if (tpr->pr_root == pr->pr_root && tpr != pr && tpr->pr_ref > 0) found = 1; } - sx_sunlock(&allprison_lock); if (!found) { /* * No jails are rooted in this directory anymore, @@ -1629,15 +1570,14 @@ mqfs_prison_remove_task(void *context, i sx_xlock(&mqfs_data.mi_lock); LIST_FOREACH_SAFE(pn, &mqfs_data.mi_root->mn_children, mn_sibling, tpn) { - if (pn->mn_pr_root == pr_root) + if (pn->mn_pr_root == pr->pr_root) (void)do_unlink(pn, curthread->td_ucred); } sx_xunlock(&mqfs_data.mi_lock); } - free(mo, M_PRISON); + return (0); } - /* * Allocate a message queue */ From owner-svn-src-head@freebsd.org Mon Apr 25 04:58:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5EB9CB1BE0E; Mon, 25 Apr 2016 04:58:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3044F1092; Mon, 25 Apr 2016 04:58:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3P4wEKL003000; Mon, 25 Apr 2016 04:58:14 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P4wEYg002999; Mon, 25 Apr 2016 04:58:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604250458.u3P4wEYg002999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Apr 2016 04:58:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298568 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 04:58:15 -0000 Author: sephe Date: Mon Apr 25 04:58:14 2016 New Revision: 298568 URL: https://svnweb.freebsd.org/changeset/base/298568 Log: hyperv/et: Strip extra white space in function name Reported by: Sascha Wildner MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_et.c Modified: head/sys/dev/hyperv/vmbus/hv_et.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_et.c Mon Apr 25 04:36:54 2016 (r298567) +++ head/sys/dev/hyperv/vmbus/hv_et.c Mon Apr 25 04:58:14 2016 (r298568) @@ -100,7 +100,7 @@ hv_et_intr(struct trapframe *frame) } static void -hv_et_identify (driver_t *driver, device_t parent) +hv_et_identify(driver_t *driver, device_t parent) { if (device_find_child(parent, "hv_et", -1) != NULL) return; From owner-svn-src-head@freebsd.org Mon Apr 25 05:22:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38861B1C52D; Mon, 25 Apr 2016 05:22:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0604D1DE7; Mon, 25 Apr 2016 05:22:36 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3P5MahO011668; Mon, 25 Apr 2016 05:22:36 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P5MaXY011667; Mon, 25 Apr 2016 05:22:36 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604250522.u3P5MaXY011667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Apr 2016 05:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298569 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 05:22:37 -0000 Author: sephe Date: Mon Apr 25 05:22:35 2016 New Revision: 298569 URL: https://svnweb.freebsd.org/changeset/base/298569 Log: hyperv/channel: Remove the unnecessary 'new' flag MFC after: 1 week Sponsored by: Microsoft OSTC 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 Mon Apr 25 04:58:14 2016 (r298568) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Apr 25 05:22:35 2016 (r298569) @@ -174,13 +174,10 @@ hv_vmbus_free_vmbus_channel(hv_vmbus_cha static void vmbus_channel_process_offer(hv_vmbus_channel *new_channel) { - boolean_t f_new; hv_vmbus_channel* channel; int ret; uint32_t relid; - f_new = TRUE; - channel = NULL; relid = new_channel->offer_msg.child_rel_id; /* * Make sure this is a new offer @@ -196,14 +193,12 @@ vmbus_channel_process_offer(hv_vmbus_cha sizeof(hv_guid)) == 0 && memcmp(&channel->offer_msg.offer.interface_instance, &new_channel->offer_msg.offer.interface_instance, - sizeof(hv_guid)) == 0) { - f_new = FALSE; + sizeof(hv_guid)) == 0) break; - } } - if (f_new) { - /* Insert at tail */ + if (channel == NULL) { + /* Install the new primary channel */ TAILQ_INSERT_TAIL( &hv_vmbus_g_connection.channel_anchor, new_channel, @@ -213,7 +208,7 @@ vmbus_channel_process_offer(hv_vmbus_cha /*XXX add new channel to percpu_list */ - if (!f_new) { + if (channel != NULL) { /* * Check if this is a sub channel. */ From owner-svn-src-head@freebsd.org Mon Apr 25 05:30:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1370B1C644; Mon, 25 Apr 2016 05:30:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6511D10BB; Mon, 25 Apr 2016 05:30:43 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3P5UgfT012081; Mon, 25 Apr 2016 05:30:42 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P5UgFq012080; Mon, 25 Apr 2016 05:30:42 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604250530.u3P5UgFq012080@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Apr 2016 05:30:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298570 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 05:30:43 -0000 Author: sephe Date: Mon Apr 25 05:30:42 2016 New Revision: 298570 URL: https://svnweb.freebsd.org/changeset/base/298570 Log: hyperv/channel: Minor style changes; no functional changes. MFC after: 1 week Sponsored by: Microsoft OSTC 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 Mon Apr 25 05:22:35 2016 (r298569) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Apr 25 05:30:42 2016 (r298570) @@ -186,8 +186,7 @@ vmbus_channel_process_offer(hv_vmbus_cha hv_vmbus_g_connection.channels[relid] = new_channel; TAILQ_FOREACH(channel, &hv_vmbus_g_connection.channel_anchor, - list_entry) - { + list_entry) { if (memcmp(&channel->offer_msg.offer.interface_type, &new_channel->offer_msg.offer.interface_type, sizeof(hv_guid)) == 0 && @@ -199,10 +198,8 @@ vmbus_channel_process_offer(hv_vmbus_cha if (channel == NULL) { /* Install the new primary channel */ - TAILQ_INSERT_TAIL( - &hv_vmbus_g_connection.channel_anchor, - new_channel, - list_entry); + TAILQ_INSERT_TAIL(&hv_vmbus_g_connection.channel_anchor, + new_channel, list_entry); } mtx_unlock(&hv_vmbus_g_connection.channel_lock); @@ -219,10 +216,8 @@ vmbus_channel_process_offer(hv_vmbus_cha new_channel->primary_channel = channel; new_channel->device = channel->device; mtx_lock(&channel->sc_lock); - TAILQ_INSERT_TAIL( - &channel->sc_list_anchor, - new_channel, - sc_list_entry); + TAILQ_INSERT_TAIL(&channel->sc_list_anchor, + new_channel, sc_list_entry); mtx_unlock(&channel->sc_lock); if (bootverbose) { @@ -246,14 +241,13 @@ vmbus_channel_process_offer(hv_vmbus_cha /*XXX add it to percpu_list */ new_channel->state = HV_CHANNEL_OPEN_STATE; - if (channel->sc_creation_callback != NULL) { + if (channel->sc_creation_callback != NULL) channel->sc_creation_callback(new_channel); - } return; } - hv_vmbus_free_vmbus_channel(new_channel); - return; + hv_vmbus_free_vmbus_channel(new_channel); + return; } new_channel->state = HV_CHANNEL_OPEN_STATE; @@ -275,10 +269,8 @@ vmbus_channel_process_offer(hv_vmbus_cha ret = hv_vmbus_child_device_register(new_channel->device); if (ret != 0) { mtx_lock(&hv_vmbus_g_connection.channel_lock); - TAILQ_REMOVE( - &hv_vmbus_g_connection.channel_anchor, - new_channel, - list_entry); + TAILQ_REMOVE(&hv_vmbus_g_connection.channel_anchor, + new_channel, list_entry); mtx_unlock(&hv_vmbus_g_connection.channel_lock); hv_vmbus_free_vmbus_channel(new_channel); } From owner-svn-src-head@freebsd.org Mon Apr 25 05:46:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01BA0B1C96E; Mon, 25 Apr 2016 05:46:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD89818B3; Mon, 25 Apr 2016 05:46:45 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3P5kiC3017997; Mon, 25 Apr 2016 05:46:44 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P5kiAR017996; Mon, 25 Apr 2016 05:46:44 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604250546.u3P5kiAR017996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Apr 2016 05:46:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298571 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 05:46:46 -0000 Author: sephe Date: Mon Apr 25 05:46:44 2016 New Revision: 298571 URL: https://svnweb.freebsd.org/changeset/base/298571 Log: hyperv/channel: Remove unapplied comment MFC after: 1 week Sponsored by: Microsoft OSTC 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 Mon Apr 25 05:30:42 2016 (r298570) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Apr 25 05:46:44 2016 (r298571) @@ -203,8 +203,6 @@ vmbus_channel_process_offer(hv_vmbus_cha } mtx_unlock(&hv_vmbus_g_connection.channel_lock); - /*XXX add new channel to percpu_list */ - if (channel != NULL) { /* * Check if this is a sub channel. @@ -238,8 +236,6 @@ vmbus_channel_process_offer(hv_vmbus_cha "its primary channel is <%p>.\n", new_channel, new_channel->primary_channel); - /*XXX add it to percpu_list */ - new_channel->state = HV_CHANNEL_OPEN_STATE; if (channel->sc_creation_callback != NULL) channel->sc_creation_callback(new_channel); From owner-svn-src-head@freebsd.org Mon Apr 25 05:58:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60B8DB1CBBF; Mon, 25 Apr 2016 05:58:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3111EA5; Mon, 25 Apr 2016 05:58:33 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3P5wWDh021091; Mon, 25 Apr 2016 05:58:32 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P5wWks021090; Mon, 25 Apr 2016 05:58:32 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604250558.u3P5wWks021090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Apr 2016 05:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298572 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 05:58:33 -0000 Author: sephe Date: Mon Apr 25 05:58:32 2016 New Revision: 298572 URL: https://svnweb.freebsd.org/changeset/base/298572 Log: hyperv/channel: Log a warning about duplicated primary channel offer MFC after: 1 week Sponsored by: Microsoft OSTC 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 Mon Apr 25 05:46:44 2016 (r298571) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Apr 25 05:58:32 2016 (r298572) @@ -242,6 +242,8 @@ vmbus_channel_process_offer(hv_vmbus_cha return; } + printf("VMBUS: duplicated primary channel%u\n", + new_channel->offer_msg.child_rel_id); hv_vmbus_free_vmbus_channel(new_channel); return; } From owner-svn-src-head@freebsd.org Mon Apr 25 06:08:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95316B1CF22; Mon, 25 Apr 2016 06:08:46 +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 666251670; Mon, 25 Apr 2016 06:08:46 +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 u3P68jk0024046; Mon, 25 Apr 2016 06:08:45 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P68jDM024045; Mon, 25 Apr 2016 06:08:45 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604250608.u3P68jDM024045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Apr 2016 06:08:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298573 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 06:08:46 -0000 Author: jamie Date: Mon Apr 25 06:08:45 2016 New Revision: 298573 URL: https://svnweb.freebsd.org/changeset/base/298573 Log: linux_map_osrel doesn't need to be checked in linux_prison_set, since it already was in linux_prison_check. Modified: head/sys/compat/linux/linux_mib.c Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Mon Apr 25 05:58:32 2016 (r298572) +++ head/sys/compat/linux/linux_mib.c Mon Apr 25 06:08:45 2016 (r298573) @@ -153,7 +153,8 @@ linux_map_osrel(char *osrelease, int *os if (v < 1000000) return (EINVAL); - *osrel = v; + if (osrel != NULL) + *osrel = v; return (0); } @@ -249,7 +250,7 @@ linux_prison_check(void *obj __unused, v { struct vfsoptlist *opts = data; char *osname, *osrelease; - int error, jsys, len, osrel, oss_version; + int error, jsys, len, oss_version; /* Check that the parameters are correct. */ error = vfs_copyopt(opts, "linux", &jsys, sizeof(jsys)); @@ -280,7 +281,7 @@ linux_prison_check(void *obj __unused, v vfs_opterror(opts, "linux.osrelease too long"); return (ENAMETOOLONG); } - error = linux_map_osrel(osrelease, &osrel); + error = linux_map_osrel(osrelease, NULL); if (error != 0) { vfs_opterror(opts, "linux.osrelease format error"); return (error); @@ -339,11 +340,7 @@ linux_prison_set(void *obj, void *data) */ linux_alloc_prison(pr, &lpr); if (osrelease) { - error = linux_map_osrel(osrelease, &lpr->pr_osrel); - if (error) { - mtx_unlock(&pr->pr_mtx); - return (error); - } + (void)linux_map_osrel(osrelease, &lpr->pr_osrel); strlcpy(lpr->pr_osrelease, osrelease, LINUX_MAX_UTSNAME); } From owner-svn-src-head@freebsd.org Mon Apr 25 09:00:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41A7FB12202; Mon, 25 Apr 2016 09:00:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E2A291320; Mon, 25 Apr 2016 09:00:07 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3P907Tr076126; Mon, 25 Apr 2016 09:00:07 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3P906Xd076124; Mon, 25 Apr 2016 09:00:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604250900.u3P906Xd076124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Apr 2016 09:00:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298574 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 09:00:08 -0000 Author: sephe Date: Mon Apr 25 09:00:06 2016 New Revision: 298574 URL: https://svnweb.freebsd.org/changeset/base/298574 Log: hyperv/channel: Add functions to synchronize sub-channel offers MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Mon Apr 25 06:08:45 2016 (r298573) +++ head/sys/dev/hyperv/include/hyperv.h Mon Apr 25 09:00:06 2016 (r298574) @@ -818,6 +818,7 @@ typedef struct hv_vmbus_channel { */ TAILQ_HEAD(, hv_vmbus_channel) sc_list_anchor; TAILQ_ENTRY(hv_vmbus_channel) sc_list_entry; + int subchan_cnt; /* * The primary channel this sub-channle belongs to. @@ -914,6 +915,9 @@ int hv_vmbus_channel_teardown_gpdal( struct hv_vmbus_channel* vmbus_select_outgoing_channel(struct hv_vmbus_channel *promary); void vmbus_channel_cpu_set(struct hv_vmbus_channel *chan, int cpu); +struct hv_vmbus_channel ** + vmbus_get_subchan(struct hv_vmbus_channel *pri_chan, int subchan_cnt); +void vmbus_rel_subchan(struct hv_vmbus_channel **subchan, int subchan_cnt); /** * @brief Get physical address from virtual Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Apr 25 06:08:45 2016 (r298573) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Mon Apr 25 09:00:06 2016 (r298574) @@ -239,6 +239,17 @@ vmbus_channel_process_offer(hv_vmbus_cha new_channel->state = HV_CHANNEL_OPEN_STATE; if (channel->sc_creation_callback != NULL) channel->sc_creation_callback(new_channel); + + /* + * Bump up sub-channel count and notify anyone that is + * interested in this sub-channel, after this sub-channel + * is setup. + */ + mtx_lock(&channel->sc_lock); + channel->subchan_cnt++; + mtx_unlock(&channel->sc_lock); + wakeup(channel); + return; } @@ -771,3 +782,41 @@ vmbus_scan(void) mtx_sleep(&vmbus_devcnt, &vmbus_chwait_lock, 0, "waitdev", 0); mtx_unlock(&vmbus_chwait_lock); } + +struct hv_vmbus_channel ** +vmbus_get_subchan(struct hv_vmbus_channel *pri_chan, int subchan_cnt) +{ + struct hv_vmbus_channel **ret, *chan; + int i; + + ret = malloc(subchan_cnt * sizeof(struct hv_vmbus_channel *), M_TEMP, + M_WAITOK); + + mtx_lock(&pri_chan->sc_lock); + + while (pri_chan->subchan_cnt < subchan_cnt) + mtx_sleep(pri_chan, &pri_chan->sc_lock, 0, "subch", 0); + + i = 0; + TAILQ_FOREACH(chan, &pri_chan->sc_list_anchor, sc_list_entry) { + /* TODO: refcnt chan */ + ret[i] = chan; + + ++i; + if (i == subchan_cnt) + break; + } + KASSERT(i == subchan_cnt, ("invalid subchan count %d, should be %d", + pri_chan->subchan_cnt, subchan_cnt)); + + mtx_unlock(&pri_chan->sc_lock); + + return ret; +} + +void +vmbus_rel_subchan(struct hv_vmbus_channel **subchan, int subchan_cnt __unused) +{ + + free(subchan, M_TEMP); +} From owner-svn-src-head@freebsd.org Mon Apr 25 10:16:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD51FB1AEF8; Mon, 25 Apr 2016 10:16:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7453312DB; Mon, 25 Apr 2016 10:16:08 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3PAG7bH002996; Mon, 25 Apr 2016 10:16:07 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PAG7HW002995; Mon, 25 Apr 2016 10:16:07 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604251016.u3PAG7HW002995@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Mon, 25 Apr 2016 10:16:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298575 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 10:16:08 -0000 Author: sephe Date: Mon Apr 25 10:16:07 2016 New Revision: 298575 URL: https://svnweb.freebsd.org/changeset/base/298575 Log: hyperv/hn: Synchronize sub-channel offers MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 25 09:00:06 2016 (r298574) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Apr 25 10:16:07 2016 (r298575) @@ -421,7 +421,7 @@ static int netvsc_attach(device_t dev) { struct hv_device *device_ctx = vmbus_get_devctx(dev); - struct hv_vmbus_channel *chan; + struct hv_vmbus_channel *pri_chan; netvsc_device_info device_info; hn_softc_t *sc; int unit = device_get_unit(dev); @@ -502,12 +502,12 @@ netvsc_attach(device_t dev) /* * Associate the first TX/RX ring w/ the primary channel. */ - chan = device_ctx->channel; - KASSERT(HV_VMBUS_CHAN_ISPRIMARY(chan), ("not primary channel")); - KASSERT(chan->offer_msg.offer.sub_channel_index == 0, + pri_chan = device_ctx->channel; + KASSERT(HV_VMBUS_CHAN_ISPRIMARY(pri_chan), ("not primary channel")); + KASSERT(pri_chan->offer_msg.offer.sub_channel_index == 0, ("primary channel subidx %u", - chan->offer_msg.offer.sub_channel_index)); - hn_channel_attach(sc, chan); + pri_chan->offer_msg.offer.sub_channel_index)); + hn_channel_attach(sc, pri_chan); ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = hn_ioctl; @@ -547,6 +547,19 @@ netvsc_attach(device_t dev) error = hv_rf_on_device_add(device_ctx, &device_info, ring_cnt); if (error) goto failed; + + if (sc->net_dev->num_channel > 1) { + struct hv_vmbus_channel **subchan; + int subchan_cnt = sc->net_dev->num_channel - 1; + + /* + * Wait for sub-channels setup to complete. + */ + subchan = vmbus_get_subchan(pri_chan, subchan_cnt); + vmbus_rel_subchan(subchan, subchan_cnt); + device_printf(dev, "%d sub-channels setup done\n", subchan_cnt); + } + KASSERT(sc->net_dev->num_channel > 0 && sc->net_dev->num_channel <= sc->hn_rx_ring_inuse, ("invalid channel count %u, should be less than %d", From owner-svn-src-head@freebsd.org Mon Apr 25 12:35:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E865B1BB68; Mon, 25 Apr 2016 12:35:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0A27B1EFF; Mon, 25 Apr 2016 12:35:37 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EE2F01FE024; Mon, 25 Apr 2016 14:35:33 +0200 (CEST) Subject: Re: svn commit: r298543 - head/sys/ofed/drivers/infiniband/core To: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604241556.u3OFu6Gk064647@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <571E0FDB.9000508@selasky.org> Date: Mon, 25 Apr 2016 14:38:51 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201604241556.u3OFu6Gk064647@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 12:35:37 -0000 On 04/24/16 17:56, Bjoern A. Zeeb wrote: > Author: bz > Date: Sun Apr 24 15:56:05 2016 > New Revision: 298543 > URL: https://svnweb.freebsd.org/changeset/base/298543 > > Log: > Fix NOIP kernels to compile. > > Modified: > head/sys/ofed/drivers/infiniband/core/cma.c > > Modified: head/sys/ofed/drivers/infiniband/core/cma.c > ============================================================================== > --- head/sys/ofed/drivers/infiniband/core/cma.c Sun Apr 24 14:49:01 2016 (r298542) > +++ head/sys/ofed/drivers/infiniband/core/cma.c Sun Apr 24 15:56:05 2016 (r298543) > @@ -2319,6 +2319,7 @@ static int cma_bind_addr(struct rdma_cm_ > if (!cma_any_addr(src_addr)) > return rdma_bind_addr(id, src_addr); > else { > +#if defined(INET6) || defined(INET) > union { > #ifdef INET > struct sockaddr_in in; > @@ -2327,6 +2328,7 @@ static int cma_bind_addr(struct rdma_cm_ > struct sockaddr_in6 in6; > #endif > } addr; > +#endif > > switch(dst_addr->sa_family) { > #ifdef INET > > Thank you Bjoern! --HPS From owner-svn-src-head@freebsd.org Mon Apr 25 13:20:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0877B1C5B5; Mon, 25 Apr 2016 13:20:36 +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 B1C041285; Mon, 25 Apr 2016 13:20:36 +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 u3PDKZ10057760; Mon, 25 Apr 2016 13:20:35 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PDKZtI057759; Mon, 25 Apr 2016 13:20:35 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201604251320.u3PDKZtI057759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 25 Apr 2016 13:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298577 - head/usr.bin/mkuzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 13:20:37 -0000 Author: bz Date: Mon Apr 25 13:20:35 2016 New Revision: 298577 URL: https://svnweb.freebsd.org/changeset/base/298577 Log: Try to make gcc builds happy again by removing a redundant declaration. Modified: head/usr.bin/mkuzip/mkuzip.c Modified: head/usr.bin/mkuzip/mkuzip.c ============================================================================== --- head/usr.bin/mkuzip/mkuzip.c Mon Apr 25 12:25:30 2016 (r298576) +++ head/usr.bin/mkuzip/mkuzip.c Mon Apr 25 13:20:35 2016 (r298577) @@ -78,7 +78,6 @@ static struct mkuz_format ulzma_fmt = { static struct mkuz_blk *readblock(int, u_int32_t); static void usage(void); static void cleanup(void); -int mkuz_memvcmp(const void *, unsigned char, size_t); static char *cleanfile = NULL; From owner-svn-src-head@freebsd.org Mon Apr 25 13:20:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D91B6B1C618; Mon, 25 Apr 2016 13:20:58 +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 A690F165C; Mon, 25 Apr 2016 13:20:58 +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 u3PDKvc6057817; Mon, 25 Apr 2016 13:20:57 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PDKvsJ057815; Mon, 25 Apr 2016 13:20:57 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604251320.u3PDKvsJ057815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 25 Apr 2016 13:20:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298578 - in head/sys: conf riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 13:20:59 -0000 Author: br Date: Mon Apr 25 13:20:57 2016 New Revision: 298578 URL: https://svnweb.freebsd.org/changeset/base/298578 Log: Revert r298477 ("Clear the DDR memory"). There is no need to clear all the DDR memory (we only need to clear BSS section). I was playing with non-default version of hardware (the bitfile synthesized for 4-level page memory system) and clearing was helpful, but then realized support for 4-level page system is untested/broken in both RocketCore and lowRISC. Modified: head/sys/conf/options.riscv head/sys/riscv/riscv/locore.S Modified: head/sys/conf/options.riscv ============================================================================== --- head/sys/conf/options.riscv Mon Apr 25 13:20:35 2016 (r298577) +++ head/sys/conf/options.riscv Mon Apr 25 13:20:57 2016 (r298578) @@ -2,4 +2,3 @@ RISCV opt_global.h VFP opt_global.h -DDR_CLEAR_SIZE opt_global.h Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Mon Apr 25 13:20:35 2016 (r298577) +++ head/sys/riscv/riscv/locore.S Mon Apr 25 13:20:57 2016 (r298578) @@ -126,17 +126,6 @@ _start: csrr a0, mhartid bnez a0, mpentry -#if defined(DDR_CLEAR_SIZE) - /* Clear DDR memory */ - la t0, _end - li t1, DDR_CLEAR_SIZE -1: - sd zero, 0(t0) - addi t0, t0, 8 - bltu t0, t1, 1b - /* End */ -#endif - /* Build event queue for current core */ build_ring From owner-svn-src-head@freebsd.org Mon Apr 25 13:30:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 871B0B1C7F0; Mon, 25 Apr 2016 13:30:38 +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 54AA41B9C; Mon, 25 Apr 2016 13:30:38 +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 u3PDUbRo060758; Mon, 25 Apr 2016 13:30:37 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PDUbM3060757; Mon, 25 Apr 2016 13:30:37 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604251330.u3PDUbM3060757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 25 Apr 2016 13:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298579 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 13:30:38 -0000 Author: br Date: Mon Apr 25 13:30:37 2016 New Revision: 298579 URL: https://svnweb.freebsd.org/changeset/base/298579 Log: Do not setup machine exception vector. Sounds strange, but both RocketCore and lowRISC do not operate if we set it. All the known implementations (Spike, QEMU, RocketCore, lowRISC) uses default machine trap vector address and operates fine with this. Original Berkeley Boot Loader (bbl) does not set this as well. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/riscv/locore.S Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Mon Apr 25 13:20:57 2016 (r298578) +++ head/sys/riscv/riscv/locore.S Mon Apr 25 13:30:37 2016 (r298579) @@ -133,9 +133,6 @@ _start: la t0, hardstack_end csrw mscratch, t0 - la t0, mentry - csrw mtvec, t0 - li t0, 0 csrw sscratch, t0 @@ -335,10 +332,6 @@ ENTRY(mpentry) lw t1, 0(t0) beqz t1, 1b - /* Setup machine exception vector */ - la t0, mentry - csrw mtvec, t0 - /* Build event queue ring for this core */ build_ring From owner-svn-src-head@freebsd.org Mon Apr 25 14:40:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E92BB1BA4C for ; Mon, 25 Apr 2016 14:40:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm47-vm7.bullet.mail.bf1.yahoo.com (nm47-vm7.bullet.mail.bf1.yahoo.com [216.109.115.142]) (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 654761F58 for ; Mon, 25 Apr 2016 14:40:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461594853; bh=d+ierU8X5UlF1aO9XnTtz7IzSyIEW0thnMmGizMFQgc=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=Z7yy+m4DYJL2bT7kpFvBwYLs/qw5bJGl7awZcA3Y0LFbDyzW21WMImTYwcjRU0/9IrRHgXBzFfK8Dev0WpOl5UEiaCU+y+8+LWqOXvCzv1+lYX/0oqsGdpzXEsWDKwXg0pO6loYwgUoIWoSvCsO/BIhG1yGVTpbXLEFa0xRFHcsORXH4xTqL6fQdCuzOQEsJGbrgDaH/c7FAaFdzaRsp/Z25qLYUGsbKc0vl3VugM0JJWv+bCYqpljJEpD4EH6TICPTgaYMqve+59fmlt4YRauK43dqwbvcK2JCDFyqJqjs6f91GQ+u2LOCNPJY6g54ANY/OAsRhgCpj1wLQiMJpQw== Received: from [98.139.170.181] by nm47.bullet.mail.bf1.yahoo.com with NNFMP; 25 Apr 2016 14:34:13 -0000 Received: from [98.139.211.195] by tm24.bullet.mail.bf1.yahoo.com with NNFMP; 25 Apr 2016 14:34:13 -0000 Received: from [127.0.0.1] by smtp204.mail.bf1.yahoo.com with NNFMP; 25 Apr 2016 14:34:13 -0000 X-Yahoo-Newman-Id: 661823.91304.bm@smtp204.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FCM5QVcVM1lSxcD_mycIvyJzWyD_lz5OhgOuvTtHN_oY9Kk ZEIjnV61PE_TKUFbUKOEsQwQaaHsoCc96yxuqgAbMkXKX.MHkH2j02wE7VWx GySzaIqLR11JlTQAkcnghO1S2fSF7Sw3eM3LeIFwxKPt.IJSIvY8iw.ajeRD mRrCaEL8nrn7JqK7mbRdCbV7CAxfFRW2Xqbycp14t0fQw48lpbDmR2qjpqM. MnMA7hq7ARshBd59jL7hwq0s9gprp2_Lng.QxBzJkckwqiVjDba4Ctouas42 THTAiWP8w.nheFpgp7MTtz2IVq60UjPm0.2GEQRZdElIJbXjp2_14UnRaCB_ VY24X0BWhYOimuM7Dq54IJi3QROjgGgHPGCiykkKReK9T.i63Btv2cBTzpHA I1mL4wSSXBhH8UO21Ln4zqAMr3147...FOJcigE6n3SL.AtmGm97Yesh47pi rg6LJ3HgvK.7CuTipGbgcHaCG.cSs125cIirttq3GvRxZBxXHiNDKhvS6Nif IOinPVeY_BXaUC5hD6AvdC3Wxzne1Hz5O X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298443 - head/usr.bin/stat To: Marcelo Araujo References: <201604220343.u3M3h69m058753@repo.freebsd.org> Cc: luke , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <571E2AF2.2060300@FreeBSD.org> Date: Mon, 25 Apr 2016 09:34:26 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 14:40:59 -0000 Marcelo, please revert. And check your script, of course. Pedro. On 23/04/2016 04:23, luke wrote: > On Fri, Apr 22, 2016 at 11:43 AM, Marcelo Araujo > wrote: > > Author: araujo > Date: Fri Apr 22 03:43:06 2016 > New Revision: 298443 > URL: https://svnweb.freebsd.org/changeset/base/298443 > > Log: > Use macro MAX() from sys/param.h. > > MFC after: 2 weeks. > > Modified: > head/usr.bin/stat/stat.c > > Modified: head/usr.bin/stat/stat.c > ============================================================================== > --- head/usr.bin/stat/stat.c Fri Apr 22 03:37:27 2016 > (r298442) > +++ head/usr.bin/stat/stat.c Fri Apr 22 03:43:06 2016 > (r298443) > @@ -1025,7 +1025,7 @@ format1(const struct stat *st, > * > * Nanoseconds: long. > */ > - (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 > ? 9 : prec); > + (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, > prec)); > (void)strcat(lfmt, tmp); > > /* > _______________________________________________ > svn-src-head@freebsd.org mailing > list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to > "svn-src-head-unsubscribe@freebsd.org > " > > > > Hi, > > Should this be MIN() ? > > (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9)); > > > -- > Chang-Hsien Tsai > From owner-svn-src-head@freebsd.org Mon Apr 25 14:47:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E83EFB1BDAD; Mon, 25 Apr 2016 14: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 B2616152A; Mon, 25 Apr 2016 14: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 u3PElqvk084910; Mon, 25 Apr 2016 14:47:52 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PElpfe084901; Mon, 25 Apr 2016 14:47:51 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604251447.u3PElpfe084901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Mon, 25 Apr 2016 14:47:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298580 - in head/sys/riscv: include riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 14:47:53 -0000 Author: br Date: Mon Apr 25 14:47:51 2016 New Revision: 298580 URL: https://svnweb.freebsd.org/changeset/base/298580 Log: o Implement shared pagetables and switch from 4 to 3 levels page memory system. RISC-V ISA has only single page table base register for both kernel and user addresses translation. Before this commit we were using an extra (4th) level of pagetables for switching between kernel and user pagetables, but then realized FPGA hardware has 3-level page system hardcoded. It is also become clear that the bitfile synthesized for 4-level system is untested/broken, so we can't use extra level for switching. We are now share level 1 of pagetables between kernel and user VA. This requires to keep track of all the user pmaps created and once we adding L1 page to kernel pmap we have to add it to all the user pmaps. o Change the VM layout as we must have topmost bit to be 1 in the selected page system for kernel addresses and 0 for user addresses. o Implement pmap_kenter_device(). o Create the l3 tables for the early devmap. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/include/pcpu.h head/sys/riscv/include/pmap.h head/sys/riscv/include/vmparam.h head/sys/riscv/riscv/genassym.c head/sys/riscv/riscv/locore.S head/sys/riscv/riscv/machdep.c head/sys/riscv/riscv/pmap.c head/sys/riscv/riscv/swtch.S Modified: head/sys/riscv/include/pcpu.h ============================================================================== --- head/sys/riscv/include/pcpu.h Mon Apr 25 13:30:37 2016 (r298579) +++ head/sys/riscv/include/pcpu.h Mon Apr 25 14:47:51 2016 (r298580) @@ -46,9 +46,8 @@ #define PCPU_MD_FIELDS \ uint32_t pc_pending_ipis; /* IPIs pending to this CPU */ \ - uint64_t pc_sptbr; /* L0 page table base (VA) */ \ uint64_t pc_reg; /* CPU MMIO base (PA) */ \ - char __pad[109] + char __pad[117] #ifdef _KERNEL Modified: head/sys/riscv/include/pmap.h ============================================================================== --- head/sys/riscv/include/pmap.h Mon Apr 25 13:30:37 2016 (r298579) +++ head/sys/riscv/include/pmap.h Mon Apr 25 14:47:51 2016 (r298580) @@ -74,12 +74,18 @@ struct pv_addr { vm_paddr_t pv_pa; }; +/* An entry in the list of all pmaps */ +struct pmap_list_entry { + SLIST_ENTRY(pmap_list_entry) pmap_link; + struct pmap *pmap; +}; struct pmap { struct mtx pm_mtx; struct pmap_statistics pm_stats; /* pmap statictics */ pd_entry_t *pm_l1; TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ + struct pmap_list_entry *p_entry; /* Place in the list of all pmaps */ }; typedef struct pv_entry { Modified: head/sys/riscv/include/vmparam.h ============================================================================== --- head/sys/riscv/include/vmparam.h Mon Apr 25 13:30:37 2016 (r298579) +++ head/sys/riscv/include/vmparam.h Mon Apr 25 14:47:51 2016 (r298580) @@ -153,12 +153,12 @@ #define VM_MAX_ADDRESS (0xffffffffffffffffUL) /* 32 GiB of kernel addresses */ -#define VM_MIN_KERNEL_ADDRESS (0xffffff8000000000UL) -#define VM_MAX_KERNEL_ADDRESS (0xffffff8800000000UL) +#define VM_MIN_KERNEL_ADDRESS (0xffffffc000000000UL) +#define VM_MAX_KERNEL_ADDRESS (0xffffffc800000000UL) /* Direct Map for 128 GiB of PA: 0x0 - 0x1fffffffff */ -#define DMAP_MIN_ADDRESS (0xffffffc000000000UL) -#define DMAP_MAX_ADDRESS (0xffffffdfffffffffUL) +#define DMAP_MIN_ADDRESS (0xffffffd000000000UL) +#define DMAP_MAX_ADDRESS (0xffffffefffffffffUL) #define DMAP_MIN_PHYSADDR (0x0000000000000000UL) #define DMAP_MAX_PHYSADDR (DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) @@ -187,7 +187,7 @@ }) #define VM_MIN_USER_ADDRESS (0x0000000000000000UL) -#define VM_MAX_USER_ADDRESS (0x0000008000000000UL) +#define VM_MAX_USER_ADDRESS (0x0000004000000000UL) #define VM_MINUSER_ADDRESS (VM_MIN_USER_ADDRESS) #define VM_MAXUSER_ADDRESS (VM_MAX_USER_ADDRESS) Modified: head/sys/riscv/riscv/genassym.c ============================================================================== --- head/sys/riscv/riscv/genassym.c Mon Apr 25 13:30:37 2016 (r298579) +++ head/sys/riscv/riscv/genassym.c Mon Apr 25 14:47:51 2016 (r298580) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); ASSYM(KERNBASE, KERNBASE); ASSYM(VM_MAXUSER_ADDRESS, VM_MAXUSER_ADDRESS); +ASSYM(VM_MAX_KERNEL_ADDRESS, VM_MAX_KERNEL_ADDRESS); ASSYM(TDF_ASTPENDING, TDF_ASTPENDING); ASSYM(TDF_NEEDRESCHED, TDF_NEEDRESCHED); @@ -75,7 +76,6 @@ ASSYM(PCB_A, offsetof(struct pcb, pcb_a) ASSYM(SF_UC, offsetof(struct sigframe, sf_uc)); ASSYM(PC_CURPCB, offsetof(struct pcpu, pc_curpcb)); -ASSYM(PC_SPTBR, offsetof(struct pcpu, pc_sptbr)); ASSYM(PC_CURTHREAD, offsetof(struct pcpu, pc_curthread)); ASSYM(TD_PCB, offsetof(struct thread, td_pcb)); Modified: head/sys/riscv/riscv/locore.S ============================================================================== --- head/sys/riscv/riscv/locore.S Mon Apr 25 13:30:37 2016 (r298579) +++ head/sys/riscv/riscv/locore.S Mon Apr 25 14:47:51 2016 (r298580) @@ -141,36 +141,31 @@ _start: /* Page tables */ - /* Level 0 */ - la s1, pagetable_l0 - la s2, pagetable_l1 /* Link to next level PN */ + /* Create an L1 page for early devmap */ + la s1, pagetable_l1 + la s2, pagetable_l2_devmap /* Link to next level PN */ srli s2, s2, PAGE_SHIFT + li a5, (VM_MAX_KERNEL_ADDRESS - L2_SIZE) + srli a5, a5, L1_SHIFT /* >> L1_SHIFT */ + andi a5, a5, 0x1ff /* & 0x1ff */ li t4, (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)) slli t5, s2, PTE_PPN0_S /* (s2 << PTE_PPN0_S) */ or t6, t4, t5 - /* Store single level0 PTE entry to position */ - li a5, 0x1ff + /* Store single level1 PTE entry to position */ li a6, PTE_SIZE mulw a5, a5, a6 add t0, s1, a5 - /* Store it to pagetable_l0 for each cpu */ - li t1, MAXCPU - li t2, PAGE_SIZE -1: - sd t6, 0(t0) - add t0, t0, t2 - addi t1, t1, -1 - bnez t1, 1b + sd t6, (t0) - /* Level 1 */ + /* Add single Level 1 entry for kernel */ la s1, pagetable_l1 la s2, pagetable_l2 /* Link to next level PN */ srli s2, s2, PAGE_SHIFT li a5, KERNBASE - srli a5, a5, 0x1e /* >> 30 */ + srli a5, a5, L1_SHIFT /* >> L1_SHIFT */ andi a5, a5, 0x1ff /* & 0x1ff */ li t4, (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)) slli t5, s2, PTE_PPN0_S /* (s2 << PTE_PPN0_S) */ @@ -198,13 +193,13 @@ _start: bltu t4, t3, 2b /* Set page tables base register */ - la s1, pagetable_l0 + la s1, pagetable_l1 csrw sptbr, s1 /* Page tables END */ /* Enter supervisor mode */ - li s0, ((MSTATUS_VM_SV48 << MSTATUS_VM_SHIFT) | \ + li s0, ((MSTATUS_VM_SV39 << MSTATUS_VM_SHIFT) | \ (MSTATUS_PRV_M << MSTATUS_PRV_SHIFT) | \ (MSTATUS_PRV_S << MSTATUS_PRV1_SHIFT) | \ (MSTATUS_PRV_U << MSTATUS_PRV2_SHIFT)); @@ -290,14 +285,12 @@ szsigcode: .quad esigcode - sigcode .align 12 - .globl pagetable_l0 -pagetable_l0: - .space (PAGE_SIZE * MAXCPU) pagetable_l1: .space PAGE_SIZE pagetable_l2: .space PAGE_SIZE -pagetable_end: +pagetable_l2_devmap: + .space PAGE_SIZE .globl init_pt_va init_pt_va: @@ -336,15 +329,11 @@ ENTRY(mpentry) build_ring /* Set page tables base register */ - la t0, pagetable_l0 - li t1, PAGE_SIZE - mulw t1, t1, a0 - add t0, t0, t1 + la t0, pagetable_l1 csrw sptbr, t0 - /* Page tables END */ /* Configure mstatus */ - li s0, ((MSTATUS_VM_SV48 << MSTATUS_VM_SHIFT) | \ + li s0, ((MSTATUS_VM_SV39 << MSTATUS_VM_SHIFT) | \ (MSTATUS_PRV_M << MSTATUS_PRV_SHIFT) | \ (MSTATUS_PRV_S << MSTATUS_PRV1_SHIFT) | \ (MSTATUS_PRV_U << MSTATUS_PRV2_SHIFT)); Modified: head/sys/riscv/riscv/machdep.c ============================================================================== --- head/sys/riscv/riscv/machdep.c Mon Apr 25 13:30:37 2016 (r298579) +++ head/sys/riscv/riscv/machdep.c Mon Apr 25 14:47:51 2016 (r298580) @@ -93,7 +93,6 @@ __FBSDID("$FreeBSD$"); #endif struct pcpu __pcpu[MAXCPU]; -extern uint64_t pagetable_l0; static struct trapframe proc0_tf; @@ -390,12 +389,6 @@ cpu_est_clockrate(int cpu_id, uint64_t * void cpu_pcpu_init(struct pcpu *pcpu, int cpuid, size_t size) { - uint64_t addr; - - addr = (uint64_t)&pagetable_l0; - addr += (cpuid * PAGE_SIZE); - - pcpu->pc_sptbr = addr; } void Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Mon Apr 25 13:30:37 2016 (r298579) +++ head/sys/riscv/riscv/pmap.c Mon Apr 25 14:47:51 2016 (r298580) @@ -207,6 +207,12 @@ __FBSDID("$FreeBSD$"); #define VM_PAGE_TO_PV_LIST_LOCK(m) \ PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) +/* The list of all the pmaps */ +static SLIST_HEAD(, pmap_list_entry) pmap_list = + SLIST_HEAD_INITIALIZER(pmap_list); + +static MALLOC_DEFINE(M_VMPMAP, "pmap", "PMAP L1"); + struct pmap kernel_pmap_store; vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ @@ -304,7 +310,8 @@ pmap_l2(pmap_t pmap, vm_offset_t va) pd_entry_t *l1; l1 = pmap_l1(pmap, va); - + if (l1 == NULL) + return (NULL); if ((pmap_load(l1) & PTE_VALID) == 0) return (NULL); if ((pmap_load(l1) & PTE_TYPE_M) != (PTE_TYPE_PTR << PTE_TYPE_S)) @@ -335,7 +342,7 @@ pmap_l3(pmap_t pmap, vm_offset_t va) return (NULL); if ((pmap_load(l2) & PTE_VALID) == 0) return (NULL); - if (l2 == NULL || (pmap_load(l2) & PTE_TYPE_M) != (PTE_TYPE_PTR << PTE_TYPE_S)) + if ((pmap_load(l2) & PTE_TYPE_M) != (PTE_TYPE_PTR << PTE_TYPE_S)) return (NULL); return (pmap_l2_to_l3(l2, va)); @@ -405,6 +412,28 @@ pmap_resident_count_dec(pmap_t pmap, int pmap->pm_stats.resident_count -= count; } +static void +pmap_distribute_l1(struct pmap *pmap, vm_pindex_t l1index, + pt_entry_t entry) +{ + struct pmap_list_entry *p_entry; + struct pmap *user_pmap; + pd_entry_t *l1; + + /* Distribute new kernel L1 entry to all the user pmaps */ + if (pmap != kernel_pmap) + return; + + SLIST_FOREACH(p_entry, &pmap_list, pmap_link) { + user_pmap = p_entry->pmap; + l1 = &user_pmap->pm_l1[l1index]; + if (entry) + pmap_load_store(l1, entry); + else + pmap_load_clear(l1); + } +} + static pt_entry_t * pmap_early_page_idx(vm_offset_t l1pt, vm_offset_t va, u_int *l1_slot, u_int *l2_slot) @@ -462,10 +491,9 @@ pmap_bootstrap_dmap(vm_offset_t l1pt, vm KASSERT(l1_slot < Ln_ENTRIES, ("Invalid L1 index")); /* superpages */ - pn = ((pa >> L1_SHIFT) & Ln_ADDR_MASK); + pn = (pa / PAGE_SIZE); entry = (PTE_VALID | (PTE_TYPE_SRWX << PTE_TYPE_S)); - entry |= (pn << PTE_PPN2_S); - + entry |= (pn << PTE_PPN0_S); pmap_load_store(&l1[l1_slot], entry); } @@ -473,6 +501,44 @@ pmap_bootstrap_dmap(vm_offset_t l1pt, vm cpu_tlb_flushID(); } +static vm_offset_t +pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm_offset_t l3_start) +{ + vm_offset_t l2pt, l3pt; + pt_entry_t entry; + pd_entry_t *l2; + vm_paddr_t pa; + u_int l2_slot; + pn_t pn; + + KASSERT((va & L2_OFFSET) == 0, ("Invalid virtual address")); + + l2 = pmap_l2(kernel_pmap, va); + l2 = (pd_entry_t *)((uintptr_t)l2 & ~(PAGE_SIZE - 1)); + l2pt = (vm_offset_t)l2; + l2_slot = pmap_l2_index(va); + l3pt = l3_start; + + for (; va < VM_MAX_KERNEL_ADDRESS; l2_slot++, va += L2_SIZE) { + KASSERT(l2_slot < Ln_ENTRIES, ("Invalid L2 index")); + + pa = pmap_early_vtophys(l1pt, l3pt); + pn = (pa / PAGE_SIZE); + entry = (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)); + entry |= (pn << PTE_PPN0_S); + pmap_load_store(&l2[l2_slot], entry); + l3pt += PAGE_SIZE; + } + + /* Clean the L2 page table */ + memset((void *)l3_start, 0, l3pt - l3_start); + cpu_dcache_wb_range(l3_start, l3pt - l3_start); + + cpu_dcache_wb_range((vm_offset_t)l2, PAGE_SIZE); + + return l3pt; +} + /* * Bootstrap the system enough to run with virtual memory. */ @@ -578,6 +644,10 @@ pmap_bootstrap(vm_offset_t l1pt, vm_padd freemempos = KERNBASE + kernlen; freemempos = roundup2(freemempos, PAGE_SIZE); + /* Create the l3 tables for the early devmap */ + freemempos = pmap_bootstrap_l3(l1pt, + VM_MAX_KERNEL_ADDRESS - L2_SIZE, freemempos); + cpu_tlb_flushID(); #define alloc_pages(var, np) \ @@ -815,10 +885,10 @@ pmap_kextract(vm_offset_t va) void pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm_paddr_t pa) { + pt_entry_t entry; pt_entry_t *l3; vm_offset_t va; - - panic("%s: implement me\n", __func__); + pn_t pn; KASSERT((pa & L3_OFFSET) == 0, ("pmap_kenter_device: Invalid physical address")); @@ -831,11 +901,12 @@ pmap_kenter_device(vm_offset_t sva, vm_s while (size != 0) { l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); - panic("%s: unimplemented", __func__); -#if 0 /* implement me */ - pmap_load_store(l3, (pa & ~L3_OFFSET) | ATTR_DEFAULT | - ATTR_IDX(DEVICE_MEMORY) | L3_PAGE); -#endif + + pn = (pa / PAGE_SIZE); + entry = (PTE_VALID | (PTE_TYPE_SRWX << PTE_TYPE_S)); + entry |= (pn << PTE_PPN0_S); + pmap_load_store(l3, entry); + PTE_SYNC(l3); va += PAGE_SIZE; @@ -1037,6 +1108,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t pd_entry_t *l1; l1 = pmap_l1(pmap, va); pmap_load_clear(l1); + pmap_distribute_l1(pmap, pmap_l1_index(va), 0); PTE_SYNC(l1); } else { /* PTE page */ @@ -1105,6 +1177,7 @@ pmap_pinit0(pmap_t pmap) int pmap_pinit(pmap_t pmap) { + struct pmap_list_entry *p_entry; vm_paddr_t l1phys; vm_page_t l1pt; @@ -1123,6 +1196,16 @@ pmap_pinit(pmap_t pmap) bzero(&pmap->pm_stats, sizeof(pmap->pm_stats)); + /* Install kernel pagetables */ + memcpy(pmap->pm_l1, kernel_pmap->pm_l1, PAGE_SIZE); + + p_entry = malloc(sizeof(struct pmap_list_entry), M_VMPMAP, M_WAITOK); + p_entry->pmap = pmap; + pmap->p_entry = p_entry; + + /* Add to the list of all pmaps */ + SLIST_INSERT_HEAD(&pmap_list, p_entry, pmap_link); + return (1); } @@ -1187,6 +1270,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t entry = (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)); entry |= (pn << PTE_PPN0_S); pmap_load_store(l1, entry); + pmap_distribute_l1(pmap, l1index, entry); PTE_SYNC(l1); @@ -1289,6 +1373,13 @@ pmap_release(pmap_t pmap) m->wire_count--; atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); + + /* Remove kernel pagetables */ + bzero(pmap->pm_l1, PAGE_SIZE); + + /* Remove pmap from the all pmaps list */ + SLIST_REMOVE(&pmap_list, pmap->p_entry, + pmap_list_entry, pmap_link); } #if 0 @@ -1347,6 +1438,8 @@ pmap_growkernel(vm_offset_t addr) entry = (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)); entry |= (pn << PTE_PPN0_S); pmap_load_store(l1, entry); + pmap_distribute_l1(kernel_pmap, + pmap_l1_index(kernel_vm_end), entry); PTE_SYNC(l1); continue; /* try again */ @@ -2003,6 +2096,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, entry = (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)); entry |= (l2_pn << PTE_PPN0_S); pmap_load_store(l1, entry); + pmap_distribute_l1(pmap, pmap_l1_index(va), entry); PTE_SYNC(l1); l2 = pmap_l1_to_l2(l1, va); @@ -3085,18 +3179,13 @@ pmap_mincore(pmap_t pmap, vm_offset_t ad void pmap_activate(struct thread *td) { - pt_entry_t entry; - pn_t pn; pmap_t pmap; critical_enter(); pmap = vmspace_pmap(td->td_proc->p_vmspace); td->td_pcb->pcb_l1addr = vtophys(pmap->pm_l1); - pn = (td->td_pcb->pcb_l1addr / PAGE_SIZE); - entry = (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)); - entry |= (pn << PTE_PPN0_S); - pmap_load_store((uint64_t *)PCPU_GET(sptbr), entry); + __asm __volatile("csrw sptbr, %0" :: "r"(td->td_pcb->pcb_l1addr)); pmap_invalidate_all(pmap); critical_exit(); Modified: head/sys/riscv/riscv/swtch.S ============================================================================== --- head/sys/riscv/riscv/swtch.S Mon Apr 25 13:30:37 2016 (r298579) +++ head/sys/riscv/riscv/swtch.S Mon Apr 25 14:47:51 2016 (r298580) @@ -55,14 +55,8 @@ ENTRY(cpu_throw) sfence.vm /* Switch to the new pmap */ - ld t1, PCB_L1ADDR(x13) /* Link to next level PN */ - srli t1, t1, PAGE_SHIFT /* PN no */ - li t2, (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)) - slli t3, t1, PTE_PPN0_S /* (t1 << PTE_PPN0_S) */ - or t4, t2, t3 - /* Store single level0 PTE entry to position */ - ld t0, PC_SPTBR(gp) - sd t4, 0(t0) + ld t0, PCB_L1ADDR(x13) + csrw sptbr, t0 /* TODO: Invalidate the TLB */ @@ -140,14 +134,8 @@ ENTRY(cpu_switch) sfence.vm /* Switch to the new pmap */ - ld t1, PCB_L1ADDR(x13) /* Link to next level PN */ - srli t1, t1, PAGE_SHIFT /* PN no */ - li t2, (PTE_VALID | (PTE_TYPE_PTR << PTE_TYPE_S)) - slli t3, t1, PTE_PPN0_S /* (t1 << PTE_PPN0_S) */ - or t4, t2, t3 - /* Store single level0 PTE entry to position */ - ld t0, PC_SPTBR(gp) - sd t4, 0(t0) + ld t0, PCB_L1ADDR(x13) + csrw sptbr, t0 /* TODO: Invalidate the TLB */ From owner-svn-src-head@freebsd.org Mon Apr 25 15:46:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E26FB1CC54; Mon, 25 Apr 2016 15:46:44 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B41C9145E; Mon, 25 Apr 2016 15:46:43 +0000 (UTC) (envelope-from fanf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3PFkg4v003572; Mon, 25 Apr 2016 15:46:42 GMT (envelope-from fanf@FreeBSD.org) Received: (from fanf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PFkgXN003571; Mon, 25 Apr 2016 15:46:42 GMT (envelope-from fanf@FreeBSD.org) Message-Id: <201604251546.u3PFkgXN003571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fanf set sender to fanf@FreeBSD.org using -f From: Tony Finch Date: Mon, 25 Apr 2016 15:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298581 - head/usr.bin/whois X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 15:46:44 -0000 Author: fanf Date: Mon Apr 25 15:46:42 2016 New Revision: 298581 URL: https://svnweb.freebsd.org/changeset/base/298581 Log: Example RIPE whois query with options and spaces. Since it is used in the example, mention the -- option in the synopsis even though it is a universal standard, and tweak to fit it on one line. Modified: head/usr.bin/whois/whois.1 Modified: head/usr.bin/whois/whois.1 ============================================================================== --- head/usr.bin/whois/whois.1 Mon Apr 25 14:47:51 2016 (r298580) +++ head/usr.bin/whois/whois.1 Mon Apr 25 15:46:42 2016 (r298581) @@ -28,7 +28,7 @@ .\" From: @(#)whois.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd January 23, 2016 +.Dd April 25, 2016 .Dt WHOIS 1 .Os .Sh NAME @@ -37,8 +37,9 @@ .Sh SYNOPSIS .Nm .Op Fl aAbfgiIklmPQrRS -.Op Fl c Ar country-code | Fl h Ar host +.Op Fl c Ar TLD | Fl h Ar host .Op Fl p Ar port +.Op Fl - .Ar name ... .Sh DESCRIPTION The @@ -90,11 +91,12 @@ Get query syntax documentation using Use the Network Abuse Clearinghouse database. It contains addresses to which network abuse should be reported, indexed by domain name. -.It Fl c Ar country-code +.It Fl c Ar TLD This is the equivalent of using the .Fl h option with an argument of -.Qq Ar country-code Ns Li .whois-servers.net . +.Qq Ar TLD Ns Li .whois-servers.net . +This can be helpful for locating country-class TLD whois servers. .It Fl f Use the African Network Information Centre .Pq Tn AfriNIC @@ -233,7 +235,7 @@ option as shown in the following example .Ar CONTACT-ID is substituted with the actual contact identifier. .Pp -.Dl "whois -c RU CONTACT-ID" +.Dl Ic whois -c RU CONTACT-ID .Pp (Note: This example is specific to the .Tn TLD @@ -251,7 +253,25 @@ on port .Dq Li rwhois (written numerically as 4321). .Pp -.Dl "whois -h whois.example.com -p rwhois query-data" +.Dl Ic whois -h whois.example.com -p rwhois query-data +.Pp +Some whois servers support complex queries +with dash-letter options. +You can use the +.Fl - +option to separate +.Nm +command options from whois server query options. +A query containing spaces must be quoted as one +argument to the +.Nm +command. +The following example asks the RIPE whois server +to return a brief description of its +.Dq Li domain +object type: +.Pp +.Dl Ic whois -r -- '-t domain' .Sh SEE ALSO .Rs .%A Ken Harrenstien From owner-svn-src-head@freebsd.org Mon Apr 25 15:50:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FCE4B1CDDC; Mon, 25 Apr 2016 15:50:56 +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 AB80E18AB; Mon, 25 Apr 2016 15:50:55 +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 u3PFoiq2012984 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 25 Apr 2016 18:50:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u3PFoiq2012984 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u3PFoiYl012981; Mon, 25 Apr 2016 18:50:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 25 Apr 2016 18:50:44 +0300 From: Konstantin Belousov To: Ruslan Bukin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298580 - in head/sys/riscv: include riscv Message-ID: <20160425155044.GO2422@kib.kiev.ua> References: <201604251447.u3PElpfe084901@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201604251447.u3PElpfe084901@repo.freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 15:50:56 -0000 On Mon, Apr 25, 2016 at 02:47:51PM +0000, Ruslan Bukin wrote: > Author: br > Date: Mon Apr 25 14:47:51 2016 > New Revision: 298580 > URL: https://svnweb.freebsd.org/changeset/base/298580 > > Log: > o Implement shared pagetables and switch from 4 to 3 levels page > memory system. > +/* An entry in the list of all pmaps */ > +struct pmap_list_entry { > + SLIST_ENTRY(pmap_list_entry) pmap_link; > + struct pmap *pmap; > +}; This is weird. Why do you need separate structure to track the all pmaps list, instead of embedding the list link into pmap itself ? In particular, the pmap_list_entry.pmap pointing to the pmap looks strange. And why do you use single-linked list for the container where you need to remove elements ? The cost is the iteration over the whole container on removal, vs. additional pointer in each pmap. From owner-svn-src-head@freebsd.org Mon Apr 25 16:13:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69D69B1C39A; Mon, 25 Apr 2016 16:13:06 +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 277CC19AB; Mon, 25 Apr 2016 16:13:06 +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 u3PGD5Fo012791; Mon, 25 Apr 2016 16:13:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PGD4RM012786; Mon, 25 Apr 2016 16:13:04 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604251613.u3PGD4RM012786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 25 Apr 2016 16:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298582 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 16:13:06 -0000 Author: adrian Date: Mon Apr 25 16:13:04 2016 New Revision: 298582 URL: https://svnweb.freebsd.org/changeset/base/298582 Log: [iwn] fix firmware command use in iwm_auth(). The iwm firmware has separate commands for add, modify and delete for various things (mac, phy context, etc.) The openbsd driver has a habit of just completely resetting the NIC each time, which is technically mostly okay (as long as the reset doesn't actually fail!) but it means a lot of the code is doing ADD when it should do MODIFY. The firmware responds in kind - it just asserts. This fixes auth attempts that occur after the NIC has been already configured. (I'm sure there are more instances of this!) Tested: iwm0: mem 0xf1400000-0xf1401fff irq 17 at device 0.0 on pci2 iwm0: revision: 0x140, firmware 25.228 (API ver. 9) .. STA mode. Submitted by: Masachika ISHIZUKA Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_binding.c head/sys/dev/iwm/if_iwm_binding.h head/sys/dev/iwm/if_iwm_time_event.c head/sys/dev/iwm/if_iwm_time_event.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Apr 25 15:46:42 2016 (r298581) +++ head/sys/dev/iwm/if_iwm.c Mon Apr 25 16:13:04 2016 (r298582) @@ -3159,7 +3159,6 @@ iwm_auth(struct ieee80211vap *vap, struc struct iwm_node *in; struct iwm_vap *iv = IWM_VAP(vap); uint32_t duration; - uint32_t min_duration; int error; /* @@ -3201,7 +3200,25 @@ iwm_auth(struct ieee80211vap *vap, struc if (iv->is_uploaded) { if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { device_printf(sc->sc_dev, - "%s: failed to add MAC\n", __func__); + "%s: failed to update MAC\n", __func__); + goto out; + } + if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], + in->in_ni.ni_chan, 1, 1)) != 0) { + device_printf(sc->sc_dev, + "%s: failed update phy ctxt\n", __func__); + goto out; + } + in->in_phyctxt = &sc->sc_phyctxt[0]; + + if ((error = iwm_mvm_binding_update(sc, in)) != 0) { + device_printf(sc->sc_dev, + "%s: binding update cmd\n", __func__); + goto out; + } + if ((error = iwm_mvm_update_sta(sc, in)) != 0) { + device_printf(sc->sc_dev, + "%s: failed to update sta\n", __func__); goto out; } } else { @@ -3210,61 +3227,36 @@ iwm_auth(struct ieee80211vap *vap, struc "%s: failed to add MAC\n", __func__); goto out; } - } - - if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], - in->in_ni.ni_chan, 1, 1)) != 0) { - device_printf(sc->sc_dev, - "%s: failed add phy ctxt\n", __func__); - goto out; - } - in->in_phyctxt = &sc->sc_phyctxt[0]; - - if ((error = iwm_mvm_binding_add_vif(sc, in)) != 0) { - device_printf(sc->sc_dev, - "%s: binding cmd\n", __func__); - goto out; - } - - if ((error = iwm_mvm_add_sta(sc, in)) != 0) { - device_printf(sc->sc_dev, - "%s: failed to add MAC\n", __func__); - goto out; - } - - /* a bit superfluous? */ - while (sc->sc_auth_prot) - msleep(&sc->sc_auth_prot, &sc->sc_mtx, 0, "iwmauth", 0); - sc->sc_auth_prot = 1; - - duration = min(IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS, - 200 + in->in_ni.ni_intval); - min_duration = min(IWM_MVM_TE_SESSION_PROTECTION_MIN_TIME_MS, - 100 + in->in_ni.ni_intval); - iwm_mvm_protect_session(sc, in, duration, min_duration, 500); - - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "%s: waiting for auth_prot\n", __func__); - while (sc->sc_auth_prot != 2) { - /* - * well, meh, but if the kernel is sleeping for half a - * second, we have bigger problems - */ - if (sc->sc_auth_prot == 0) { + if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], + in->in_ni.ni_chan, 1, 1)) != 0) { device_printf(sc->sc_dev, - "%s: missed auth window!\n", __func__); + "%s: failed add phy ctxt!\n", __func__); error = ETIMEDOUT; goto out; - } else if (sc->sc_auth_prot == -1) { + } + in->in_phyctxt = &sc->sc_phyctxt[0]; + + if ((error = iwm_mvm_binding_add_vif(sc, in)) != 0) { + device_printf(sc->sc_dev, + "%s: binding add cmd\n", __func__); + goto out; + } + if ((error = iwm_mvm_add_sta(sc, in)) != 0) { device_printf(sc->sc_dev, - "%s: no time event, denied!\n", __func__); - sc->sc_auth_prot = 0; - error = EAUTH; + "%s: failed to add sta\n", __func__); goto out; } - msleep(&sc->sc_auth_prot, &sc->sc_mtx, 0, "iwmau2", 0); } - IWM_DPRINTF(sc, IWM_DEBUG_RESET, "<-%s\n", __func__); + + /* + * Prevent the FW from wandering off channel during association + * by "protecting" the session with a time event. + */ + /* XXX duration is in units of TU, not MS */ + duration = IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS; + iwm_mvm_protect_session(sc, in, duration, 500 /* XXX magic number */); + DELAY(100); + error = 0; out: ieee80211_free_node(ni); Modified: head/sys/dev/iwm/if_iwm_binding.c ============================================================================== --- head/sys/dev/iwm/if_iwm_binding.c Mon Apr 25 15:46:42 2016 (r298581) +++ head/sys/dev/iwm/if_iwm_binding.c Mon Apr 25 16:13:04 2016 (r298582) @@ -201,13 +201,13 @@ iwm_mvm_binding_cmd(struct iwm_softc *sc } int -iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in, int add) +iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in) { - return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_ADD); + return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_MODIFY); } int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in) { - return iwm_mvm_binding_update(sc, in, IWM_FW_CTXT_ACTION_ADD); + return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_ADD); } Modified: head/sys/dev/iwm/if_iwm_binding.h ============================================================================== --- head/sys/dev/iwm/if_iwm_binding.h Mon Apr 25 15:46:42 2016 (r298581) +++ head/sys/dev/iwm/if_iwm_binding.h Mon Apr 25 16:13:04 2016 (r298582) @@ -107,8 +107,7 @@ extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_node *in, uint32_t action); -extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in, - int add); +extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in); extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in); #endif /* __IF_IWM_BINDING_H__ */ Modified: head/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.c Mon Apr 25 15:46:42 2016 (r298581) +++ head/sys/dev/iwm/if_iwm_time_event.c Mon Apr 25 16:13:04 2016 (r298582) @@ -244,7 +244,7 @@ iwm_mvm_time_event_send_add(struct iwm_s void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, - uint32_t duration, uint32_t min_duration, uint32_t max_delay) + uint32_t duration, uint32_t max_delay) { struct iwm_time_event_cmd_v2 time_cmd; Modified: head/sys/dev/iwm/if_iwm_time_event.h ============================================================================== --- head/sys/dev/iwm/if_iwm_time_event.h Mon Apr 25 15:46:42 2016 (r298581) +++ head/sys/dev/iwm/if_iwm_time_event.h Mon Apr 25 16:13:04 2016 (r298582) @@ -108,6 +108,6 @@ #define __IF_IWM_TIME_EVENT_H__ extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, - uint32_t duration, uint32_t min_duration, uint32_t max_delay); + uint32_t duration, uint32_t max_delay); #endif /* __IF_IWM_TIME_EVENT_H__ */ From owner-svn-src-head@freebsd.org Mon Apr 25 16:53:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04C80B1C080; Mon, 25 Apr 2016 16:53:15 +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 CB3651A0D; Mon, 25 Apr 2016 16:53:14 +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 u3PGrEOL027750; Mon, 25 Apr 2016 16:53:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PGrEUT027749; Mon, 25 Apr 2016 16:53:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604251653.u3PGrEUT027749@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 25 Apr 2016 16:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298583 - head/sys/dev/bhnd/cores/chipc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 16:53:15 -0000 Author: adrian Date: Mon Apr 25 16:53:13 2016 New Revision: 298583 URL: https://svnweb.freebsd.org/changeset/base/298583 Log: [bhnd] Fix ChipCommon probing. ChipCommon probing uses mapping table "chipc_devices". It calls bhnd_device_lookup, which iterate over mapping table with end condition: entry->desc != NULL So if mapping table contains row with description equals to NULL, it will stop processing of mapping. I.e. description is mandatory field and should be not NULL. This patch corrects mapping table for ChipCommon. Submitted by: Michael Zhilin Differential Revision: https://reviews.freebsd.org/D6088 Modified: head/sys/dev/bhnd/cores/chipc/chipc.c Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Mon Apr 25 16:13:04 2016 (r298582) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Mon Apr 25 16:53:13 2016 (r298583) @@ -66,7 +66,7 @@ static struct bhnd_device_quirk chipc_qu /* Supported device identifiers */ static const struct bhnd_device chipc_devices[] = { - BHND_DEVICE(CC, NULL, chipc_quirks), + BHND_DEVICE(CC, "CC", chipc_quirks), BHND_DEVICE_END }; From owner-svn-src-head@freebsd.org Mon Apr 25 17:01:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92E30B1C279; Mon, 25 Apr 2016 17:01:14 +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 644201E15; Mon, 25 Apr 2016 17:01:14 +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 u3PH1DSq028110; Mon, 25 Apr 2016 17:01:13 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PH1DG4028109; Mon, 25 Apr 2016 17:01:13 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604251701.u3PH1DG4028109@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Apr 2016 17:01:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298584 - head/usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 17:01:14 -0000 Author: jamie Date: Mon Apr 25 17:01:13 2016 New Revision: 298584 URL: https://svnweb.freebsd.org/changeset/base/298584 Log: Note the existence of module-specific jail paramters, starting with the linux.* parameters when linux emulation is loaded. MFC after: 5 days Modified: head/usr.sbin/jail/jail.8 Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Mon Apr 25 16:53:13 2016 (r298583) +++ head/usr.sbin/jail/jail.8 Mon Apr 25 17:01:13 2016 (r298584) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 20, 2015 +.Dd April 25, 2016 .Dt JAIL 8 .Os .Sh NAME @@ -610,6 +610,32 @@ have not had jail functionality added to .El .El .Pp +Kernel modules may add their own parameters, which only exist when the +module is loaded. +These are typically headed under a parameter named after the module, +with values of +.Dq inherit +to give the jail full use of the module, +.Dq new +to encapsulate the jail in some module-specific way, +and +.Dq disable +to make the module unavailable to the jail. +There also may be other parameters to define jail behavior within the module. +Module-specific parameters include: +.Bl -tag -width indent +.It Va linux +Determine how a jail's Linux emulation environment appears. +A value of +.Dq inherit +will keep the same environment, and +.Dq new +will give the jail it's own environment (still originally inherited when +the jail is created). +.It Va linux.osname , linux.osrelease , linux.oss_version +The Linux OS name, OS release, and OSS version associated with this jail. +.El +.Pp There are pseudo-parameters that are not passed to the kernel, but are used by .Nm From owner-svn-src-head@freebsd.org Mon Apr 25 17:06:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDDD1B1C48B; Mon, 25 Apr 2016 17:06:51 +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 B6E8E129B; Mon, 25 Apr 2016 17:06:51 +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 u3PH6pjJ031021; Mon, 25 Apr 2016 17:06:51 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PH6okj031018; Mon, 25 Apr 2016 17:06:50 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604251706.u3PH6okj031018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Apr 2016 17:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298585 - in head: sys/kern usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 17:06:52 -0000 Author: jamie Date: Mon Apr 25 17:06:50 2016 New Revision: 298585 URL: https://svnweb.freebsd.org/changeset/base/298585 Log: Encapsulate SYSV IPC objects in jails. Define per-module parameters sysvmsg, sysvsem, and sysvshm, with the following bahavior: inherit: allow full access to the IPC primitives. This is the same as the current setup with allow.sysvipc is on. Jails and the base system can see (and moduly) each other's objects, which is generally considered a bad thing (though may be useful in some circumstances). disable: all no access, same as the current setup with allow.sysvipc off. new: A jail may see use the IPC objects that it has created. It also gets its own IPC key namespace, so different jails may have their own objects using the same key value. The parent jail (or base system) can see the jail's IPC objects, but not its keys. PR: 48471 Submitted by: based on work by kikuchan98@gmail.com MFC after: 5 days Modified: head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/usr.sbin/jail/jail.8 Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Mon Apr 25 17:01:13 2016 (r298584) +++ head/sys/kern/sysv_msg.c Mon Apr 25 17:06:50 2016 (r298585) @@ -62,8 +62,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +#include +#include #include #include #include @@ -80,6 +83,14 @@ static MALLOC_DEFINE(M_MSG, "msg", "SVID static int msginit(void); static int msgunload(void); static int sysvmsg_modload(struct module *, int, void *); +static void msq_remove(struct msqid_kernel *); +static struct prison *msg_find_prison(struct ucred *); +static int msq_prison_cansee(struct prison *, struct msqid_kernel *); +static int msg_prison_check(void *, void *); +static int msg_prison_set(void *, void *); +static int msg_prison_get(void *, void *); +static int msg_prison_remove(void *, void *); +static void msg_prison_cleanup(struct prison *); #ifdef MSG_DEBUG @@ -155,6 +166,7 @@ static struct msgmap *msgmaps; /* MSGSEG static struct msg *msghdrs; /* MSGTQL msg headers */ static struct msqid_kernel *msqids; /* MSGMNI msqid_kernel struct's */ static struct mtx msq_mtx; /* global mutex for message queues. */ +static unsigned msg_prison_slot;/* prison OSD slot */ static struct syscall_helper_data msg_syscalls[] = { SYSCALL_INIT_HELPER(msgctl), @@ -194,7 +206,15 @@ static struct syscall_helper_data msg32_ static int msginit() { + struct prison *pr; + void *rsv; int i, error; + osd_method_t methods[PR_MAXMETHOD] = { + [PR_METHOD_CHECK] = msg_prison_check, + [PR_METHOD_SET] = msg_prison_set, + [PR_METHOD_GET] = msg_prison_get, + [PR_METHOD_REMOVE] = msg_prison_remove, + }; msginfo.msgmax = msginfo.msgseg * msginfo.msgssz; msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK); @@ -252,6 +272,29 @@ msginit() } mtx_init(&msq_mtx, "msq", NULL, MTX_DEF); + /* Set current prisons according to their allow.sysvipc. */ + msg_prison_slot = osd_jail_register(NULL, methods); + rsv = osd_reserve(msg_prison_slot); + prison_lock(&prison0); + (void)osd_jail_set_reserved(&prison0, msg_prison_slot, rsv, &prison0); + prison_unlock(&prison0); + rsv = NULL; + sx_slock(&allprison_lock); + TAILQ_FOREACH(pr, &allprison, pr_list) { + if (rsv == NULL) + rsv = osd_reserve(msg_prison_slot); + prison_lock(pr); + if ((pr->pr_allow & PR_ALLOW_SYSVIPC) && pr->pr_ref > 0) { + (void)osd_jail_set_reserved(pr, msg_prison_slot, rsv, + &prison0); + rsv = NULL; + } + prison_unlock(pr); + } + if (rsv != NULL) + osd_free_reserved(rsv); + sx_sunlock(&allprison_lock); + error = syscall_helper_register(msg_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); @@ -292,6 +335,8 @@ msgunload() if (msqid != msginfo.msgmni) return (EBUSY); + if (msg_prison_slot != 0) + osd_jail_deregister(msg_prison_slot); #ifdef MAC for (i = 0; i < msginfo.msgtql; i++) mac_sysvmsg_destroy(&msghdrs[i]); @@ -366,6 +411,67 @@ msg_freehdr(msghdr) #endif } +static void +msq_remove(struct msqid_kernel *msqkptr) +{ + struct msg *msghdr; + + racct_sub_cred(msqkptr->cred, RACCT_NMSGQ, 1); + racct_sub_cred(msqkptr->cred, RACCT_MSGQQUEUED, msqkptr->u.msg_qnum); + racct_sub_cred(msqkptr->cred, RACCT_MSGQSIZE, msqkptr->u.msg_cbytes); + crfree(msqkptr->cred); + msqkptr->cred = NULL; + + /* Free the message headers */ + msghdr = msqkptr->u.msg_first; + while (msghdr != NULL) { + struct msg *msghdr_tmp; + + /* Free the segments of each message */ + msqkptr->u.msg_cbytes -= msghdr->msg_ts; + msqkptr->u.msg_qnum--; + msghdr_tmp = msghdr; + msghdr = msghdr->msg_next; + msg_freehdr(msghdr_tmp); + } + + if (msqkptr->u.msg_cbytes != 0) + panic("msg_cbytes is screwed up"); + if (msqkptr->u.msg_qnum != 0) + panic("msg_qnum is screwed up"); + + msqkptr->u.msg_qbytes = 0; /* Mark it as free */ + +#ifdef MAC + mac_sysvmsq_cleanup(msqkptr); +#endif + + wakeup(msqkptr); +} + +static struct prison * +msg_find_prison(struct ucred *cred) +{ + struct prison *pr, *rpr; + + pr = cred->cr_prison; + prison_lock(pr); + rpr = osd_jail_get(pr, msg_prison_slot); + prison_unlock(pr); + return rpr; +} + +static int +msq_prison_cansee(struct prison *rpr, struct msqid_kernel *msqkptr) +{ + + if (msqkptr->cred == NULL || + !(rpr == msqkptr->cred->cr_prison || + prison_ischild(rpr, msqkptr->cred->cr_prison))) + return (EINVAL); + return (0); +} + #ifndef _SYS_SYSPROTO_H_ struct msgctl_args { int msqid; @@ -402,8 +508,10 @@ kern_msgctl(td, msqid, cmd, msqbuf) { int rval, error, msqix; register struct msqid_kernel *msqkptr; + struct prison *rpr; - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) + rpr = msg_find_prison(td->td_ucred); + if (rpr == NULL) return (ENOSYS); msqix = IPCID_TO_IX(msqid); @@ -427,6 +535,13 @@ kern_msgctl(td, msqid, cmd, msqbuf) error = EINVAL; goto done2; } + + error = msq_prison_cansee(rpr, msqkptr); + if (error != 0) { + DPRINTF(("requester can't see prison\n")); + goto done2; + } + #ifdef MAC error = mac_sysvmsq_check_msqctl(td->td_ucred, msqkptr, cmd); if (error != 0) @@ -440,7 +555,9 @@ kern_msgctl(td, msqid, cmd, msqbuf) case IPC_RMID: { +#ifdef MAC struct msg *msghdr; +#endif if ((error = ipcperm(td, &msqkptr->u.msg_perm, IPC_M))) goto done2; @@ -462,37 +579,7 @@ kern_msgctl(td, msqid, cmd, msqbuf) } #endif - racct_sub_cred(msqkptr->cred, RACCT_NMSGQ, 1); - racct_sub_cred(msqkptr->cred, RACCT_MSGQQUEUED, msqkptr->u.msg_qnum); - racct_sub_cred(msqkptr->cred, RACCT_MSGQSIZE, msqkptr->u.msg_cbytes); - crfree(msqkptr->cred); - msqkptr->cred = NULL; - - /* Free the message headers */ - msghdr = msqkptr->u.msg_first; - while (msghdr != NULL) { - struct msg *msghdr_tmp; - - /* Free the segments of each message */ - msqkptr->u.msg_cbytes -= msghdr->msg_ts; - msqkptr->u.msg_qnum--; - msghdr_tmp = msghdr; - msghdr = msghdr->msg_next; - msg_freehdr(msghdr_tmp); - } - - if (msqkptr->u.msg_cbytes != 0) - panic("msg_cbytes is screwed up"); - if (msqkptr->u.msg_qnum != 0) - panic("msg_qnum is screwed up"); - - msqkptr->u.msg_qbytes = 0; /* Mark it as free */ - -#ifdef MAC - mac_sysvmsq_cleanup(msqkptr); -#endif - - wakeup(msqkptr); + msq_remove(msqkptr); } break; @@ -529,6 +616,8 @@ kern_msgctl(td, msqid, cmd, msqbuf) goto done2; } *msqbuf = msqkptr->u; + if (td->td_ucred->cr_prison != msqkptr->cred->cr_prison) + msqbuf->msg_perm.key = IPC_PRIVATE; break; default: @@ -564,7 +653,7 @@ sys_msgget(td, uap) DPRINTF(("msgget(0x%x, 0%o)\n", key, msgflg)); - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) + if (msg_find_prison(cred) == NULL) return (ENOSYS); mtx_lock(&msq_mtx); @@ -572,6 +661,8 @@ sys_msgget(td, uap) for (msqid = 0; msqid < msginfo.msgmni; msqid++) { msqkptr = &msqids[msqid]; if (msqkptr->u.msg_qbytes != 0 && + msqkptr->cred != NULL && + msqkptr->cred->cr_prison == cred->cr_prison && msqkptr->u.msg_perm.key == key) break; } @@ -684,12 +775,14 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgf int msqix, segs_needed, error = 0; register struct msqid_kernel *msqkptr; register struct msg *msghdr; + struct prison *rpr; short next; #ifdef RACCT size_t saved_msgsz; #endif - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) + rpr = msg_find_prison(td->td_ucred); + if (rpr == NULL) return (ENOSYS); mtx_lock(&msq_mtx); @@ -714,6 +807,11 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgf goto done2; } + if ((error = msq_prison_cansee(rpr, msqkptr))) { + DPRINTF(("requester can't see prison\n")); + goto done2; + } + if ((error = ipcperm(td, &msqkptr->u.msg_perm, IPC_W))) { DPRINTF(("requester doesn't have write access\n")); goto done2; @@ -1052,10 +1150,12 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgt size_t len; register struct msqid_kernel *msqkptr; register struct msg *msghdr; + struct prison *rpr; int msqix, error = 0; short next; - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) + rpr = msg_find_prison(td->td_ucred); + if (rpr == NULL) return (ENOSYS); msqix = IPCID_TO_IX(msqid); @@ -1079,6 +1179,11 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgt goto done2; } + if ((error = msq_prison_cansee(rpr, msqkptr))) { + DPRINTF(("requester can't see prison\n")); + goto done2; + } + if ((error = ipcperm(td, &msqkptr->u.msg_perm, IPC_R))) { DPRINTF(("requester doesn't have read access\n")); goto done2; @@ -1318,9 +1423,39 @@ sys_msgrcv(td, uap) static int sysctl_msqids(SYSCTL_HANDLER_ARGS) { + struct sbuf sb; + struct msqid_kernel tmp, empty; + struct msqid_kernel *msqkptr; + struct prison *rpr; + int error, i; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + goto done; + rpr = msg_find_prison(req->td->td_ucred); + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct msqid_kernel) * + msginfo.msgmni, req); + + bzero(&empty, sizeof(empty)); + for (i = 0; i < msginfo.msgmni; i++) { + msqkptr = &msqids[i]; + if (msqkptr->u.msg_qbytes == 0 || rpr == NULL || + msq_prison_cansee(rpr, msqkptr) != 0) { + msqkptr = ∅ + } else if (req->td->td_ucred->cr_prison != + msqkptr->cred->cr_prison) { + bcopy(msqkptr, &tmp, sizeof(tmp)); + msqkptr = &tmp; + msqkptr->u.msg_perm.key = IPC_PRIVATE; + } - return (SYSCTL_OUT(req, msqids, - sizeof(struct msqid_kernel) * msginfo.msgmni)); + sbuf_bcat(&sb, msqkptr, sizeof(*msqkptr)); + } + error = sbuf_finish(&sb); + sbuf_delete(&sb); + +done: + return (error); } SYSCTL_INT(_kern_ipc, OID_AUTO, msgmax, CTLFLAG_RD, &msginfo.msgmax, 0, @@ -1338,6 +1473,181 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLTYPE_OPAQUE | CTLFLAG_RD, NULL, 0, sysctl_msqids, "", "Message queue IDs"); +static int +msg_prison_check(void *obj, void *data) +{ + struct prison *pr = obj; + struct prison *prpr; + struct vfsoptlist *opts = data; + int error, jsys; + + /* + * sysvmsg is a jailsys integer. + * It must be "disable" if the parent jail is disabled. + */ + error = vfs_copyopt(opts, "sysvmsg", &jsys, sizeof(jsys)); + if (error != ENOENT) { + if (error != 0) + return (error); + switch (jsys) { + case JAIL_SYS_DISABLE: + break; + case JAIL_SYS_NEW: + case JAIL_SYS_INHERIT: + prison_lock(pr->pr_parent); + prpr = osd_jail_get(pr->pr_parent, msg_prison_slot); + prison_unlock(pr->pr_parent); + if (prpr == NULL) + return (EPERM); + break; + default: + return (EINVAL); + } + } + + return (0); +} + +static int +msg_prison_set(void *obj, void *data) +{ + struct prison *pr = obj; + struct prison *tpr, *orpr, *nrpr, *trpr; + struct vfsoptlist *opts = data; + void *rsv; + int jsys, descend; + + /* + * sysvmsg controls which jail is the root of the associated msgs (this + * jail or same as the parent), or if the feature is available at all. + */ + if (vfs_copyopt(opts, "sysvmsg", &jsys, sizeof(jsys)) == ENOENT) + jsys = vfs_flagopt(opts, "allow.sysvipc", NULL, 0) + ? JAIL_SYS_INHERIT + : vfs_flagopt(opts, "allow.nosysvipc", NULL, 0) + ? JAIL_SYS_DISABLE + : -1; + if (jsys == JAIL_SYS_DISABLE) { + prison_lock(pr); + orpr = osd_jail_get(pr, msg_prison_slot); + if (orpr != NULL) + osd_jail_del(pr, msg_prison_slot); + prison_unlock(pr); + if (orpr != NULL) { + if (orpr == pr) + msg_prison_cleanup(pr); + /* Disable all child jails as well. */ + FOREACH_PRISON_DESCENDANT(pr, tpr, descend) { + prison_lock(tpr); + trpr = osd_jail_get(tpr, msg_prison_slot); + if (trpr != NULL) { + osd_jail_del(tpr, msg_prison_slot); + prison_unlock(tpr); + if (trpr == tpr) + msg_prison_cleanup(tpr); + } else { + prison_unlock(tpr); + descend = 0; + } + } + } + } else if (jsys != -1) { + if (jsys == JAIL_SYS_NEW) + nrpr = pr; + else { + prison_lock(pr->pr_parent); + nrpr = osd_jail_get(pr->pr_parent, msg_prison_slot); + prison_unlock(pr->pr_parent); + } + rsv = osd_reserve(msg_prison_slot); + prison_lock(pr); + orpr = osd_jail_get(pr, msg_prison_slot); + if (orpr != nrpr) + (void)osd_jail_set_reserved(pr, msg_prison_slot, rsv, + nrpr); + else + osd_free_reserved(rsv); + prison_unlock(pr); + if (orpr != nrpr) { + if (orpr == pr) + msg_prison_cleanup(pr); + if (orpr != NULL) { + /* Change child jails matching the old root, */ + FOREACH_PRISON_DESCENDANT(pr, tpr, descend) { + prison_lock(tpr); + trpr = osd_jail_get(tpr, + msg_prison_slot); + if (trpr == orpr) { + (void)osd_jail_set(tpr, + msg_prison_slot, nrpr); + prison_unlock(tpr); + if (trpr == tpr) + msg_prison_cleanup(tpr); + } else { + prison_unlock(tpr); + descend = 0; + } + } + } + } + } + + return (0); +} + +static int +msg_prison_get(void *obj, void *data) +{ + struct prison *pr = obj; + struct prison *rpr; + struct vfsoptlist *opts = data; + int error, jsys; + + /* Set sysvmsg based on the jail's root prison. */ + prison_lock(pr); + rpr = osd_jail_get(pr, msg_prison_slot); + prison_unlock(pr); + jsys = rpr == NULL ? JAIL_SYS_DISABLE + : rpr == pr ? JAIL_SYS_NEW : JAIL_SYS_INHERIT; + error = vfs_setopt(opts, "sysvmsg", &jsys, sizeof(jsys)); + if (error == ENOENT) + error = 0; + return (error); +} + +static int +msg_prison_remove(void *obj, void *data __unused) +{ + struct prison *pr = obj; + struct prison *rpr; + + prison_lock(pr); + rpr = osd_jail_get(pr, msg_prison_slot); + prison_unlock(pr); + if (rpr == pr) + msg_prison_cleanup(pr); + return (0); +} + +static void +msg_prison_cleanup(struct prison *pr) +{ + struct msqid_kernel *msqkptr; + int i; + + /* Remove any msqs that belong to this jail. */ + mtx_lock(&msq_mtx); + for (i = 0; i < msginfo.msgmni; i++) { + msqkptr = &msqids[i]; + if (msqkptr->u.msg_qbytes != 0 && + msqkptr->cred != NULL && msqkptr->cred->cr_prison == pr) + msq_remove(msqkptr); + } + mtx_unlock(&msq_mtx); +} + +SYSCTL_JAIL_PARAM_SYS_NODE(sysvmsg, CTLFLAG_RW, "SYSV message queues"); + #ifdef COMPAT_FREEBSD32 int freebsd32_msgsys(struct thread *td, struct freebsd32_msgsys_args *uap) @@ -1516,8 +1826,6 @@ sys_msgsys(td, uap) { int error; - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) - return (ENOSYS); if (uap->which < 0 || uap->which >= nitems(msgcalls)) return (EINVAL); error = (*msgcalls[uap->which])(td, &uap->a2); Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Mon Apr 25 17:01:13 2016 (r298584) +++ head/sys/kern/sysv_sem.c Mon Apr 25 17:06:50 2016 (r298585) @@ -52,7 +52,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -78,7 +80,16 @@ static int sysvsem_modload(struct module static int semunload(void); static void semexit_myhook(void *arg, struct proc *p); static int sysctl_sema(SYSCTL_HANDLER_ARGS); -static int semvalid(int semid, struct semid_kernel *semakptr); +static int semvalid(int semid, struct prison *rpr, + struct semid_kernel *semakptr); +static void sem_remove(int semidx, struct ucred *cred); +static struct prison *sem_find_prison(struct ucred *); +static int sem_prison_cansee(struct prison *, struct semid_kernel *); +static int sem_prison_check(void *, void *); +static int sem_prison_set(void *, void *); +static int sem_prison_get(void *, void *); +static int sem_prison_remove(void *, void *); +static void sem_prison_cleanup(struct prison *); #ifndef _SYS_SYSPROTO_H_ struct __semctl_args; @@ -104,6 +115,7 @@ LIST_HEAD(, sem_undo) semu_list; /* list LIST_HEAD(, sem_undo) semu_free_list; /* list of free undo structures */ static int *semu; /* undo structure pool */ static eventhandler_tag semexit_tag; +static unsigned sem_prison_slot; /* prison OSD slot */ #define SEMUNDO_MTX sem_undo_mtx #define SEMUNDO_LOCK() mtx_lock(&SEMUNDO_MTX); @@ -247,7 +259,15 @@ static struct syscall_helper_data sem32_ static int seminit(void) { + struct prison *pr; + void *rsv; int i, error; + osd_method_t methods[PR_MAXMETHOD] = { + [PR_METHOD_CHECK] = sem_prison_check, + [PR_METHOD_SET] = sem_prison_set, + [PR_METHOD_GET] = sem_prison_get, + [PR_METHOD_REMOVE] = sem_prison_remove, + }; sem = malloc(sizeof(struct sem) * seminfo.semmns, M_SEM, M_WAITOK); sema = malloc(sizeof(struct semid_kernel) * seminfo.semmni, M_SEM, @@ -278,6 +298,29 @@ seminit(void) semexit_tag = EVENTHANDLER_REGISTER(process_exit, semexit_myhook, NULL, EVENTHANDLER_PRI_ANY); + /* Set current prisons according to their allow.sysvipc. */ + sem_prison_slot = osd_jail_register(NULL, methods); + rsv = osd_reserve(sem_prison_slot); + prison_lock(&prison0); + (void)osd_jail_set_reserved(&prison0, sem_prison_slot, rsv, &prison0); + prison_unlock(&prison0); + rsv = NULL; + sx_slock(&allprison_lock); + TAILQ_FOREACH(pr, &allprison, pr_list) { + if (rsv == NULL) + rsv = osd_reserve(sem_prison_slot); + prison_lock(pr); + if ((pr->pr_allow & PR_ALLOW_SYSVIPC) && pr->pr_ref > 0) { + (void)osd_jail_set_reserved(pr, sem_prison_slot, rsv, + &prison0); + rsv = NULL; + } + prison_unlock(pr); + } + if (rsv != NULL) + osd_free_reserved(rsv); + sx_sunlock(&allprison_lock); + error = syscall_helper_register(sem_syscalls, SY_THR_STATIC_KLD); if (error != 0) return (error); @@ -303,6 +346,8 @@ semunload(void) #endif syscall_helper_unregister(sem_syscalls); EVENTHANDLER_DEREGISTER(process_exit, semexit_tag); + if (sem_prison_slot != 0) + osd_jail_deregister(sem_prison_slot); #ifdef MAC for (i = 0; i < seminfo.semmni; i++) mac_sysvsem_destroy(&sema[i]); @@ -489,11 +534,74 @@ semundo_clear(int semid, int semnum) } static int -semvalid(int semid, struct semid_kernel *semakptr) +semvalid(int semid, struct prison *rpr, struct semid_kernel *semakptr) { return ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || - semakptr->u.sem_perm.seq != IPCID_TO_SEQ(semid) ? EINVAL : 0); + semakptr->u.sem_perm.seq != IPCID_TO_SEQ(semid) || + sem_prison_cansee(rpr, semakptr) ? EINVAL : 0); +} + +static void +sem_remove(int semidx, struct ucred *cred) +{ + struct semid_kernel *semakptr; + int i; + + KASSERT(semidx >= 0 && semidx < seminfo.semmni, + ("semidx out of bounds")); + semakptr = &sema[semidx]; + semakptr->u.sem_perm.cuid = cred ? cred->cr_uid : 0; + semakptr->u.sem_perm.uid = cred ? cred->cr_uid : 0; + semakptr->u.sem_perm.mode = 0; + racct_sub_cred(semakptr->cred, RACCT_NSEM, semakptr->u.sem_nsems); + crfree(semakptr->cred); + semakptr->cred = NULL; + SEMUNDO_LOCK(); + semundo_clear(semidx, -1); + SEMUNDO_UNLOCK(); +#ifdef MAC + mac_sysvsem_cleanup(semakptr); +#endif + wakeup(semakptr); + for (i = 0; i < seminfo.semmni; i++) { + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && + sema[i].u.sem_base > semakptr->u.sem_base) + mtx_lock_flags(&sema_mtx[i], LOP_DUPOK); + } + for (i = semakptr->u.sem_base - sem; i < semtot; i++) + sem[i] = sem[i + semakptr->u.sem_nsems]; + for (i = 0; i < seminfo.semmni; i++) { + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && + sema[i].u.sem_base > semakptr->u.sem_base) { + sema[i].u.sem_base -= semakptr->u.sem_nsems; + mtx_unlock(&sema_mtx[i]); + } + } + semtot -= semakptr->u.sem_nsems; +} + +static struct prison * +sem_find_prison(struct ucred *cred) +{ + struct prison *pr, *rpr; + + pr = cred->cr_prison; + prison_lock(pr); + rpr = osd_jail_get(pr, sem_prison_slot); + prison_unlock(pr); + return rpr; +} + +static int +sem_prison_cansee(struct prison *rpr, struct semid_kernel *semakptr) +{ + + if (semakptr->cred == NULL || + !(rpr == semakptr->cred->cr_prison || + prison_ischild(rpr, semakptr->cred->cr_prison))) + return (EINVAL); + return (0); } /* @@ -572,6 +680,7 @@ kern_semctl(struct thread *td, int semid u_short *array; struct ucred *cred = td->td_ucred; int i, error; + struct prison *rpr; struct semid_ds *sbuf; struct semid_kernel *semakptr; struct mtx *sema_mtxp; @@ -580,7 +689,9 @@ kern_semctl(struct thread *td, int semid DPRINTF(("call to semctl(%d, %d, %d, 0x%p)\n", semid, semnum, cmd, arg)); - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) + + rpr = sem_find_prison(td->td_ucred); + if (sem == NULL) return (ENOSYS); array = NULL; @@ -600,6 +711,8 @@ kern_semctl(struct thread *td, int semid error = EINVAL; goto done2; } + if ((error = sem_prison_cansee(rpr, semakptr))) + goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) goto done2; #ifdef MAC @@ -608,6 +721,8 @@ kern_semctl(struct thread *td, int semid goto done2; #endif bcopy(&semakptr->u, arg->buf, sizeof(struct semid_ds)); + if (cred->cr_prison != semakptr->cred->cr_prison) + arg->buf->sem_perm.key = IPC_PRIVATE; *rval = IXSEQ_TO_IPCID(semid, semakptr->u.sem_perm); mtx_unlock(sema_mtxp); return (0); @@ -622,6 +737,7 @@ kern_semctl(struct thread *td, int semid if (cmd == IPC_RMID) mtx_lock(&sem_mtx); mtx_lock(sema_mtxp); + #ifdef MAC error = mac_sysvsem_check_semctl(cred, semakptr, cmd); if (error != 0) @@ -633,42 +749,15 @@ kern_semctl(struct thread *td, int semid switch (cmd) { case IPC_RMID: - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_M))) goto done2; - semakptr->u.sem_perm.cuid = cred->cr_uid; - semakptr->u.sem_perm.uid = cred->cr_uid; - semakptr->u.sem_perm.mode = 0; - racct_sub_cred(semakptr->cred, RACCT_NSEM, semakptr->u.sem_nsems); - crfree(semakptr->cred); - semakptr->cred = NULL; - SEMUNDO_LOCK(); - semundo_clear(semidx, -1); - SEMUNDO_UNLOCK(); -#ifdef MAC - mac_sysvsem_cleanup(semakptr); -#endif - wakeup(semakptr); - for (i = 0; i < seminfo.semmni; i++) { - if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && - sema[i].u.sem_base > semakptr->u.sem_base) - mtx_lock_flags(&sema_mtx[i], LOP_DUPOK); - } - for (i = semakptr->u.sem_base - sem; i < semtot; i++) - sem[i] = sem[i + semakptr->u.sem_nsems]; - for (i = 0; i < seminfo.semmni; i++) { - if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && - sema[i].u.sem_base > semakptr->u.sem_base) { - sema[i].u.sem_base -= semakptr->u.sem_nsems; - mtx_unlock(&sema_mtx[i]); - } - } - semtot -= semakptr->u.sem_nsems; + sem_remove(semidx, cred); break; case IPC_SET: - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_M))) goto done2; @@ -681,15 +770,17 @@ kern_semctl(struct thread *td, int semid break; case IPC_STAT: - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) goto done2; bcopy(&semakptr->u, arg->buf, sizeof(struct semid_ds)); + if (cred->cr_prison != semakptr->cred->cr_prison) + arg->buf->sem_perm.key = IPC_PRIVATE; break; case GETNCNT: - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) goto done2; @@ -701,7 +792,7 @@ kern_semctl(struct thread *td, int semid break; case GETPID: - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) goto done2; @@ -713,7 +804,7 @@ kern_semctl(struct thread *td, int semid break; case GETVAL: - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) goto done2; @@ -749,7 +840,7 @@ kern_semctl(struct thread *td, int semid mtx_unlock(sema_mtxp); array = malloc(sizeof(*array) * count, M_TEMP, M_WAITOK); mtx_lock(sema_mtxp); - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; KASSERT(count == semakptr->u.sem_nsems, ("nsems changed")); if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) @@ -762,7 +853,7 @@ kern_semctl(struct thread *td, int semid break; case GETZCNT: - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) goto done2; @@ -774,7 +865,7 @@ kern_semctl(struct thread *td, int semid break; case SETVAL: - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_W))) goto done2; @@ -805,7 +896,7 @@ kern_semctl(struct thread *td, int semid mtx_lock(sema_mtxp); if (error) break; - if ((error = semvalid(semid, semakptr)) != 0) + if ((error = semvalid(semid, rpr, semakptr)) != 0) goto done2; KASSERT(count == semakptr->u.sem_nsems, ("nsems changed")); if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_W))) @@ -855,13 +946,16 @@ sys_semget(struct thread *td, struct sem struct ucred *cred = td->td_ucred; DPRINTF(("semget(0x%x, %d, 0%o)\n", key, nsems, semflg)); - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) + + if (sem_find_prison(cred) == NULL) return (ENOSYS); mtx_lock(&sem_mtx); if (key != IPC_PRIVATE) { for (semid = 0; semid < seminfo.semmni; semid++) { if ((sema[semid].u.sem_perm.mode & SEM_ALLOC) && + sema[semid].cred != NULL && + sema[semid].cred->cr_prison == cred->cr_prison && sema[semid].u.sem_perm.key == key) break; } @@ -978,6 +1072,7 @@ sys_semop(struct thread *td, struct semo struct sembuf small_sops[SMALL_SOPS]; int semid = uap->semid; size_t nsops = uap->nsops; + struct prison *rpr; struct sembuf *sops; struct semid_kernel *semakptr; struct sembuf *sopptr = NULL; @@ -994,7 +1089,8 @@ sys_semop(struct thread *td, struct semo #endif DPRINTF(("call to semop(%d, %p, %u)\n", semid, sops, nsops)); - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) + rpr = sem_find_prison(td->td_ucred); + if (sem == NULL) return (ENOSYS); semid = IPCID_TO_IX(semid); /* Convert back to zero origin */ @@ -1044,6 +1140,8 @@ sys_semop(struct thread *td, struct semo error = EINVAL; goto done2; } + if ((error = sem_prison_cansee(rpr, semakptr)) != 0) + goto done2; /* * Initial pass thru sops to see what permissions are needed. * Also perform any checks that don't need repeating on each @@ -1367,11 +1465,217 @@ semexit_myhook(void *arg, struct proc *p static int sysctl_sema(SYSCTL_HANDLER_ARGS) { + struct prison *rpr; + struct sbuf sb; + struct semid_kernel tmp, empty; + struct semid_kernel *semakptr; + int error, i; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + goto done; + rpr = sem_find_prison(req->td->td_ucred); + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct semid_kernel) * + seminfo.semmni, req); + + bzero(&empty, sizeof(empty)); + for (i = 0; i < seminfo.semmni; i++) { + semakptr = &sema[i]; + if ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || + rpr == NULL || sem_prison_cansee(rpr, semakptr) != 0) { + semakptr = ∅ + } else if (req->td->td_ucred->cr_prison != + semakptr->cred->cr_prison) { + bcopy(semakptr, &tmp, sizeof(tmp)); + semakptr = &tmp; + semakptr->u.sem_perm.key = IPC_PRIVATE; + } - return (SYSCTL_OUT(req, sema, - sizeof(struct semid_kernel) * seminfo.semmni)); + sbuf_bcat(&sb, semakptr, sizeof(*semakptr)); + } + error = sbuf_finish(&sb); + sbuf_delete(&sb); + +done: + return (error); } +static int +sem_prison_check(void *obj, void *data) +{ + struct prison *pr = obj; + struct prison *prpr; + struct vfsoptlist *opts = data; + int error, jsys; + + /* + * sysvsem is a jailsys integer. + * It must be "disable" if the parent jail is disabled. + */ + error = vfs_copyopt(opts, "sysvsem", &jsys, sizeof(jsys)); + if (error != ENOENT) { + if (error != 0) + return (error); + switch (jsys) { + case JAIL_SYS_DISABLE: + break; + case JAIL_SYS_NEW: + case JAIL_SYS_INHERIT: + prison_lock(pr->pr_parent); + prpr = osd_jail_get(pr->pr_parent, sem_prison_slot); + prison_unlock(pr->pr_parent); + if (prpr == NULL) + return (EPERM); + break; + default: + return (EINVAL); + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Apr 25 17:32:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47C0FB1C96D; Mon, 25 Apr 2016 17:32:10 +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 0AEE21F3E; Mon, 25 Apr 2016 17:32:09 +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 u3PHW9VH040661; Mon, 25 Apr 2016 17:32:09 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PHW9vI040660; Mon, 25 Apr 2016 17:32:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604251732.u3PHW9vI040660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 25 Apr 2016 17:32:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298586 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 17:32:10 -0000 Author: andrew Date: Mon Apr 25 17:32:08 2016 New Revision: 298586 URL: https://svnweb.freebsd.org/changeset/base/298586 Log: Use the yield instruction in the arm64 cpu_spinwait. This instruction is a hint to the hardware the software is not performing a task. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/include/cpu.h Modified: head/sys/arm64/include/cpu.h ============================================================================== --- head/sys/arm64/include/cpu.h Mon Apr 25 17:06:50 2016 (r298585) +++ head/sys/arm64/include/cpu.h Mon Apr 25 17:32:08 2016 (r298586) @@ -50,7 +50,7 @@ #define cpu_getstack(td) ((td)->td_frame->tf_sp) #define cpu_setstack(td, sp) ((td)->td_frame->tf_sp = (sp)) -#define cpu_spinwait() /* nothing */ +#define cpu_spinwait() __asm __volatile("yield" ::: "memory") /* Extract CPU affinity levels 0-3 */ #define CPU_AFF0(mpidr) (u_int)(((mpidr) >> 0) & 0xff) From owner-svn-src-head@freebsd.org Mon Apr 25 18:09:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D9E2B1C1A1; Mon, 25 Apr 2016 18:09:38 +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 151AE1186; Mon, 25 Apr 2016 18:09:37 +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 u3PI9bWB054548; Mon, 25 Apr 2016 18:09:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PI9bCa054547; Mon, 25 Apr 2016 18:09:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604251809.u3PI9bCa054547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 25 Apr 2016 18:09:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298587 - head/sys/cddl/dev/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 18:09:38 -0000 Author: markj Date: Mon Apr 25 18:09:36 2016 New Revision: 298587 URL: https://svnweb.freebsd.org/changeset/base/298587 Log: Add a kern.dtrace.err_verbose sysctl to control dtrace_err_verbose. When this flag is turned on, DOF and DIF validation errors are printed to the kernel message buffer. This is useful for debugging. Also remove the debug.dtrace.debug sysctl, which has no effect. Modified: head/sys/cddl/dev/dtrace/dtrace_sysctl.c Modified: head/sys/cddl/dev/dtrace/dtrace_sysctl.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_sysctl.c Mon Apr 25 17:32:08 2016 (r298586) +++ head/sys/cddl/dev/dtrace/dtrace_sysctl.c Mon Apr 25 18:09:36 2016 (r298587) @@ -22,11 +22,6 @@ * */ -SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug parameters"); - -int dtrace_debug = 0; -SYSCTL_INT(_debug_dtrace, OID_AUTO, debug, CTLFLAG_RWTUN, &dtrace_debug, 0, ""); - /* Report registered DTrace providers. */ static int sysctl_dtrace_providers(SYSCTL_HANDLER_ARGS) @@ -78,11 +73,17 @@ sysctl_dtrace_providers(SYSCTL_HANDLER_A return (error); } +SYSCTL_NODE(_debug, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace debug parameters"); + SYSCTL_PROC(_debug_dtrace, OID_AUTO, providers, CTLTYPE_STRING | CTLFLAG_RD, 0, 0, sysctl_dtrace_providers, "A", "available DTrace providers"); SYSCTL_NODE(_kern, OID_AUTO, dtrace, CTLFLAG_RD, 0, "DTrace parameters"); +SYSCTL_INT(_kern_dtrace, OID_AUTO, err_verbose, CTLFLAG_RW, + &dtrace_err_verbose, 0, + "print DIF and DOF validation errors to the message buffer"); + SYSCTL_INT(_kern_dtrace, OID_AUTO, memstr_max, CTLFLAG_RW, &dtrace_memstr_max, 0, "largest allowed argument to memstr(), 0 indicates no limit"); From owner-svn-src-head@freebsd.org Mon Apr 25 18:39:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26373B1CB92 for ; Mon, 25 Apr 2016 18:39:15 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::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 DBAED150E for ; Mon, 25 Apr 2016 18:39:14 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: by mail-oi0-x231.google.com with SMTP id k142so185965488oib.1 for ; Mon, 25 Apr 2016 11:39:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sippysoft-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=rFYWi2ZfgWdpKS4yvFXzQpxh5Iz96IGqQ1GLew6JG08=; b=0FlcGf2dqFYJDliO/CtRQJfmNXpKa+IcKRdOXBH/4g2CVXpRLmqPrixYhCvDO2MaHZ A/e2Aolpqz6VYvxY2msraSmLNu8h+JoZUbXKTfkdDL/a64cnid7agUY43hbhpVJPJaUF qBmMIlnHkJ/SWmGtTVZc8U+tRRuKgJQbc33BgSVuHEHe3roGOqlWTv/SGpg4SbGZsQPd YaKw4VsmhHO3VHbKCIRpzoMTnU3m6Xe1FxK9Od5H7F2GvkvPNK8uEFs1TfS4kYHMxUmB LaDSCzBgpEtBCIGjKp3ngcSt2Wrs4NfwJZOq1RodY44LG39YsiVxP9uDcmcsvFG3URSz RVJA== 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; bh=rFYWi2ZfgWdpKS4yvFXzQpxh5Iz96IGqQ1GLew6JG08=; b=ZCAdcFwOE++x6pzJVs+LCPvZfB2tmjfSrIhEQjrz2Jxd9w8cLT77pGCpF6pTWDdnIs KwjjDY0jG9rCBKLbCvQj7q/Do49TSfgXr2iiebvoh/tYNQpnzXoJvrabTmf87kSKMPR+ cgZwapYPAjzHuyhmpDcAnB/lM3w/XNnZ8EU5tlSWoImeeUpRJgYJjKBTimsSc41E8h36 p+KQLoMiPSVI99qljGT4FKwucZyRt50ZWGISFCgYJ6SHYrgCQdmzGSP+1q8bY21iGv5o RGJQOl/cE09d/odPEUap7z0uYdA+C9vES3xmYJhSjbQ66GhXJnr7HhIp5jROMKKOpqHX lMJA== X-Gm-Message-State: AOPr4FXlfGW7yQALNWdq+Lwyv8j+1hd+iLCkIe2sQulwxndqcGiVOVo8Dn15qY1oSQitsZFkNliMN8pzwWDWPRgt MIME-Version: 1.0 X-Received: by 10.157.6.80 with SMTP id 74mr6082729otn.164.1461609554162; Mon, 25 Apr 2016 11:39:14 -0700 (PDT) Sender: sobomax@sippysoft.com Received: by 10.157.45.21 with HTTP; Mon, 25 Apr 2016 11:39:14 -0700 (PDT) In-Reply-To: <201604251320.u3PDKZtI057759@repo.freebsd.org> References: <201604251320.u3PDKZtI057759@repo.freebsd.org> Date: Mon, 25 Apr 2016 11:39:14 -0700 X-Google-Sender-Auth: -W0TT_Ucev-aDrjS5dVc8BqbW64 Message-ID: Subject: Re: svn: head/usr.bin/mkuzip From: Maxim Sobolev To: "Bjoern A. Zeeb" 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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 18:39:15 -0000 Thanks and sorry about that. I did not realize we use different compilers for different architectures. By any chance, do you know is there a way to test buildworld on amd64 with gcc? On Mon, Apr 25, 2016 at 6:20 AM, Bjoern A. Zeeb wrote: > Author: bz > Date: Mon Apr 25 13:20:35 2016 > New Revision: 298577 > URL: https://svnweb.freebsd.org/changeset/base/298577 > > Log: > Try to make gcc builds happy again by removing a redundant declaration. > > Modified: > head/usr.bin/mkuzip/mkuzip.c > > Modified: head/usr.bin/mkuzip/mkuzip.c > > ============================================================================== > --- head/usr.bin/mkuzip/mkuzip.c Mon Apr 25 12:25:30 2016 > (r298576) > +++ head/usr.bin/mkuzip/mkuzip.c Mon Apr 25 13:20:35 2016 > (r298577) > @@ -78,7 +78,6 @@ static struct mkuz_format ulzma_fmt = { > static struct mkuz_blk *readblock(int, u_int32_t); > static void usage(void); > static void cleanup(void); > -int mkuz_memvcmp(const void *, unsigned char, size_t); > > static char *cleanfile = NULL; > > > From owner-svn-src-head@freebsd.org Mon Apr 25 18:40:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDF39B1CCAF; Mon, 25 Apr 2016 18:40:58 +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 901CE1803; Mon, 25 Apr 2016 18:40:58 +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 u3PIev3A065710; Mon, 25 Apr 2016 18:40:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PIevRb065709; Mon, 25 Apr 2016 18:40:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604251840.u3PIevRb065709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 25 Apr 2016 18:40:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298589 - head/sys/cddl/contrib/opensolaris/uts/common/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 18:40:59 -0000 Author: markj Date: Mon Apr 25 18:40:57 2016 New Revision: 298589 URL: https://svnweb.freebsd.org/changeset/base/298589 Log: Allow DOF sections with excessively long probe function components. Without this change, DTrace will refuse to load a DOF section if the function component of any of its probes exceeds DTRACE_FUNCNAMELEN (128). Probes in C++ programs can have very long function components. Rather than rejecting all probes if a single probe exceeds the limit, simply skip the invalid probe and emit a warning. This ensures that valid probes are instantiated. PR: 207735 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Apr 25 18:13:21 2016 (r298588) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Apr 25 18:40:57 2016 (r298589) @@ -9355,6 +9355,10 @@ dtrace_helper_provide_one(dof_helper_t * probe = (dof_probe_t *)(uintptr_t)(daddr + prb_sec->dofs_offset + i * prb_sec->dofs_entsize); + /* See the check in dtrace_helper_provider_validate(). */ + if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN) + continue; + dhpb.dthpb_mod = dhp->dofhp_mod; dhpb.dthpb_func = strtab + probe->dofpr_func; dhpb.dthpb_name = strtab + probe->dofpr_name; @@ -16042,7 +16046,13 @@ dtrace_helper_provider_validate(dof_hdr_ if (strlen(strtab + probe->dofpr_func) >= DTRACE_FUNCNAMELEN) { dtrace_dof_error(dof, "function name too long"); - return (-1); + /* + * Keep going if the function name is too long. + * Unlike provider and probe names, we cannot reasonably + * impose restrictions on function names, since they're + * a property of the code being instrumented. We will + * skip this probe in dtrace_helper_provide_one(). + */ } if (probe->dofpr_name >= str_sec->dofs_size || From owner-svn-src-head@freebsd.org Mon Apr 25 18:44:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC71CB1CD3D; Mon, 25 Apr 2016 18:44:12 +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 850211BE2; Mon, 25 Apr 2016 18:44:12 +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 u3PIiBB1066520; Mon, 25 Apr 2016 18:44:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PIiBHd066519; Mon, 25 Apr 2016 18:44:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201604251844.u3PIiBHd066519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 25 Apr 2016 18:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298590 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 18:44:12 -0000 Author: markj Date: Mon Apr 25 18:44:11 2016 New Revision: 298590 URL: https://svnweb.freebsd.org/changeset/base/298590 Log: Increase DTRACE_FUNCNAMELEN from 128 to 192. This allows for the long function components encountered in www/firefox. This constant is part of DTrace's userland ABI, so this change may not be MFC'ed. PR: 207735 Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Mon Apr 25 18:40:57 2016 (r298589) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Mon Apr 25 18:44:11 2016 (r298590) @@ -87,7 +87,7 @@ typedef int model_t; #define DTRACE_PROVNAMELEN 64 #define DTRACE_MODNAMELEN 64 -#define DTRACE_FUNCNAMELEN 128 +#define DTRACE_FUNCNAMELEN 192 #define DTRACE_NAMELEN 64 #define DTRACE_FULLNAMELEN (DTRACE_PROVNAMELEN + DTRACE_MODNAMELEN + \ DTRACE_FUNCNAMELEN + DTRACE_NAMELEN + 4) From owner-svn-src-head@freebsd.org Mon Apr 25 18:49:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0177B1CE39 for ; Mon, 25 Apr 2016 18:49:52 +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 B17061E49 for ; Mon, 25 Apr 2016 18:49:52 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 85c1a99c-0b16-11e6-9fea-b54670b854a5 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.34.117.227 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 25 Apr 2016 18:50:03 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.14.9) with ESMTP id u3PInipf001636; Mon, 25 Apr 2016 12:49:44 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1461610184.1191.58.camel@freebsd.org> Subject: Re: svn: head/usr.bin/mkuzip From: Ian Lepore To: Maxim Sobolev , "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 25 Apr 2016 12:49:44 -0600 In-Reply-To: References: <201604251320.u3PDKZtI057759@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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 18:49:52 -0000 On Mon, 2016-04-25 at 11:39 -0700, Maxim Sobolev wrote: > Thanks and sorry about that. I did not realize we use different > compilers > for different architectures. By any chance, do you know is there a > way to > test buildworld on amd64 with gcc? > Add these args to src.conf or the command line. I haven't tried these with anything except arm platforms for a couple years, but in theory it should work on amd64... #WITH_GCC=yes #WITH_GNUCXX=yes #WITH_GCC_BOOTSTRAP=yes #WITHOUT_CLANG=yes #WITHOUT_CLANG_IS_CC=yes #WITHOUT_CLANG_BOOTSTRAP=yes -- Ian > On Mon, Apr 25, 2016 at 6:20 AM, Bjoern A. Zeeb > wrote: > > > Author: bz > > Date: Mon Apr 25 13:20:35 2016 > > New Revision: 298577 > > URL: https://svnweb.freebsd.org/changeset/base/298577 > > > > Log: > > Try to make gcc builds happy again by removing a redundant > > declaration. > > > > Modified: > > head/usr.bin/mkuzip/mkuzip.c > > > > Modified: head/usr.bin/mkuzip/mkuzip.c > > > > =================================================================== > > =========== > > --- head/usr.bin/mkuzip/mkuzip.c Mon Apr 25 12:25:30 2016 > > (r298576) > > +++ head/usr.bin/mkuzip/mkuzip.c Mon Apr 25 13:20:35 2016 > > (r298577) > > @@ -78,7 +78,6 @@ static struct mkuz_format ulzma_fmt = { > > static struct mkuz_blk *readblock(int, u_int32_t); > > static void usage(void); > > static void cleanup(void); > > -int mkuz_memvcmp(const void *, unsigned char, size_t); > > > > static char *cleanfile = NULL; > > > > > > From owner-svn-src-head@freebsd.org Mon Apr 25 18:55:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2458BB1CFC9; Mon, 25 Apr 2016 18:55:03 +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 E592D1202; Mon, 25 Apr 2016 18:55:02 +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 u3PIt2d1069719; Mon, 25 Apr 2016 18:55:02 GMT (envelope-from davidcs@FreeBSD.org) Received: (from davidcs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PIt1mS069717; Mon, 25 Apr 2016 18:55:01 GMT (envelope-from davidcs@FreeBSD.org) Message-Id: <201604251855.u3PIt1mS069717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: davidcs set sender to davidcs@FreeBSD.org using -f From: David C Somayajulu Date: Mon, 25 Apr 2016 18:55:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298591 - in head/sys: dev/bxe modules/bxe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 18:55:03 -0000 Author: davidcs Date: Mon Apr 25 18:55:01 2016 New Revision: 298591 URL: https://svnweb.freebsd.org/changeset/base/298591 Log: 1. Removed -Wno-shift-negative-value from Makefile 2. Fixed warning its absence caused in bxe_elink.c MFC after:5 days Modified: head/sys/dev/bxe/bxe_elink.c head/sys/modules/bxe/Makefile Modified: head/sys/dev/bxe/bxe_elink.c ============================================================================== --- head/sys/dev/bxe/bxe_elink.c Mon Apr 25 18:44:11 2016 (r298590) +++ head/sys/dev/bxe/bxe_elink.c Mon Apr 25 18:55:01 2016 (r298591) @@ -11969,8 +11969,8 @@ static elink_status_t elink_54618se_conf elink_eee_disable(phy, params, vars); } } else { - vars->eee_status &= ~SHMEM_EEE_1G_ADV << - SHMEM_EEE_SUPPORTED_SHIFT; + vars->eee_status &= ((uint32_t)(~SHMEM_EEE_1G_ADV) << + SHMEM_EEE_SUPPORTED_SHIFT); if (phy->flags & ELINK_FLAGS_EEE) { /* Handle legacy auto-grEEEn */ Modified: head/sys/modules/bxe/Makefile ============================================================================== --- head/sys/modules/bxe/Makefile Mon Apr 25 18:44:11 2016 (r298590) +++ head/sys/modules/bxe/Makefile Mon Apr 25 18:55:01 2016 (r298591) @@ -17,6 +17,5 @@ SRCS += bxe.c \ 57712_init_values.c CFLAGS += -I${BXE} -CFLAGS += -Wno-shift-negative-value .include From owner-svn-src-head@freebsd.org Mon Apr 25 20:28:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C878B1C3C7; Mon, 25 Apr 2016 20:28:01 +0000 (UTC) (envelope-from subbsd@gmail.com) Received: from mail-pf0-x242.google.com (mail-pf0-x242.google.com [IPv6:2607:f8b0:400e:c00::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03CAD1DC7; Mon, 25 Apr 2016 20:28:01 +0000 (UTC) (envelope-from subbsd@gmail.com) Received: by mail-pf0-x242.google.com with SMTP id r187so18942962pfr.2; Mon, 25 Apr 2016 13:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=OgeEJske44xAyyZ20Sdb3lWDByLtm8JUrchTw7FsN/I=; b=QERq/zNHFhBMCPLkZUEzy5+ABrjbw9aJx7Po84ZKBiW6kNpvPGJhYwZGmlk1ZhFGNL cOnx1TLQr7yWD05BlX/DVJOHE38cBeQczsFBliEKj7VmIdlN/o2RXgZbnpgNN2eCguWI d7+mnzbmoqKGWWU1sQL/X+W4uF82U6FHSD5GYKFHV4KjZ7z+orjSY3GmXhkdiNOo6TL9 HdZtqm5e46/tSy6EGCSPXzeVz55YDnTxSYcWT0E9Xp7bW4JZLkSYgjG2YBmThlfJRJ1S 7i9XvoDV8OBchs/WK3W05vP8Bh0173bGJ4VdVXYwMDH/dHJmyq024cZz4e91seMsq2Ia PUYA== 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; bh=OgeEJske44xAyyZ20Sdb3lWDByLtm8JUrchTw7FsN/I=; b=f4m7aMhCoDmLKxImVwIOhZcrXIddu81TRyd2MRMUF1TNndY7wv+RNlqNUEg4mS3++f Z/daxOb7p4KEVDPDCzhPIVNs6KFa2/efqPfD0XV9/yLnoPPGuck5f1FX1yUf4OteFlFt 8MfFcj6lHT/OmVuKAdk88DnkUcfZNwY42diWHn8mFF44Mnfrxyz64lKlbOVHkYZTu0YQ SSr/ys5MKK8uAebMzV/du8YhhbgQb+YM38KwC2XSY50v6WlNY57S6dPr8nH7WUJWhDRi +fHnJev3C3TfxtpC9sJ4GeNcJLhx8Kwctlse9omz3BvikdzjxwisYuiAWczb4BTxWb/+ VjsA== X-Gm-Message-State: AOPr4FW0MALkGdx2SGL1sXJAhq5YTy417cGIdGlNvyhnrJLY/RlhKtnxkx0w/e8OC6vzMqyfxQi/CB0/oSH9gg== MIME-Version: 1.0 X-Received: by 10.98.89.194 with SMTP id k63mr50935483pfj.135.1461616080560; Mon, 25 Apr 2016 13:28:00 -0700 (PDT) Received: by 10.66.156.168 with HTTP; Mon, 25 Apr 2016 13:28:00 -0700 (PDT) In-Reply-To: <201604251706.u3PH6okj031018@repo.freebsd.org> References: <201604251706.u3PH6okj031018@repo.freebsd.org> Date: Mon, 25 Apr 2016 23:28:00 +0300 Message-ID: Subject: Re: svn commit: r298585 - in head: sys/kern usr.sbin/jail From: Subbsd To: Jamie Gritton Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 20:28:01 -0000 I do not know how it works for/in jails, but looks like this breaks work SHM in host. I've got on any QT-based application after this commit: EP Get failed: 'Feature not implemented. The feature requested is not implemented by the recipient or server and therefore cannot be processed.' (501)" [23:05:55] W:QNativeImage: Unable to attach to shared memory segment. Segmentation fault (core dumped) and tracing stops on: shmget(0x0,0x634e0,0x3c0) = 65580 (0x1002c) shmat(0x1002c,0x0,0x0) ERR#22 'Invalid argument' On Mon, Apr 25, 2016 at 8:06 PM, Jamie Gritton wrote: > Author: jamie > Date: Mon Apr 25 17:06:50 2016 > New Revision: 298585 > URL: https://svnweb.freebsd.org/changeset/base/298585 > > Log: > Encapsulate SYSV IPC objects in jails. Define per-module parameters > sysvmsg, sysvsem, and sysvshm, with the following bahavior: > > inherit: allow full access to the IPC primitives. This is the same as > the current setup with allow.sysvipc is on. Jails and the base system > can see (and moduly) each other's objects, which is generally considered > a bad thing (though may be useful in some circumstances). > > disable: all no access, same as the current setup with allow.sysvipc off. > > new: A jail may see use the IPC objects that it has created. It also > gets its own IPC key namespace, so different jails may have their own > objects using the same key value. The parent jail (or base system) can > see the jail's IPC objects, but not its keys. > > PR: 48471 > Submitted by: based on work by kikuchan98@gmail.com > MFC after: 5 days > > Modified: > head/sys/kern/sysv_msg.c > head/sys/kern/sysv_sem.c > head/sys/kern/sysv_shm.c > head/usr.sbin/jail/jail.8 > > Modified: head/sys/kern/sysv_msg.c > ============================================================================== > --- head/sys/kern/sysv_msg.c Mon Apr 25 17:01:13 2016 (r298584) > +++ head/sys/kern/sysv_msg.c Mon Apr 25 17:06:50 2016 (r298585) > @@ -62,8 +62,11 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > +#include > +#include > #include > #include > #include > @@ -80,6 +83,14 @@ static MALLOC_DEFINE(M_MSG, "msg", "SVID > static int msginit(void); > static int msgunload(void); > static int sysvmsg_modload(struct module *, int, void *); > +static void msq_remove(struct msqid_kernel *); > +static struct prison *msg_find_prison(struct ucred *); > +static int msq_prison_cansee(struct prison *, struct msqid_kernel *); > +static int msg_prison_check(void *, void *); > +static int msg_prison_set(void *, void *); > +static int msg_prison_get(void *, void *); > +static int msg_prison_remove(void *, void *); > +static void msg_prison_cleanup(struct prison *); > > > #ifdef MSG_DEBUG > @@ -155,6 +166,7 @@ static struct msgmap *msgmaps; /* MSGSEG > static struct msg *msghdrs; /* MSGTQL msg headers */ > static struct msqid_kernel *msqids; /* MSGMNI msqid_kernel struct's */ > static struct mtx msq_mtx; /* global mutex for message queues. */ > +static unsigned msg_prison_slot;/* prison OSD slot */ > > static struct syscall_helper_data msg_syscalls[] = { > SYSCALL_INIT_HELPER(msgctl), > @@ -194,7 +206,15 @@ static struct syscall_helper_data msg32_ > static int > msginit() > { > + struct prison *pr; > + void *rsv; > int i, error; > + osd_method_t methods[PR_MAXMETHOD] = { > + [PR_METHOD_CHECK] = msg_prison_check, > + [PR_METHOD_SET] = msg_prison_set, > + [PR_METHOD_GET] = msg_prison_get, > + [PR_METHOD_REMOVE] = msg_prison_remove, > + }; > > msginfo.msgmax = msginfo.msgseg * msginfo.msgssz; > msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK); > @@ -252,6 +272,29 @@ msginit() > } > mtx_init(&msq_mtx, "msq", NULL, MTX_DEF); > > + /* Set current prisons according to their allow.sysvipc. */ > + msg_prison_slot = osd_jail_register(NULL, methods); > + rsv = osd_reserve(msg_prison_slot); > + prison_lock(&prison0); > + (void)osd_jail_set_reserved(&prison0, msg_prison_slot, rsv, &prison0); > + prison_unlock(&prison0); > + rsv = NULL; > + sx_slock(&allprison_lock); > + TAILQ_FOREACH(pr, &allprison, pr_list) { > + if (rsv == NULL) > + rsv = osd_reserve(msg_prison_slot); > + prison_lock(pr); > + if ((pr->pr_allow & PR_ALLOW_SYSVIPC) && pr->pr_ref > 0) { > + (void)osd_jail_set_reserved(pr, msg_prison_slot, rsv, > + &prison0); > + rsv = NULL; > + } > + prison_unlock(pr); > + } > + if (rsv != NULL) > + osd_free_reserved(rsv); > + sx_sunlock(&allprison_lock); > + > error = syscall_helper_register(msg_syscalls, SY_THR_STATIC_KLD); > if (error != 0) > return (error); > @@ -292,6 +335,8 @@ msgunload() > if (msqid != msginfo.msgmni) > return (EBUSY); > > + if (msg_prison_slot != 0) > + osd_jail_deregister(msg_prison_slot); > #ifdef MAC > for (i = 0; i < msginfo.msgtql; i++) > mac_sysvmsg_destroy(&msghdrs[i]); > @@ -366,6 +411,67 @@ msg_freehdr(msghdr) > #endif > } > > +static void > +msq_remove(struct msqid_kernel *msqkptr) > +{ > + struct msg *msghdr; > + > + racct_sub_cred(msqkptr->cred, RACCT_NMSGQ, 1); > + racct_sub_cred(msqkptr->cred, RACCT_MSGQQUEUED, msqkptr->u.msg_qnum); > + racct_sub_cred(msqkptr->cred, RACCT_MSGQSIZE, msqkptr->u.msg_cbytes); > + crfree(msqkptr->cred); > + msqkptr->cred = NULL; > + > + /* Free the message headers */ > + msghdr = msqkptr->u.msg_first; > + while (msghdr != NULL) { > + struct msg *msghdr_tmp; > + > + /* Free the segments of each message */ > + msqkptr->u.msg_cbytes -= msghdr->msg_ts; > + msqkptr->u.msg_qnum--; > + msghdr_tmp = msghdr; > + msghdr = msghdr->msg_next; > + msg_freehdr(msghdr_tmp); > + } > + > + if (msqkptr->u.msg_cbytes != 0) > + panic("msg_cbytes is screwed up"); > + if (msqkptr->u.msg_qnum != 0) > + panic("msg_qnum is screwed up"); > + > + msqkptr->u.msg_qbytes = 0; /* Mark it as free */ > + > +#ifdef MAC > + mac_sysvmsq_cleanup(msqkptr); > +#endif > + > + wakeup(msqkptr); > +} > + > +static struct prison * > +msg_find_prison(struct ucred *cred) > +{ > + struct prison *pr, *rpr; > + > + pr = cred->cr_prison; > + prison_lock(pr); > + rpr = osd_jail_get(pr, msg_prison_slot); > + prison_unlock(pr); > + return rpr; > +} > + > +static int > +msq_prison_cansee(struct prison *rpr, struct msqid_kernel *msqkptr) > +{ > + > + if (msqkptr->cred == NULL || > + !(rpr == msqkptr->cred->cr_prison || > + prison_ischild(rpr, msqkptr->cred->cr_prison))) > + return (EINVAL); > + return (0); > +} > + > #ifndef _SYS_SYSPROTO_H_ > struct msgctl_args { > int msqid; > @@ -402,8 +508,10 @@ kern_msgctl(td, msqid, cmd, msqbuf) > { > int rval, error, msqix; > register struct msqid_kernel *msqkptr; > + struct prison *rpr; > > - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) > + rpr = msg_find_prison(td->td_ucred); > + if (rpr == NULL) > return (ENOSYS); > > msqix = IPCID_TO_IX(msqid); > @@ -427,6 +535,13 @@ kern_msgctl(td, msqid, cmd, msqbuf) > error = EINVAL; > goto done2; > } > + > + error = msq_prison_cansee(rpr, msqkptr); > + if (error != 0) { > + DPRINTF(("requester can't see prison\n")); > + goto done2; > + } > + > #ifdef MAC > error = mac_sysvmsq_check_msqctl(td->td_ucred, msqkptr, cmd); > if (error != 0) > @@ -440,7 +555,9 @@ kern_msgctl(td, msqid, cmd, msqbuf) > > case IPC_RMID: > { > +#ifdef MAC > struct msg *msghdr; > +#endif > if ((error = ipcperm(td, &msqkptr->u.msg_perm, IPC_M))) > goto done2; > > @@ -462,37 +579,7 @@ kern_msgctl(td, msqid, cmd, msqbuf) > } > #endif > > - racct_sub_cred(msqkptr->cred, RACCT_NMSGQ, 1); > - racct_sub_cred(msqkptr->cred, RACCT_MSGQQUEUED, msqkptr->u.msg_qnum); > - racct_sub_cred(msqkptr->cred, RACCT_MSGQSIZE, msqkptr->u.msg_cbytes); > - crfree(msqkptr->cred); > - msqkptr->cred = NULL; > - > - /* Free the message headers */ > - msghdr = msqkptr->u.msg_first; > - while (msghdr != NULL) { > - struct msg *msghdr_tmp; > - > - /* Free the segments of each message */ > - msqkptr->u.msg_cbytes -= msghdr->msg_ts; > - msqkptr->u.msg_qnum--; > - msghdr_tmp = msghdr; > - msghdr = msghdr->msg_next; > - msg_freehdr(msghdr_tmp); > - } > - > - if (msqkptr->u.msg_cbytes != 0) > - panic("msg_cbytes is screwed up"); > - if (msqkptr->u.msg_qnum != 0) > - panic("msg_qnum is screwed up"); > - > - msqkptr->u.msg_qbytes = 0; /* Mark it as free */ > - > -#ifdef MAC > - mac_sysvmsq_cleanup(msqkptr); > -#endif > - > - wakeup(msqkptr); > + msq_remove(msqkptr); > } > > break; > @@ -529,6 +616,8 @@ kern_msgctl(td, msqid, cmd, msqbuf) > goto done2; > } > *msqbuf = msqkptr->u; > + if (td->td_ucred->cr_prison != msqkptr->cred->cr_prison) > + msqbuf->msg_perm.key = IPC_PRIVATE; > break; > > default: > @@ -564,7 +653,7 @@ sys_msgget(td, uap) > > DPRINTF(("msgget(0x%x, 0%o)\n", key, msgflg)); > > - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) > + if (msg_find_prison(cred) == NULL) > return (ENOSYS); > > mtx_lock(&msq_mtx); > @@ -572,6 +661,8 @@ sys_msgget(td, uap) > for (msqid = 0; msqid < msginfo.msgmni; msqid++) { > msqkptr = &msqids[msqid]; > if (msqkptr->u.msg_qbytes != 0 && > + msqkptr->cred != NULL && > + msqkptr->cred->cr_prison == cred->cr_prison && > msqkptr->u.msg_perm.key == key) > break; > } > @@ -684,12 +775,14 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgf > int msqix, segs_needed, error = 0; > register struct msqid_kernel *msqkptr; > register struct msg *msghdr; > + struct prison *rpr; > short next; > #ifdef RACCT > size_t saved_msgsz; > #endif > > - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) > + rpr = msg_find_prison(td->td_ucred); > + if (rpr == NULL) > return (ENOSYS); > > mtx_lock(&msq_mtx); > @@ -714,6 +807,11 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgf > goto done2; > } > > + if ((error = msq_prison_cansee(rpr, msqkptr))) { > + DPRINTF(("requester can't see prison\n")); > + goto done2; > + } > + > if ((error = ipcperm(td, &msqkptr->u.msg_perm, IPC_W))) { > DPRINTF(("requester doesn't have write access\n")); > goto done2; > @@ -1052,10 +1150,12 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgt > size_t len; > register struct msqid_kernel *msqkptr; > register struct msg *msghdr; > + struct prison *rpr; > int msqix, error = 0; > short next; > > - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) > + rpr = msg_find_prison(td->td_ucred); > + if (rpr == NULL) > return (ENOSYS); > > msqix = IPCID_TO_IX(msqid); > @@ -1079,6 +1179,11 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgt > goto done2; > } > > + if ((error = msq_prison_cansee(rpr, msqkptr))) { > + DPRINTF(("requester can't see prison\n")); > + goto done2; > + } > + > if ((error = ipcperm(td, &msqkptr->u.msg_perm, IPC_R))) { > DPRINTF(("requester doesn't have read access\n")); > goto done2; > @@ -1318,9 +1423,39 @@ sys_msgrcv(td, uap) > static int > sysctl_msqids(SYSCTL_HANDLER_ARGS) > { > + struct sbuf sb; > + struct msqid_kernel tmp, empty; > + struct msqid_kernel *msqkptr; > + struct prison *rpr; > + int error, i; > + > + error = sysctl_wire_old_buffer(req, 0); > + if (error != 0) > + goto done; > + rpr = msg_find_prison(req->td->td_ucred); > + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct msqid_kernel) * > + msginfo.msgmni, req); > + > + bzero(&empty, sizeof(empty)); > + for (i = 0; i < msginfo.msgmni; i++) { > + msqkptr = &msqids[i]; > + if (msqkptr->u.msg_qbytes == 0 || rpr == NULL || > + msq_prison_cansee(rpr, msqkptr) != 0) { > + msqkptr = ∅ > + } else if (req->td->td_ucred->cr_prison != > + msqkptr->cred->cr_prison) { > + bcopy(msqkptr, &tmp, sizeof(tmp)); > + msqkptr = &tmp; > + msqkptr->u.msg_perm.key = IPC_PRIVATE; > + } > > - return (SYSCTL_OUT(req, msqids, > - sizeof(struct msqid_kernel) * msginfo.msgmni)); > + sbuf_bcat(&sb, msqkptr, sizeof(*msqkptr)); > + } > + error = sbuf_finish(&sb); > + sbuf_delete(&sb); > + > +done: > + return (error); > } > > SYSCTL_INT(_kern_ipc, OID_AUTO, msgmax, CTLFLAG_RD, &msginfo.msgmax, 0, > @@ -1338,6 +1473,181 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, > SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLTYPE_OPAQUE | CTLFLAG_RD, > NULL, 0, sysctl_msqids, "", "Message queue IDs"); > > +static int > +msg_prison_check(void *obj, void *data) > +{ > + struct prison *pr = obj; > + struct prison *prpr; > + struct vfsoptlist *opts = data; > + int error, jsys; > + > + /* > + * sysvmsg is a jailsys integer. > + * It must be "disable" if the parent jail is disabled. > + */ > + error = vfs_copyopt(opts, "sysvmsg", &jsys, sizeof(jsys)); > + if (error != ENOENT) { > + if (error != 0) > + return (error); > + switch (jsys) { > + case JAIL_SYS_DISABLE: > + break; > + case JAIL_SYS_NEW: > + case JAIL_SYS_INHERIT: > + prison_lock(pr->pr_parent); > + prpr = osd_jail_get(pr->pr_parent, msg_prison_slot); > + prison_unlock(pr->pr_parent); > + if (prpr == NULL) > + return (EPERM); > + break; > + default: > + return (EINVAL); > + } > + } > + > + return (0); > +} > + > +static int > +msg_prison_set(void *obj, void *data) > +{ > + struct prison *pr = obj; > + struct prison *tpr, *orpr, *nrpr, *trpr; > + struct vfsoptlist *opts = data; > + void *rsv; > + int jsys, descend; > + > + /* > + * sysvmsg controls which jail is the root of the associated msgs (this > + * jail or same as the parent), or if the feature is available at all. > + */ > + if (vfs_copyopt(opts, "sysvmsg", &jsys, sizeof(jsys)) == ENOENT) > + jsys = vfs_flagopt(opts, "allow.sysvipc", NULL, 0) > + ? JAIL_SYS_INHERIT > + : vfs_flagopt(opts, "allow.nosysvipc", NULL, 0) > + ? JAIL_SYS_DISABLE > + : -1; > + if (jsys == JAIL_SYS_DISABLE) { > + prison_lock(pr); > + orpr = osd_jail_get(pr, msg_prison_slot); > + if (orpr != NULL) > + osd_jail_del(pr, msg_prison_slot); > + prison_unlock(pr); > + if (orpr != NULL) { > + if (orpr == pr) > + msg_prison_cleanup(pr); > + /* Disable all child jails as well. */ > + FOREACH_PRISON_DESCENDANT(pr, tpr, descend) { > + prison_lock(tpr); > + trpr = osd_jail_get(tpr, msg_prison_slot); > + if (trpr != NULL) { > + osd_jail_del(tpr, msg_prison_slot); > + prison_unlock(tpr); > + if (trpr == tpr) > + msg_prison_cleanup(tpr); > + } else { > + prison_unlock(tpr); > + descend = 0; > + } > + } > + } > + } else if (jsys != -1) { > + if (jsys == JAIL_SYS_NEW) > + nrpr = pr; > + else { > + prison_lock(pr->pr_parent); > + nrpr = osd_jail_get(pr->pr_parent, msg_prison_slot); > + prison_unlock(pr->pr_parent); > + } > + rsv = osd_reserve(msg_prison_slot); > + prison_lock(pr); > + orpr = osd_jail_get(pr, msg_prison_slot); > + if (orpr != nrpr) > + (void)osd_jail_set_reserved(pr, msg_prison_slot, rsv, > + nrpr); > + else > + osd_free_reserved(rsv); > + prison_unlock(pr); > + if (orpr != nrpr) { > + if (orpr == pr) > + msg_prison_cleanup(pr); > + if (orpr != NULL) { > + /* Change child jails matching the old root, */ > + FOREACH_PRISON_DESCENDANT(pr, tpr, descend) { > + prison_lock(tpr); > + trpr = osd_jail_get(tpr, > + msg_prison_slot); > + if (trpr == orpr) { > + (void)osd_jail_set(tpr, > + msg_prison_slot, nrpr); > + prison_unlock(tpr); > + if (trpr == tpr) > + msg_prison_cleanup(tpr); > + } else { > + prison_unlock(tpr); > + descend = 0; > + } > + } > + } > + } > + } > + > + return (0); > +} > + > +static int > +msg_prison_get(void *obj, void *data) > +{ > + struct prison *pr = obj; > + struct prison *rpr; > + struct vfsoptlist *opts = data; > + int error, jsys; > + > + /* Set sysvmsg based on the jail's root prison. */ > + prison_lock(pr); > + rpr = osd_jail_get(pr, msg_prison_slot); > + prison_unlock(pr); > + jsys = rpr == NULL ? JAIL_SYS_DISABLE > + : rpr == pr ? JAIL_SYS_NEW : JAIL_SYS_INHERIT; > + error = vfs_setopt(opts, "sysvmsg", &jsys, sizeof(jsys)); > + if (error == ENOENT) > + error = 0; > + return (error); > +} > + > +static int > +msg_prison_remove(void *obj, void *data __unused) > +{ > + struct prison *pr = obj; > + struct prison *rpr; > + > + prison_lock(pr); > + rpr = osd_jail_get(pr, msg_prison_slot); > + prison_unlock(pr); > + if (rpr == pr) > + msg_prison_cleanup(pr); > + return (0); > +} > + > +static void > +msg_prison_cleanup(struct prison *pr) > +{ > + struct msqid_kernel *msqkptr; > + int i; > + > + /* Remove any msqs that belong to this jail. */ > + mtx_lock(&msq_mtx); > + for (i = 0; i < msginfo.msgmni; i++) { > + msqkptr = &msqids[i]; > + if (msqkptr->u.msg_qbytes != 0 && > + msqkptr->cred != NULL && msqkptr->cred->cr_prison == pr) > + msq_remove(msqkptr); > + } > + mtx_unlock(&msq_mtx); > +} > + > +SYSCTL_JAIL_PARAM_SYS_NODE(sysvmsg, CTLFLAG_RW, "SYSV message queues"); > + > #ifdef COMPAT_FREEBSD32 > int > freebsd32_msgsys(struct thread *td, struct freebsd32_msgsys_args *uap) > @@ -1516,8 +1826,6 @@ sys_msgsys(td, uap) > { > int error; > > - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) > - return (ENOSYS); > if (uap->which < 0 || uap->which >= nitems(msgcalls)) > return (EINVAL); > error = (*msgcalls[uap->which])(td, &uap->a2); > > Modified: head/sys/kern/sysv_sem.c > ============================================================================== > --- head/sys/kern/sysv_sem.c Mon Apr 25 17:01:13 2016 (r298584) > +++ head/sys/kern/sysv_sem.c Mon Apr 25 17:06:50 2016 (r298585) > @@ -52,7 +52,9 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > +#include > #include > #include > #include > @@ -78,7 +80,16 @@ static int sysvsem_modload(struct module > static int semunload(void); > static void semexit_myhook(void *arg, struct proc *p); > static int sysctl_sema(SYSCTL_HANDLER_ARGS); > -static int semvalid(int semid, struct semid_kernel *semakptr); > +static int semvalid(int semid, struct prison *rpr, > + struct semid_kernel *semakptr); > +static void sem_remove(int semidx, struct ucred *cred); > +static struct prison *sem_find_prison(struct ucred *); > +static int sem_prison_cansee(struct prison *, struct semid_kernel *); > +static int sem_prison_check(void *, void *); > +static int sem_prison_set(void *, void *); > +static int sem_prison_get(void *, void *); > +static int sem_prison_remove(void *, void *); > +static void sem_prison_cleanup(struct prison *); > > #ifndef _SYS_SYSPROTO_H_ > struct __semctl_args; > @@ -104,6 +115,7 @@ LIST_HEAD(, sem_undo) semu_list; /* list > LIST_HEAD(, sem_undo) semu_free_list; /* list of free undo structures */ > static int *semu; /* undo structure pool */ > static eventhandler_tag semexit_tag; > +static unsigned sem_prison_slot; /* prison OSD slot */ > > #define SEMUNDO_MTX sem_undo_mtx > #define SEMUNDO_LOCK() mtx_lock(&SEMUNDO_MTX); > @@ -247,7 +259,15 @@ static struct syscall_helper_data sem32_ > static int > seminit(void) > { > + struct prison *pr; > + void *rsv; > int i, error; > + osd_method_t methods[PR_MAXMETHOD] = { > + [PR_METHOD_CHECK] = sem_prison_check, > + [PR_METHOD_SET] = sem_prison_set, > + [PR_METHOD_GET] = sem_prison_get, > + [PR_METHOD_REMOVE] = sem_prison_remove, > + }; > > sem = malloc(sizeof(struct sem) * seminfo.semmns, M_SEM, M_WAITOK); > sema = malloc(sizeof(struct semid_kernel) * seminfo.semmni, M_SEM, > @@ -278,6 +298,29 @@ seminit(void) > semexit_tag = EVENTHANDLER_REGISTER(process_exit, semexit_myhook, NULL, > EVENTHANDLER_PRI_ANY); > > + /* Set current prisons according to their allow.sysvipc. */ > + sem_prison_slot = osd_jail_register(NULL, methods); > + rsv = osd_reserve(sem_prison_slot); > + prison_lock(&prison0); > + (void)osd_jail_set_reserved(&prison0, sem_prison_slot, rsv, &prison0); > + prison_unlock(&prison0); > + rsv = NULL; > + sx_slock(&allprison_lock); > + TAILQ_FOREACH(pr, &allprison, pr_list) { > + if (rsv == NULL) > + rsv = osd_reserve(sem_prison_slot); > + prison_lock(pr); > + if ((pr->pr_allow & PR_ALLOW_SYSVIPC) && pr->pr_ref > 0) { > + (void)osd_jail_set_reserved(pr, sem_prison_slot, rsv, > + &prison0); > + rsv = NULL; > + } > + prison_unlock(pr); > + } > + if (rsv != NULL) > + osd_free_reserved(rsv); > + sx_sunlock(&allprison_lock); > + > error = syscall_helper_register(sem_syscalls, SY_THR_STATIC_KLD); > if (error != 0) > return (error); > @@ -303,6 +346,8 @@ semunload(void) > #endif > syscall_helper_unregister(sem_syscalls); > EVENTHANDLER_DEREGISTER(process_exit, semexit_tag); > + if (sem_prison_slot != 0) > + osd_jail_deregister(sem_prison_slot); > #ifdef MAC > for (i = 0; i < seminfo.semmni; i++) > mac_sysvsem_destroy(&sema[i]); > @@ -489,11 +534,74 @@ semundo_clear(int semid, int semnum) > } > > static int > -semvalid(int semid, struct semid_kernel *semakptr) > +semvalid(int semid, struct prison *rpr, struct semid_kernel *semakptr) > { > > return ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || > - semakptr->u.sem_perm.seq != IPCID_TO_SEQ(semid) ? EINVAL : 0); > + semakptr->u.sem_perm.seq != IPCID_TO_SEQ(semid) || > + sem_prison_cansee(rpr, semakptr) ? EINVAL : 0); > +} > + > +static void > +sem_remove(int semidx, struct ucred *cred) > +{ > + struct semid_kernel *semakptr; > + int i; > + > + KASSERT(semidx >= 0 && semidx < seminfo.semmni, > + ("semidx out of bounds")); > + semakptr = &sema[semidx]; > + semakptr->u.sem_perm.cuid = cred ? cred->cr_uid : 0; > + semakptr->u.sem_perm.uid = cred ? cred->cr_uid : 0; > + semakptr->u.sem_perm.mode = 0; > + racct_sub_cred(semakptr->cred, RACCT_NSEM, semakptr->u.sem_nsems); > + crfree(semakptr->cred); > + semakptr->cred = NULL; > + SEMUNDO_LOCK(); > + semundo_clear(semidx, -1); > + SEMUNDO_UNLOCK(); > +#ifdef MAC > + mac_sysvsem_cleanup(semakptr); > +#endif > + wakeup(semakptr); > + for (i = 0; i < seminfo.semmni; i++) { > + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && > + sema[i].u.sem_base > semakptr->u.sem_base) > + mtx_lock_flags(&sema_mtx[i], LOP_DUPOK); > + } > + for (i = semakptr->u.sem_base - sem; i < semtot; i++) > + sem[i] = sem[i + semakptr->u.sem_nsems]; > + for (i = 0; i < seminfo.semmni; i++) { > + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && > + sema[i].u.sem_base > semakptr->u.sem_base) { > + sema[i].u.sem_base -= semakptr->u.sem_nsems; > + mtx_unlock(&sema_mtx[i]); > + } > + } > + semtot -= semakptr->u.sem_nsems; > +} > + > +static struct prison * > +sem_find_prison(struct ucred *cred) > +{ > + struct prison *pr, *rpr; > + > + pr = cred->cr_prison; > + prison_lock(pr); > + rpr = osd_jail_get(pr, sem_prison_slot); > + prison_unlock(pr); > + return rpr; > +} > + > +static int > +sem_prison_cansee(struct prison *rpr, struct semid_kernel *semakptr) > +{ > + > + if (semakptr->cred == NULL || > + !(rpr == semakptr->cred->cr_prison || > + prison_ischild(rpr, semakptr->cred->cr_prison))) > + return (EINVAL); > + return (0); > } > > /* > @@ -572,6 +680,7 @@ kern_semctl(struct thread *td, int semid > u_short *array; > struct ucred *cred = td->td_ucred; > int i, error; > + struct prison *rpr; > struct semid_ds *sbuf; > struct semid_kernel *semakptr; > struct mtx *sema_mtxp; > @@ -580,7 +689,9 @@ kern_semctl(struct thread *td, int semid > > DPRINTF(("call to semctl(%d, %d, %d, 0x%p)\n", > semid, semnum, cmd, arg)); > - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) > + > + rpr = sem_find_prison(td->td_ucred); > + if (sem == NULL) > return (ENOSYS); > > array = NULL; > @@ -600,6 +711,8 @@ kern_semctl(struct thread *td, int semid > error = EINVAL; > goto done2; > } > + if ((error = sem_prison_cansee(rpr, semakptr))) > + goto done2; > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) > goto done2; > #ifdef MAC > @@ -608,6 +721,8 @@ kern_semctl(struct thread *td, int semid > goto done2; > #endif > bcopy(&semakptr->u, arg->buf, sizeof(struct semid_ds)); > + if (cred->cr_prison != semakptr->cred->cr_prison) > + arg->buf->sem_perm.key = IPC_PRIVATE; > *rval = IXSEQ_TO_IPCID(semid, semakptr->u.sem_perm); > mtx_unlock(sema_mtxp); > return (0); > @@ -622,6 +737,7 @@ kern_semctl(struct thread *td, int semid > if (cmd == IPC_RMID) > mtx_lock(&sem_mtx); > mtx_lock(sema_mtxp); > + > #ifdef MAC > error = mac_sysvsem_check_semctl(cred, semakptr, cmd); > if (error != 0) > @@ -633,42 +749,15 @@ kern_semctl(struct thread *td, int semid > > switch (cmd) { > case IPC_RMID: > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_M))) > goto done2; > - semakptr->u.sem_perm.cuid = cred->cr_uid; > - semakptr->u.sem_perm.uid = cred->cr_uid; > - semakptr->u.sem_perm.mode = 0; > - racct_sub_cred(semakptr->cred, RACCT_NSEM, semakptr->u.sem_nsems); > - crfree(semakptr->cred); > - semakptr->cred = NULL; > - SEMUNDO_LOCK(); > - semundo_clear(semidx, -1); > - SEMUNDO_UNLOCK(); > -#ifdef MAC > - mac_sysvsem_cleanup(semakptr); > -#endif > - wakeup(semakptr); > - for (i = 0; i < seminfo.semmni; i++) { > - if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && > - sema[i].u.sem_base > semakptr->u.sem_base) > - mtx_lock_flags(&sema_mtx[i], LOP_DUPOK); > - } > - for (i = semakptr->u.sem_base - sem; i < semtot; i++) > - sem[i] = sem[i + semakptr->u.sem_nsems]; > - for (i = 0; i < seminfo.semmni; i++) { > - if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && > - sema[i].u.sem_base > semakptr->u.sem_base) { > - sema[i].u.sem_base -= semakptr->u.sem_nsems; > - mtx_unlock(&sema_mtx[i]); > - } > - } > - semtot -= semakptr->u.sem_nsems; > + sem_remove(semidx, cred); > break; > > case IPC_SET: > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_M))) > goto done2; > @@ -681,15 +770,17 @@ kern_semctl(struct thread *td, int semid > break; > > case IPC_STAT: > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) > goto done2; > bcopy(&semakptr->u, arg->buf, sizeof(struct semid_ds)); > + if (cred->cr_prison != semakptr->cred->cr_prison) > + arg->buf->sem_perm.key = IPC_PRIVATE; > break; > > case GETNCNT: > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) > goto done2; > @@ -701,7 +792,7 @@ kern_semctl(struct thread *td, int semid > break; > > case GETPID: > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) > goto done2; > @@ -713,7 +804,7 @@ kern_semctl(struct thread *td, int semid > break; > > case GETVAL: > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) > goto done2; > @@ -749,7 +840,7 @@ kern_semctl(struct thread *td, int semid > mtx_unlock(sema_mtxp); > array = malloc(sizeof(*array) * count, M_TEMP, M_WAITOK); > mtx_lock(sema_mtxp); > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > KASSERT(count == semakptr->u.sem_nsems, ("nsems changed")); > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) > @@ -762,7 +853,7 @@ kern_semctl(struct thread *td, int semid > break; > > case GETZCNT: > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_R))) > goto done2; > @@ -774,7 +865,7 @@ kern_semctl(struct thread *td, int semid > break; > > case SETVAL: > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_W))) > goto done2; > @@ -805,7 +896,7 @@ kern_semctl(struct thread *td, int semid > mtx_lock(sema_mtxp); > if (error) > break; > - if ((error = semvalid(semid, semakptr)) != 0) > + if ((error = semvalid(semid, rpr, semakptr)) != 0) > goto done2; > KASSERT(count == semakptr->u.sem_nsems, ("nsems changed")); > if ((error = ipcperm(td, &semakptr->u.sem_perm, IPC_W))) > @@ -855,13 +946,16 @@ sys_semget(struct thread *td, struct sem > struct ucred *cred = td->td_ucred; > > DPRINTF(("semget(0x%x, %d, 0%o)\n", key, nsems, semflg)); > - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) > + > + if (sem_find_prison(cred) == NULL) > return (ENOSYS); > > mtx_lock(&sem_mtx); > if (key != IPC_PRIVATE) { > for (semid = 0; semid < seminfo.semmni; semid++) { > if ((sema[semid].u.sem_perm.mode & SEM_ALLOC) && > + sema[semid].cred != NULL && > + sema[semid].cred->cr_prison == cred->cr_prison && > sema[semid].u.sem_perm.key == key) > break; > } > @@ -978,6 +1072,7 @@ sys_semop(struct thread *td, struct semo > struct sembuf small_sops[SMALL_SOPS]; > int semid = uap->semid; > size_t nsops = uap->nsops; > + struct prison *rpr; > struct sembuf *sops; > struct semid_kernel *semakptr; > struct sembuf *sopptr = NULL; > @@ -994,7 +1089,8 @@ sys_semop(struct thread *td, struct semo > #endif > DPRINTF(("call to semop(%d, %p, %u)\n", semid, sops, nsops)); > > - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) > + rpr = sem_find_prison(td->td_ucred); > + if (sem == NULL) > return (ENOSYS); > > semid = IPCID_TO_IX(semid); /* Convert back to zero origin */ > @@ -1044,6 +1140,8 @@ sys_semop(struct thread *td, struct semo > error = EINVAL; > goto done2; > } > + if ((error = sem_prison_cansee(rpr, semakptr)) != 0) > + goto done2; > /* > * Initial pass thru sops to see what permissions are needed. > * Also perform any checks that don't need repeating on each > @@ -1367,11 +1465,217 @@ semexit_myhook(void *arg, struct proc *p > static int > sysctl_sema(SYSCTL_HANDLER_ARGS) > { > + struct prison *rpr; > + struct sbuf sb; > + struct semid_kernel tmp, empty; > + struct semid_kernel *semakptr; > + int error, i; > + > + error = sysctl_wire_old_buffer(req, 0); > + if (error != 0) > + goto done; > + rpr = sem_find_prison(req->td->td_ucred); > + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct semid_kernel) * > + seminfo.semmni, req); > + > + bzero(&empty, sizeof(empty)); > + for (i = 0; i < seminfo.semmni; i++) { > + semakptr = &sema[i]; > + if ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || > + rpr == NULL || sem_prison_cansee(rpr, semakptr) != 0) { > + semakptr = ∅ > + } else if (req->td->td_ucred->cr_prison != > + semakptr->cred->cr_prison) { > + bcopy(semakptr, &tmp, sizeof(tmp)); > + semakptr = &tmp; > + semakptr->u.sem_perm.key = IPC_PRIVATE; > + } > > - return (SYSCTL_OUT(req, sema, > - sizeof(struct semid_kernel) * seminfo.semmni)); > + sbuf_bcat(&sb, semakptr, sizeof(*semakptr)); > + } > + error = sbuf_finish(&sb); > + sbuf_delete(&sb); > + > +done: > + return (error); > } > > +static int > +sem_prison_check(void *obj, void *data) > +{ > + struct prison *pr = obj; > + struct prison *prpr; > + struct vfsoptlist *opts = data; > + int error, jsys; > + > + /* > + * sysvsem is a jailsys integer. > + * It must be "disable" if the parent jail is disabled. > + */ > + error = vfs_copyopt(opts, "sysvsem", &jsys, sizeof(jsys)); > + if (error != ENOENT) { > + if (error != 0) > + return (error); > + switch (jsys) { > + case JAIL_SYS_DISABLE: > + break; > + case JAIL_SYS_NEW: > + case JAIL_SYS_INHERIT: > + prison_lock(pr->pr_parent); > + prpr = osd_jail_get(pr->pr_parent, sem_prison_slot); > + prison_unlock(pr->pr_parent); > + if (prpr == NULL) > + return (EPERM); > + break; > + default: > + return (EINVAL); > + } > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon Apr 25 20:58:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C050B1C979; Mon, 25 Apr 2016 20:58:55 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0CE7C1ABA; Mon, 25 Apr 2016 20:58:54 +0000 (UTC) (envelope-from gad@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3PKwsS9006299; Mon, 25 Apr 2016 20:58:54 GMT (envelope-from gad@FreeBSD.org) Received: (from gad@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PKws8J006298; Mon, 25 Apr 2016 20:58:54 GMT (envelope-from gad@FreeBSD.org) Message-Id: <201604252058.u3PKws8J006298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gad set sender to gad@FreeBSD.org using -f From: Garance A Drosehn Date: Mon, 25 Apr 2016 20:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298592 - head/usr.sbin/lpr/lpd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 20:58:55 -0000 Author: gad Date: Mon Apr 25 20:58:54 2016 New Revision: 298592 URL: https://svnweb.freebsd.org/changeset/base/298592 Log: Remove a variable and three lines of code which I should have removed as part of revision 98776 back on June 24/2002. Noticed by pfg@ trying coccinelle for checking code. MFC after: 3 weeks Modified: head/usr.sbin/lpr/lpd/lpd.c Modified: head/usr.sbin/lpr/lpd/lpd.c ============================================================================== --- head/usr.sbin/lpr/lpd/lpd.c Mon Apr 25 18:55:01 2016 (r298591) +++ head/usr.sbin/lpr/lpd/lpd.c Mon Apr 25 20:58:54 2016 (r298592) @@ -657,11 +657,7 @@ chkhost(struct sockaddr *f, int ch_opts) char hostbuf[NI_MAXHOST], ip[NI_MAXHOST]; char serv[NI_MAXSERV]; char *syserr, *usererr; - int error, errsav, fpass, good, wantsl; - - wantsl = 0; - if (ch_opts & LPD_LOGCONNERR) - wantsl = 1; /* also syslog the errors */ + int error, errsav, fpass, good; from_host = ".na."; From owner-svn-src-head@freebsd.org Mon Apr 25 21:14:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D7FDB1CDDC; Mon, 25 Apr 2016 21:14:33 +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 752C3143E; Mon, 25 Apr 2016 21:14:33 +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 u3PLEWee012124; Mon, 25 Apr 2016 21:14:32 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PLEWuQ012120; Mon, 25 Apr 2016 21:14:32 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604252114.u3PLEWuQ012120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 25 Apr 2016 21:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298593 - head/sys/dev/random X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 21:14:33 -0000 Author: pfg Date: Mon Apr 25 21:14:32 2016 New Revision: 298593 URL: https://svnweb.freebsd.org/changeset/base/298593 Log: dev/random: use our roundup() macro instead of re-implementing it. While here also use howmany() macro from sys/param.h No functional change. Reviewed by: markm (roundup replacement part) Approved by: so Modified: head/sys/dev/random/fortuna.c head/sys/dev/random/randomdev.c head/sys/dev/random/yarrow.c Modified: head/sys/dev/random/fortuna.c ============================================================================== --- head/sys/dev/random/fortuna.c Mon Apr 25 20:58:54 2016 (r298592) +++ head/sys/dev/random/fortuna.c Mon Apr 25 21:14:32 2016 (r298593) @@ -324,7 +324,7 @@ random_fortuna_genrandom(uint8_t *buf, u * - K = GenerateBlocks(2) */ KASSERT((bytecount <= RANDOM_FORTUNA_MAX_READ), ("invalid single read request to Fortuna of %d bytes", bytecount)); - blockcount = (bytecount + RANDOM_BLOCKSIZE - 1)/RANDOM_BLOCKSIZE; + blockcount = howmany(bytecount, RANDOM_BLOCKSIZE); random_fortuna_genblocks(buf, blockcount); random_fortuna_genblocks(temp, RANDOM_KEYS_PER_BLOCK); randomdev_encrypt_init(&fortuna_state.fs_key, temp); Modified: head/sys/dev/random/randomdev.c ============================================================================== --- head/sys/dev/random/randomdev.c Mon Apr 25 20:58:54 2016 (r298592) +++ head/sys/dev/random/randomdev.c Mon Apr 25 21:14:32 2016 (r298593) @@ -68,9 +68,6 @@ static u_int READ_RANDOM(void *, u_int); #define READ_RANDOM read_random #endif -/* Return the largest number >= x that is a multiple of m */ -#define CEIL_TO_MULTIPLE(x, m) ((((x) + (m) - 1)/(m))*(m)) - static d_read_t randomdev_read; static d_write_t randomdev_write; static d_poll_t randomdev_poll; @@ -164,7 +161,7 @@ READ_RANDOM_UIO(struct uio *uio, bool no * which is what the underlying generator is expecting. * See the random_buf size requirements in the Yarrow/Fortuna code. */ - read_len = CEIL_TO_MULTIPLE(read_len, RANDOM_BLOCKSIZE); + read_len = roundup(read_len, RANDOM_BLOCKSIZE); /* Work in chunks page-sized or less */ read_len = MIN(read_len, PAGE_SIZE); p_random_alg_context->ra_read(random_buf, read_len); @@ -204,7 +201,7 @@ READ_RANDOM(void *random_buf, u_int len) * Round up the read length to a crypto block size multiple, * which is what the underlying generator is expecting. */ - read_len = CEIL_TO_MULTIPLE(len, RANDOM_BLOCKSIZE); + read_len = roundup(len, RANDOM_BLOCKSIZE); p_random_alg_context->ra_read(local_buf, read_len); memcpy(random_buf, local_buf, len); } Modified: head/sys/dev/random/yarrow.c ============================================================================== --- head/sys/dev/random/yarrow.c Mon Apr 25 20:58:54 2016 (r298592) +++ head/sys/dev/random/yarrow.c Mon Apr 25 21:14:32 2016 (r298593) @@ -374,7 +374,7 @@ random_yarrow_read(uint8_t *buf, u_int b KASSERT((bytecount % RANDOM_BLOCKSIZE) == 0, ("%s(): bytecount (= %d) must be a multiple of %d", __func__, bytecount, RANDOM_BLOCKSIZE )); RANDOM_RESEED_LOCK(); - blockcount = (bytecount + RANDOM_BLOCKSIZE - 1)/RANDOM_BLOCKSIZE; + blockcount = howmany(bytecount, RANDOM_BLOCKSIZE); for (i = 0; i < blockcount; i++) { if (yarrow_state.ys_outputblocks++ >= yarrow_state.ys_gengateinterval) { random_yarrow_generator_gate(); From owner-svn-src-head@freebsd.org Mon Apr 25 21:46:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37643B1C563 for ; Mon, 25 Apr 2016 21:46:21 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm5-vm0.bullet.mail.bf1.yahoo.com (nm5-vm0.bullet.mail.bf1.yahoo.com [98.139.213.150]) (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 D5A3B1479 for ; Mon, 25 Apr 2016 21:46:20 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461620023; bh=Eyp8boEAZftAHl+5RdvoSqkfTHm7krwp6C8fwLnSv4A=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=rz09Bfnvj0ngJvQXo+s/u/byGMC2Y6/PeufkF4YzlXj/z6QZ4fYdgECpwInSTgEb+M9PIWK4EwwQBehvDmtnTO8oLyEWUxMsELnq4tmGtYCBVOT5Yaxi4yjkuafQmR0Mqo2mqFWuuJUUWzt496ir+FA8ADwv441HlTr67q6jghe6KGsatzxO+UyTQj4oQNxY9bBdzcm7A/gLgN1lTJ8nLD9JaTFENULUQ/JBdGJbtqa8nAhGi5+47XM/UBzJbwOTy03YGrxwzvEgwsXAKN7v+T2vuB2TmgVHM5/7zU95Ty6SfEzD6AQc+q9ZAvthjXWfS4Sy6kbMvMuUXa5v6beudA== Received: from [66.196.81.174] by nm5.bullet.mail.bf1.yahoo.com with NNFMP; 25 Apr 2016 21:33:43 -0000 Received: from [98.139.211.162] by tm20.bullet.mail.bf1.yahoo.com with NNFMP; 25 Apr 2016 21:33:43 -0000 Received: from [127.0.0.1] by smtp219.mail.bf1.yahoo.com with NNFMP; 25 Apr 2016 21:33:43 -0000 X-Yahoo-Newman-Id: 109302.22517.bm@smtp219.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: cljyrr8VM1lbhmQgX33noSconH1Bmkz..xf5sdQ0hCz3NFS Ekji8TZnWMDEBDkuRBAOS6.hINrOI9qi5JBNiTVwD._CpWYh0qRnVxnm2mD_ BNArG_U0bt9_3DZCzEkoPciri1JoCxlezn3akr8uJUu.RN73JAiOrTYS9VC7 500mhepzkXephwAqDy1pam4vQQ6x1t.ynnqiMadntONAi2A1Zi9sFgysXyA6 nrKCssWXCWwFBX6OJhTjjp8rfYfScXCJIj1kITCKpajiy6FBebv.rUc1H0Oj 5KFof5KWouTik8O9Ta91MdHfErfzdIAo111ICRbglXhvW40QFnEfnefzG2ku faZBMeDUQj2_qkEj0u90ppJhUitl.4iL5hVqC0JL_dTFa3tL1Z5hHpbNlnSn UlO463o6zPK8t6CbVwZfjEdhXlnQ_AS3OEkRh7fC9oX9u5k5yG79w0c3b.1G DHhLpagLMhW2Bi5nz0pc6gp5VpIxu84aZtd1ycybTMqC1N8fq1aTxm_VDaz. wuTIzdTUOjQ3N7BV2KPIzFs2EhCfhxg56 X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: HEADS UP: I will revert this. (was Re: svn commit: r298443 - head/usr.bin/stat) To: Marcelo Araujo References: <201604220343.u3M3h69m058753@repo.freebsd.org> Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <69810c2f-ee32-5d7b-8367-689b2afb0d97@FreeBSD.org> Date: Mon, 25 Apr 2016 16:33:55 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 21:46:21 -0000 Hi Marcelo; Hi; I assume you have been very busy. I will revert this in a couple of hours unless you either explain or revert it yourself. Pedro. On 04/23/16 04:23, luke wrote: > On Fri, Apr 22, 2016 at 11:43 AM, Marcelo Araujo > wrote: > > Author: araujo > Date: Fri Apr 22 03:43:06 2016 > New Revision: 298443 > URL: https://svnweb.freebsd.org/changeset/base/298443 > > Log: > Use macro MAX() from sys/param.h. > > MFC after: 2 weeks. > > Modified: > head/usr.bin/stat/stat.c > > Modified: head/usr.bin/stat/stat.c > ============================================================================== > --- head/usr.bin/stat/stat.c Fri Apr 22 03:37:27 2016 > (r298442) > +++ head/usr.bin/stat/stat.c Fri Apr 22 03:43:06 2016 > (r298443) > @@ -1025,7 +1025,7 @@ format1(const struct stat *st, > * > * Nanoseconds: long. > */ > - (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ? > 9 : prec); > + (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec)); > (void)strcat(lfmt, tmp); > > /* > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to > "svn-src-head-unsubscribe@freebsd.org > " > > > > Hi, > > Should this be MIN() ? > > (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9)); > > > -- > Chang-Hsien Tsai > From owner-svn-src-head@freebsd.org Mon Apr 25 22:00:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D34EDB1C81E; Mon, 25 Apr 2016 22:00:06 +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 9E9621AC2; Mon, 25 Apr 2016 22:00:06 +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 u3PM05C3024663; Mon, 25 Apr 2016 22:00:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PM058W024662; Mon, 25 Apr 2016 22:00:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604252200.u3PM058W024662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 25 Apr 2016 22:00:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298594 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 22:00:06 -0000 Author: adrian Date: Mon Apr 25 22:00:05 2016 New Revision: 298594 URL: https://svnweb.freebsd.org/changeset/base/298594 Log: [iwm] restart the VAP if there's a firmware panic. Always print out the firmware panic info before restarting; don't put it behind IWM_DEBUG. Submitted by: bapt Differential Revision: https://reviews.freebsd.org/D6081 Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Mon Apr 25 21:14:32 2016 (r298593) +++ head/sys/dev/iwm/if_iwm.c Mon Apr 25 22:00:05 2016 (r298594) @@ -4344,7 +4344,6 @@ iwm_intr(void *arg) handled |= (r1 & (IWM_CSR_INT_BIT_ALIVE /*| IWM_CSR_INT_BIT_SCD*/)); if (r1 & IWM_CSR_INT_BIT_SW_ERR) { -#ifdef IWM_DEBUG int i; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); @@ -4364,13 +4363,21 @@ iwm_intr(void *arg) " rx ring: cur=%d\n", sc->rxq.cur); device_printf(sc->sc_dev, " 802.11 state %d\n", vap->iv_state); -#endif - device_printf(sc->sc_dev, "fatal firmware error\n"); - iwm_stop(sc); - rv = 1; - goto out; + /* Don't stop the device; just do a VAP restart */ + IWM_UNLOCK(sc); + + if (vap == NULL) { + printf("%s: null vap\n", __func__); + return; + } + device_printf(sc->sc_dev, "%s: controller panicked, iv_state = %d; " + "restarting\n", __func__, vap->iv_state); + + /* XXX TODO: turn this into a callout/taskqueue */ + ieee80211_restart_all(ic); + return; } if (r1 & IWM_CSR_INT_BIT_HW_ERR) { From owner-svn-src-head@freebsd.org Mon Apr 25 22:22:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 062CEB1CDDD; Mon, 25 Apr 2016 22:22:30 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [162.220.209.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "www.gritton.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E1D801776; Mon, 25 Apr 2016 22:22:29 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [162.220.209.3]) by gritton.org (8.15.2/8.15.2) with ESMTPS id u3PMMMHI029110 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 25 Apr 2016 16:22:23 -0600 (MDT) (envelope-from jamie@freebsd.org) Received: (from www@localhost) by gritton.org (8.15.2/8.15.2/Submit) id u3PMMMtM029109; Mon, 25 Apr 2016 16:22:22 -0600 (MDT) (envelope-from jamie@freebsd.org) X-Authentication-Warning: gritton.org: www set sender to jamie@freebsd.org using -f To: Subbsd Subject: Re: svn commit: r298585 - in head: sys/kern usr.sbin/jail X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 25 Apr 2016 16:22:22 -0600 From: James Gritton Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: References: <201604251706.u3PH6okj031018@repo.freebsd.org> Message-ID: <5a7428bcd2767e3fd3b8e2c16828e3f1@gritton.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.1.2 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 22:22:30 -0000 That's a big oops on my part - msg and sem had nearly identical logic, but I got it backwards on shm. I'll put a fix in shortly. - Jamie On 2016-04-25 14:28, Subbsd wrote: > I do not know how it works for/in jails, but looks like this breaks > work SHM in host. I've got on any QT-based application after this > commit: > > EP Get failed: 'Feature not implemented. > The feature requested is not implemented by the recipient or server > and therefore cannot be processed.' (501)" > [23:05:55] W:QNativeImage: Unable to attach to shared memory segment. > Segmentation fault (core dumped) > > > and tracing stops on: > shmget(0x0,0x634e0,0x3c0) = 65580 (0x1002c) > shmat(0x1002c,0x0,0x0) ERR#22 'Invalid > argument' > > On Mon, Apr 25, 2016 at 8:06 PM, Jamie Gritton > wrote: >> Author: jamie >> Date: Mon Apr 25 17:06:50 2016 >> New Revision: 298585 >> URL: https://svnweb.freebsd.org/changeset/base/298585 >> >> Log: >> Encapsulate SYSV IPC objects in jails. Define per-module parameters >> sysvmsg, sysvsem, and sysvshm, with the following bahavior: >> >> inherit: allow full access to the IPC primitives. This is the same >> as >> the current setup with allow.sysvipc is on. Jails and the base >> system >> can see (and moduly) each other's objects, which is generally >> considered >> a bad thing (though may be useful in some circumstances). >> >> disable: all no access, same as the current setup with allow.sysvipc >> off. >> >> new: A jail may see use the IPC objects that it has created. It >> also >> gets its own IPC key namespace, so different jails may have their >> own >> objects using the same key value. The parent jail (or base system) >> can >> see the jail's IPC objects, but not its keys. >> >> PR: 48471 >> Submitted by: based on work by kikuchan98@gmail.com >> MFC after: 5 days >> >> Modified: >> head/sys/kern/sysv_msg.c >> head/sys/kern/sysv_sem.c >> head/sys/kern/sysv_shm.c >> head/usr.sbin/jail/jail.8 >> >> Modified: head/sys/kern/sysv_msg.c >> ============================================================================== >> --- head/sys/kern/sysv_msg.c Mon Apr 25 17:01:13 2016 >> (r298584) >> +++ head/sys/kern/sysv_msg.c Mon Apr 25 17:06:50 2016 >> (r298585) >> @@ -62,8 +62,11 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> #include >> +#include >> +#include >> #include >> #include >> #include >> @@ -80,6 +83,14 @@ static MALLOC_DEFINE(M_MSG, "msg", "SVID >> static int msginit(void); >> static int msgunload(void); >> static int sysvmsg_modload(struct module *, int, void *); >> +static void msq_remove(struct msqid_kernel *); >> +static struct prison *msg_find_prison(struct ucred *); >> +static int msq_prison_cansee(struct prison *, struct msqid_kernel *); >> +static int msg_prison_check(void *, void *); >> +static int msg_prison_set(void *, void *); >> +static int msg_prison_get(void *, void *); >> +static int msg_prison_remove(void *, void *); >> +static void msg_prison_cleanup(struct prison *); >> >> >> #ifdef MSG_DEBUG >> @@ -155,6 +166,7 @@ static struct msgmap *msgmaps; /* MSGSEG >> static struct msg *msghdrs; /* MSGTQL msg headers */ >> static struct msqid_kernel *msqids; /* MSGMNI msqid_kernel >> struct's */ >> static struct mtx msq_mtx; /* global mutex for message queues. */ >> +static unsigned msg_prison_slot;/* prison OSD slot */ >> >> static struct syscall_helper_data msg_syscalls[] = { >> SYSCALL_INIT_HELPER(msgctl), >> @@ -194,7 +206,15 @@ static struct syscall_helper_data msg32_ >> static int >> msginit() >> { >> + struct prison *pr; >> + void *rsv; >> int i, error; >> + osd_method_t methods[PR_MAXMETHOD] = { >> + [PR_METHOD_CHECK] = msg_prison_check, >> + [PR_METHOD_SET] = msg_prison_set, >> + [PR_METHOD_GET] = msg_prison_get, >> + [PR_METHOD_REMOVE] = msg_prison_remove, >> + }; >> >> msginfo.msgmax = msginfo.msgseg * msginfo.msgssz; >> msgpool = malloc(msginfo.msgmax, M_MSG, M_WAITOK); >> @@ -252,6 +272,29 @@ msginit() >> } >> mtx_init(&msq_mtx, "msq", NULL, MTX_DEF); >> >> + /* Set current prisons according to their allow.sysvipc. */ >> + msg_prison_slot = osd_jail_register(NULL, methods); >> + rsv = osd_reserve(msg_prison_slot); >> + prison_lock(&prison0); >> + (void)osd_jail_set_reserved(&prison0, msg_prison_slot, rsv, >> &prison0); >> + prison_unlock(&prison0); >> + rsv = NULL; >> + sx_slock(&allprison_lock); >> + TAILQ_FOREACH(pr, &allprison, pr_list) { >> + if (rsv == NULL) >> + rsv = osd_reserve(msg_prison_slot); >> + prison_lock(pr); >> + if ((pr->pr_allow & PR_ALLOW_SYSVIPC) && pr->pr_ref > >> 0) { >> + (void)osd_jail_set_reserved(pr, >> msg_prison_slot, rsv, >> + &prison0); >> + rsv = NULL; >> + } >> + prison_unlock(pr); >> + } >> + if (rsv != NULL) >> + osd_free_reserved(rsv); >> + sx_sunlock(&allprison_lock); >> + >> error = syscall_helper_register(msg_syscalls, >> SY_THR_STATIC_KLD); >> if (error != 0) >> return (error); >> @@ -292,6 +335,8 @@ msgunload() >> if (msqid != msginfo.msgmni) >> return (EBUSY); >> >> + if (msg_prison_slot != 0) >> + osd_jail_deregister(msg_prison_slot); >> #ifdef MAC >> for (i = 0; i < msginfo.msgtql; i++) >> mac_sysvmsg_destroy(&msghdrs[i]); >> @@ -366,6 +411,67 @@ msg_freehdr(msghdr) >> #endif >> } >> >> +static void >> +msq_remove(struct msqid_kernel *msqkptr) >> +{ >> + struct msg *msghdr; >> + >> + racct_sub_cred(msqkptr->cred, RACCT_NMSGQ, 1); >> + racct_sub_cred(msqkptr->cred, RACCT_MSGQQUEUED, >> msqkptr->u.msg_qnum); >> + racct_sub_cred(msqkptr->cred, RACCT_MSGQSIZE, >> msqkptr->u.msg_cbytes); >> + crfree(msqkptr->cred); >> + msqkptr->cred = NULL; >> + >> + /* Free the message headers */ >> + msghdr = msqkptr->u.msg_first; >> + while (msghdr != NULL) { >> + struct msg *msghdr_tmp; >> + >> + /* Free the segments of each message */ >> + msqkptr->u.msg_cbytes -= msghdr->msg_ts; >> + msqkptr->u.msg_qnum--; >> + msghdr_tmp = msghdr; >> + msghdr = msghdr->msg_next; >> + msg_freehdr(msghdr_tmp); >> + } >> + >> + if (msqkptr->u.msg_cbytes != 0) >> + panic("msg_cbytes is screwed up"); >> + if (msqkptr->u.msg_qnum != 0) >> + panic("msg_qnum is screwed up"); >> + >> + msqkptr->u.msg_qbytes = 0; /* Mark it as free */ >> + >> +#ifdef MAC >> + mac_sysvmsq_cleanup(msqkptr); >> +#endif >> + >> + wakeup(msqkptr); >> +} >> + >> +static struct prison * >> +msg_find_prison(struct ucred *cred) >> +{ >> + struct prison *pr, *rpr; >> + >> + pr = cred->cr_prison; >> + prison_lock(pr); >> + rpr = osd_jail_get(pr, msg_prison_slot); >> + prison_unlock(pr); >> + return rpr; >> +} >> + >> +static int >> +msq_prison_cansee(struct prison *rpr, struct msqid_kernel *msqkptr) >> +{ >> + >> + if (msqkptr->cred == NULL || >> + !(rpr == msqkptr->cred->cr_prison || >> + prison_ischild(rpr, msqkptr->cred->cr_prison))) >> + return (EINVAL); >> + return (0); >> +} >> + >> #ifndef _SYS_SYSPROTO_H_ >> struct msgctl_args { >> int msqid; >> @@ -402,8 +508,10 @@ kern_msgctl(td, msqid, cmd, msqbuf) >> { >> int rval, error, msqix; >> register struct msqid_kernel *msqkptr; >> + struct prison *rpr; >> >> - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) >> + rpr = msg_find_prison(td->td_ucred); >> + if (rpr == NULL) >> return (ENOSYS); >> >> msqix = IPCID_TO_IX(msqid); >> @@ -427,6 +535,13 @@ kern_msgctl(td, msqid, cmd, msqbuf) >> error = EINVAL; >> goto done2; >> } >> + >> + error = msq_prison_cansee(rpr, msqkptr); >> + if (error != 0) { >> + DPRINTF(("requester can't see prison\n")); >> + goto done2; >> + } >> + >> #ifdef MAC >> error = mac_sysvmsq_check_msqctl(td->td_ucred, msqkptr, cmd); >> if (error != 0) >> @@ -440,7 +555,9 @@ kern_msgctl(td, msqid, cmd, msqbuf) >> >> case IPC_RMID: >> { >> +#ifdef MAC >> struct msg *msghdr; >> +#endif >> if ((error = ipcperm(td, &msqkptr->u.msg_perm, >> IPC_M))) >> goto done2; >> >> @@ -462,37 +579,7 @@ kern_msgctl(td, msqid, cmd, msqbuf) >> } >> #endif >> >> - racct_sub_cred(msqkptr->cred, RACCT_NMSGQ, 1); >> - racct_sub_cred(msqkptr->cred, RACCT_MSGQQUEUED, >> msqkptr->u.msg_qnum); >> - racct_sub_cred(msqkptr->cred, RACCT_MSGQSIZE, >> msqkptr->u.msg_cbytes); >> - crfree(msqkptr->cred); >> - msqkptr->cred = NULL; >> - >> - /* Free the message headers */ >> - msghdr = msqkptr->u.msg_first; >> - while (msghdr != NULL) { >> - struct msg *msghdr_tmp; >> - >> - /* Free the segments of each message */ >> - msqkptr->u.msg_cbytes -= msghdr->msg_ts; >> - msqkptr->u.msg_qnum--; >> - msghdr_tmp = msghdr; >> - msghdr = msghdr->msg_next; >> - msg_freehdr(msghdr_tmp); >> - } >> - >> - if (msqkptr->u.msg_cbytes != 0) >> - panic("msg_cbytes is screwed up"); >> - if (msqkptr->u.msg_qnum != 0) >> - panic("msg_qnum is screwed up"); >> - >> - msqkptr->u.msg_qbytes = 0; /* Mark it as free */ >> - >> -#ifdef MAC >> - mac_sysvmsq_cleanup(msqkptr); >> -#endif >> - >> - wakeup(msqkptr); >> + msq_remove(msqkptr); >> } >> >> break; >> @@ -529,6 +616,8 @@ kern_msgctl(td, msqid, cmd, msqbuf) >> goto done2; >> } >> *msqbuf = msqkptr->u; >> + if (td->td_ucred->cr_prison != >> msqkptr->cred->cr_prison) >> + msqbuf->msg_perm.key = IPC_PRIVATE; >> break; >> >> default: >> @@ -564,7 +653,7 @@ sys_msgget(td, uap) >> >> DPRINTF(("msgget(0x%x, 0%o)\n", key, msgflg)); >> >> - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) >> + if (msg_find_prison(cred) == NULL) >> return (ENOSYS); >> >> mtx_lock(&msq_mtx); >> @@ -572,6 +661,8 @@ sys_msgget(td, uap) >> for (msqid = 0; msqid < msginfo.msgmni; msqid++) { >> msqkptr = &msqids[msqid]; >> if (msqkptr->u.msg_qbytes != 0 && >> + msqkptr->cred != NULL && >> + msqkptr->cred->cr_prison == >> cred->cr_prison && >> msqkptr->u.msg_perm.key == key) >> break; >> } >> @@ -684,12 +775,14 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgf >> int msqix, segs_needed, error = 0; >> register struct msqid_kernel *msqkptr; >> register struct msg *msghdr; >> + struct prison *rpr; >> short next; >> #ifdef RACCT >> size_t saved_msgsz; >> #endif >> >> - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) >> + rpr = msg_find_prison(td->td_ucred); >> + if (rpr == NULL) >> return (ENOSYS); >> >> mtx_lock(&msq_mtx); >> @@ -714,6 +807,11 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgf >> goto done2; >> } >> >> + if ((error = msq_prison_cansee(rpr, msqkptr))) { >> + DPRINTF(("requester can't see prison\n")); >> + goto done2; >> + } >> + >> if ((error = ipcperm(td, &msqkptr->u.msg_perm, IPC_W))) { >> DPRINTF(("requester doesn't have write access\n")); >> goto done2; >> @@ -1052,10 +1150,12 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgt >> size_t len; >> register struct msqid_kernel *msqkptr; >> register struct msg *msghdr; >> + struct prison *rpr; >> int msqix, error = 0; >> short next; >> >> - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) >> + rpr = msg_find_prison(td->td_ucred); >> + if (rpr == NULL) >> return (ENOSYS); >> >> msqix = IPCID_TO_IX(msqid); >> @@ -1079,6 +1179,11 @@ kern_msgrcv(td, msqid, msgp, msgsz, msgt >> goto done2; >> } >> >> + if ((error = msq_prison_cansee(rpr, msqkptr))) { >> + DPRINTF(("requester can't see prison\n")); >> + goto done2; >> + } >> + >> if ((error = ipcperm(td, &msqkptr->u.msg_perm, IPC_R))) { >> DPRINTF(("requester doesn't have read access\n")); >> goto done2; >> @@ -1318,9 +1423,39 @@ sys_msgrcv(td, uap) >> static int >> sysctl_msqids(SYSCTL_HANDLER_ARGS) >> { >> + struct sbuf sb; >> + struct msqid_kernel tmp, empty; >> + struct msqid_kernel *msqkptr; >> + struct prison *rpr; >> + int error, i; >> + >> + error = sysctl_wire_old_buffer(req, 0); >> + if (error != 0) >> + goto done; >> + rpr = msg_find_prison(req->td->td_ucred); >> + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct msqid_kernel) * >> + msginfo.msgmni, req); >> + >> + bzero(&empty, sizeof(empty)); >> + for (i = 0; i < msginfo.msgmni; i++) { >> + msqkptr = &msqids[i]; >> + if (msqkptr->u.msg_qbytes == 0 || rpr == NULL || >> + msq_prison_cansee(rpr, msqkptr) != 0) { >> + msqkptr = ∅ >> + } else if (req->td->td_ucred->cr_prison != >> + msqkptr->cred->cr_prison) { >> + bcopy(msqkptr, &tmp, sizeof(tmp)); >> + msqkptr = &tmp; >> + msqkptr->u.msg_perm.key = IPC_PRIVATE; >> + } >> >> - return (SYSCTL_OUT(req, msqids, >> - sizeof(struct msqid_kernel) * msginfo.msgmni)); >> + sbuf_bcat(&sb, msqkptr, sizeof(*msqkptr)); >> + } >> + error = sbuf_finish(&sb); >> + sbuf_delete(&sb); >> + >> +done: >> + return (error); >> } >> >> SYSCTL_INT(_kern_ipc, OID_AUTO, msgmax, CTLFLAG_RD, &msginfo.msgmax, >> 0, >> @@ -1338,6 +1473,181 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, >> SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLTYPE_OPAQUE | CTLFLAG_RD, >> NULL, 0, sysctl_msqids, "", "Message queue IDs"); >> >> +static int >> +msg_prison_check(void *obj, void *data) >> +{ >> + struct prison *pr = obj; >> + struct prison *prpr; >> + struct vfsoptlist *opts = data; >> + int error, jsys; >> + >> + /* >> + * sysvmsg is a jailsys integer. >> + * It must be "disable" if the parent jail is disabled. >> + */ >> + error = vfs_copyopt(opts, "sysvmsg", &jsys, sizeof(jsys)); >> + if (error != ENOENT) { >> + if (error != 0) >> + return (error); >> + switch (jsys) { >> + case JAIL_SYS_DISABLE: >> + break; >> + case JAIL_SYS_NEW: >> + case JAIL_SYS_INHERIT: >> + prison_lock(pr->pr_parent); >> + prpr = osd_jail_get(pr->pr_parent, >> msg_prison_slot); >> + prison_unlock(pr->pr_parent); >> + if (prpr == NULL) >> + return (EPERM); >> + break; >> + default: >> + return (EINVAL); >> + } >> + } >> + >> + return (0); >> +} >> + >> +static int >> +msg_prison_set(void *obj, void *data) >> +{ >> + struct prison *pr = obj; >> + struct prison *tpr, *orpr, *nrpr, *trpr; >> + struct vfsoptlist *opts = data; >> + void *rsv; >> + int jsys, descend; >> + >> + /* >> + * sysvmsg controls which jail is the root of the associated >> msgs (this >> + * jail or same as the parent), or if the feature is available >> at all. >> + */ >> + if (vfs_copyopt(opts, "sysvmsg", &jsys, sizeof(jsys)) == >> ENOENT) >> + jsys = vfs_flagopt(opts, "allow.sysvipc", NULL, 0) >> + ? JAIL_SYS_INHERIT >> + : vfs_flagopt(opts, "allow.nosysvipc", NULL, 0) >> + ? JAIL_SYS_DISABLE >> + : -1; >> + if (jsys == JAIL_SYS_DISABLE) { >> + prison_lock(pr); >> + orpr = osd_jail_get(pr, msg_prison_slot); >> + if (orpr != NULL) >> + osd_jail_del(pr, msg_prison_slot); >> + prison_unlock(pr); >> + if (orpr != NULL) { >> + if (orpr == pr) >> + msg_prison_cleanup(pr); >> + /* Disable all child jails as well. */ >> + FOREACH_PRISON_DESCENDANT(pr, tpr, descend) { >> + prison_lock(tpr); >> + trpr = osd_jail_get(tpr, >> msg_prison_slot); >> + if (trpr != NULL) { >> + osd_jail_del(tpr, >> msg_prison_slot); >> + prison_unlock(tpr); >> + if (trpr == tpr) >> + >> msg_prison_cleanup(tpr); >> + } else { >> + prison_unlock(tpr); >> + descend = 0; >> + } >> + } >> + } >> + } else if (jsys != -1) { >> + if (jsys == JAIL_SYS_NEW) >> + nrpr = pr; >> + else { >> + prison_lock(pr->pr_parent); >> + nrpr = osd_jail_get(pr->pr_parent, >> msg_prison_slot); >> + prison_unlock(pr->pr_parent); >> + } >> + rsv = osd_reserve(msg_prison_slot); >> + prison_lock(pr); >> + orpr = osd_jail_get(pr, msg_prison_slot); >> + if (orpr != nrpr) >> + (void)osd_jail_set_reserved(pr, >> msg_prison_slot, rsv, >> + nrpr); >> + else >> + osd_free_reserved(rsv); >> + prison_unlock(pr); >> + if (orpr != nrpr) { >> + if (orpr == pr) >> + msg_prison_cleanup(pr); >> + if (orpr != NULL) { >> + /* Change child jails matching the old >> root, */ >> + FOREACH_PRISON_DESCENDANT(pr, tpr, >> descend) { >> + prison_lock(tpr); >> + trpr = osd_jail_get(tpr, >> + msg_prison_slot); >> + if (trpr == orpr) { >> + >> (void)osd_jail_set(tpr, >> + msg_prison_slot, >> nrpr); >> + prison_unlock(tpr); >> + if (trpr == tpr) >> + >> msg_prison_cleanup(tpr); >> + } else { >> + prison_unlock(tpr); >> + descend = 0; >> + } >> + } >> + } >> + } >> + } >> + >> + return (0); >> +} >> + >> +static int >> +msg_prison_get(void *obj, void *data) >> +{ >> + struct prison *pr = obj; >> + struct prison *rpr; >> + struct vfsoptlist *opts = data; >> + int error, jsys; >> + >> + /* Set sysvmsg based on the jail's root prison. */ >> + prison_lock(pr); >> + rpr = osd_jail_get(pr, msg_prison_slot); >> + prison_unlock(pr); >> + jsys = rpr == NULL ? JAIL_SYS_DISABLE >> + : rpr == pr ? JAIL_SYS_NEW : JAIL_SYS_INHERIT; >> + error = vfs_setopt(opts, "sysvmsg", &jsys, sizeof(jsys)); >> + if (error == ENOENT) >> + error = 0; >> + return (error); >> +} >> + >> +static int >> +msg_prison_remove(void *obj, void *data __unused) >> +{ >> + struct prison *pr = obj; >> + struct prison *rpr; >> + >> + prison_lock(pr); >> + rpr = osd_jail_get(pr, msg_prison_slot); >> + prison_unlock(pr); >> + if (rpr == pr) >> + msg_prison_cleanup(pr); >> + return (0); >> +} >> + >> +static void >> +msg_prison_cleanup(struct prison *pr) >> +{ >> + struct msqid_kernel *msqkptr; >> + int i; >> + >> + /* Remove any msqs that belong to this jail. */ >> + mtx_lock(&msq_mtx); >> + for (i = 0; i < msginfo.msgmni; i++) { >> + msqkptr = &msqids[i]; >> + if (msqkptr->u.msg_qbytes != 0 && >> + msqkptr->cred != NULL && msqkptr->cred->cr_prison >> == pr) >> + msq_remove(msqkptr); >> + } >> + mtx_unlock(&msq_mtx); >> +} >> + >> +SYSCTL_JAIL_PARAM_SYS_NODE(sysvmsg, CTLFLAG_RW, "SYSV message >> queues"); >> + >> #ifdef COMPAT_FREEBSD32 >> int >> freebsd32_msgsys(struct thread *td, struct freebsd32_msgsys_args >> *uap) >> @@ -1516,8 +1826,6 @@ sys_msgsys(td, uap) >> { >> int error; >> >> - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) >> - return (ENOSYS); >> if (uap->which < 0 || uap->which >= nitems(msgcalls)) >> return (EINVAL); >> error = (*msgcalls[uap->which])(td, &uap->a2); >> >> Modified: head/sys/kern/sysv_sem.c >> ============================================================================== >> --- head/sys/kern/sysv_sem.c Mon Apr 25 17:01:13 2016 >> (r298584) >> +++ head/sys/kern/sysv_sem.c Mon Apr 25 17:06:50 2016 >> (r298585) >> @@ -52,7 +52,9 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> +#include >> #include >> +#include >> #include >> #include >> #include >> @@ -78,7 +80,16 @@ static int sysvsem_modload(struct module >> static int semunload(void); >> static void semexit_myhook(void *arg, struct proc *p); >> static int sysctl_sema(SYSCTL_HANDLER_ARGS); >> -static int semvalid(int semid, struct semid_kernel *semakptr); >> +static int semvalid(int semid, struct prison *rpr, >> + struct semid_kernel *semakptr); >> +static void sem_remove(int semidx, struct ucred *cred); >> +static struct prison *sem_find_prison(struct ucred *); >> +static int sem_prison_cansee(struct prison *, struct semid_kernel *); >> +static int sem_prison_check(void *, void *); >> +static int sem_prison_set(void *, void *); >> +static int sem_prison_get(void *, void *); >> +static int sem_prison_remove(void *, void *); >> +static void sem_prison_cleanup(struct prison *); >> >> #ifndef _SYS_SYSPROTO_H_ >> struct __semctl_args; >> @@ -104,6 +115,7 @@ LIST_HEAD(, sem_undo) semu_list; /* list >> LIST_HEAD(, sem_undo) semu_free_list; /* list of free undo >> structures */ >> static int *semu; /* undo structure pool */ >> static eventhandler_tag semexit_tag; >> +static unsigned sem_prison_slot; /* prison OSD slot */ >> >> #define SEMUNDO_MTX sem_undo_mtx >> #define SEMUNDO_LOCK() mtx_lock(&SEMUNDO_MTX); >> @@ -247,7 +259,15 @@ static struct syscall_helper_data sem32_ >> static int >> seminit(void) >> { >> + struct prison *pr; >> + void *rsv; >> int i, error; >> + osd_method_t methods[PR_MAXMETHOD] = { >> + [PR_METHOD_CHECK] = sem_prison_check, >> + [PR_METHOD_SET] = sem_prison_set, >> + [PR_METHOD_GET] = sem_prison_get, >> + [PR_METHOD_REMOVE] = sem_prison_remove, >> + }; >> >> sem = malloc(sizeof(struct sem) * seminfo.semmns, M_SEM, >> M_WAITOK); >> sema = malloc(sizeof(struct semid_kernel) * seminfo.semmni, >> M_SEM, >> @@ -278,6 +298,29 @@ seminit(void) >> semexit_tag = EVENTHANDLER_REGISTER(process_exit, >> semexit_myhook, NULL, >> EVENTHANDLER_PRI_ANY); >> >> + /* Set current prisons according to their allow.sysvipc. */ >> + sem_prison_slot = osd_jail_register(NULL, methods); >> + rsv = osd_reserve(sem_prison_slot); >> + prison_lock(&prison0); >> + (void)osd_jail_set_reserved(&prison0, sem_prison_slot, rsv, >> &prison0); >> + prison_unlock(&prison0); >> + rsv = NULL; >> + sx_slock(&allprison_lock); >> + TAILQ_FOREACH(pr, &allprison, pr_list) { >> + if (rsv == NULL) >> + rsv = osd_reserve(sem_prison_slot); >> + prison_lock(pr); >> + if ((pr->pr_allow & PR_ALLOW_SYSVIPC) && pr->pr_ref > >> 0) { >> + (void)osd_jail_set_reserved(pr, >> sem_prison_slot, rsv, >> + &prison0); >> + rsv = NULL; >> + } >> + prison_unlock(pr); >> + } >> + if (rsv != NULL) >> + osd_free_reserved(rsv); >> + sx_sunlock(&allprison_lock); >> + >> error = syscall_helper_register(sem_syscalls, >> SY_THR_STATIC_KLD); >> if (error != 0) >> return (error); >> @@ -303,6 +346,8 @@ semunload(void) >> #endif >> syscall_helper_unregister(sem_syscalls); >> EVENTHANDLER_DEREGISTER(process_exit, semexit_tag); >> + if (sem_prison_slot != 0) >> + osd_jail_deregister(sem_prison_slot); >> #ifdef MAC >> for (i = 0; i < seminfo.semmni; i++) >> mac_sysvsem_destroy(&sema[i]); >> @@ -489,11 +534,74 @@ semundo_clear(int semid, int semnum) >> } >> >> static int >> -semvalid(int semid, struct semid_kernel *semakptr) >> +semvalid(int semid, struct prison *rpr, struct semid_kernel >> *semakptr) >> { >> >> return ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || >> - semakptr->u.sem_perm.seq != IPCID_TO_SEQ(semid) ? EINVAL : >> 0); >> + semakptr->u.sem_perm.seq != IPCID_TO_SEQ(semid) || >> + sem_prison_cansee(rpr, semakptr) ? EINVAL : 0); >> +} >> + >> +static void >> +sem_remove(int semidx, struct ucred *cred) >> +{ >> + struct semid_kernel *semakptr; >> + int i; >> + >> + KASSERT(semidx >= 0 && semidx < seminfo.semmni, >> + ("semidx out of bounds")); >> + semakptr = &sema[semidx]; >> + semakptr->u.sem_perm.cuid = cred ? cred->cr_uid : 0; >> + semakptr->u.sem_perm.uid = cred ? cred->cr_uid : 0; >> + semakptr->u.sem_perm.mode = 0; >> + racct_sub_cred(semakptr->cred, RACCT_NSEM, >> semakptr->u.sem_nsems); >> + crfree(semakptr->cred); >> + semakptr->cred = NULL; >> + SEMUNDO_LOCK(); >> + semundo_clear(semidx, -1); >> + SEMUNDO_UNLOCK(); >> +#ifdef MAC >> + mac_sysvsem_cleanup(semakptr); >> +#endif >> + wakeup(semakptr); >> + for (i = 0; i < seminfo.semmni; i++) { >> + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && >> + sema[i].u.sem_base > semakptr->u.sem_base) >> + mtx_lock_flags(&sema_mtx[i], LOP_DUPOK); >> + } >> + for (i = semakptr->u.sem_base - sem; i < semtot; i++) >> + sem[i] = sem[i + semakptr->u.sem_nsems]; >> + for (i = 0; i < seminfo.semmni; i++) { >> + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && >> + sema[i].u.sem_base > semakptr->u.sem_base) { >> + sema[i].u.sem_base -= semakptr->u.sem_nsems; >> + mtx_unlock(&sema_mtx[i]); >> + } >> + } >> + semtot -= semakptr->u.sem_nsems; >> +} >> + >> +static struct prison * >> +sem_find_prison(struct ucred *cred) >> +{ >> + struct prison *pr, *rpr; >> + >> + pr = cred->cr_prison; >> + prison_lock(pr); >> + rpr = osd_jail_get(pr, sem_prison_slot); >> + prison_unlock(pr); >> + return rpr; >> +} >> + >> +static int >> +sem_prison_cansee(struct prison *rpr, struct semid_kernel *semakptr) >> +{ >> + >> + if (semakptr->cred == NULL || >> + !(rpr == semakptr->cred->cr_prison || >> + prison_ischild(rpr, semakptr->cred->cr_prison))) >> + return (EINVAL); >> + return (0); >> } >> >> /* >> @@ -572,6 +680,7 @@ kern_semctl(struct thread *td, int semid >> u_short *array; >> struct ucred *cred = td->td_ucred; >> int i, error; >> + struct prison *rpr; >> struct semid_ds *sbuf; >> struct semid_kernel *semakptr; >> struct mtx *sema_mtxp; >> @@ -580,7 +689,9 @@ kern_semctl(struct thread *td, int semid >> >> DPRINTF(("call to semctl(%d, %d, %d, 0x%p)\n", >> semid, semnum, cmd, arg)); >> - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) >> + >> + rpr = sem_find_prison(td->td_ucred); >> + if (sem == NULL) >> return (ENOSYS); >> >> array = NULL; >> @@ -600,6 +711,8 @@ kern_semctl(struct thread *td, int semid >> error = EINVAL; >> goto done2; >> } >> + if ((error = sem_prison_cansee(rpr, semakptr))) >> + goto done2; >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_R))) >> goto done2; >> #ifdef MAC >> @@ -608,6 +721,8 @@ kern_semctl(struct thread *td, int semid >> goto done2; >> #endif >> bcopy(&semakptr->u, arg->buf, sizeof(struct >> semid_ds)); >> + if (cred->cr_prison != semakptr->cred->cr_prison) >> + arg->buf->sem_perm.key = IPC_PRIVATE; >> *rval = IXSEQ_TO_IPCID(semid, semakptr->u.sem_perm); >> mtx_unlock(sema_mtxp); >> return (0); >> @@ -622,6 +737,7 @@ kern_semctl(struct thread *td, int semid >> if (cmd == IPC_RMID) >> mtx_lock(&sem_mtx); >> mtx_lock(sema_mtxp); >> + >> #ifdef MAC >> error = mac_sysvsem_check_semctl(cred, semakptr, cmd); >> if (error != 0) >> @@ -633,42 +749,15 @@ kern_semctl(struct thread *td, int semid >> >> switch (cmd) { >> case IPC_RMID: >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_M))) >> goto done2; >> - semakptr->u.sem_perm.cuid = cred->cr_uid; >> - semakptr->u.sem_perm.uid = cred->cr_uid; >> - semakptr->u.sem_perm.mode = 0; >> - racct_sub_cred(semakptr->cred, RACCT_NSEM, >> semakptr->u.sem_nsems); >> - crfree(semakptr->cred); >> - semakptr->cred = NULL; >> - SEMUNDO_LOCK(); >> - semundo_clear(semidx, -1); >> - SEMUNDO_UNLOCK(); >> -#ifdef MAC >> - mac_sysvsem_cleanup(semakptr); >> -#endif >> - wakeup(semakptr); >> - for (i = 0; i < seminfo.semmni; i++) { >> - if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && >> - sema[i].u.sem_base > semakptr->u.sem_base) >> - mtx_lock_flags(&sema_mtx[i], >> LOP_DUPOK); >> - } >> - for (i = semakptr->u.sem_base - sem; i < semtot; i++) >> - sem[i] = sem[i + semakptr->u.sem_nsems]; >> - for (i = 0; i < seminfo.semmni; i++) { >> - if ((sema[i].u.sem_perm.mode & SEM_ALLOC) && >> - sema[i].u.sem_base > semakptr->u.sem_base) >> { >> - sema[i].u.sem_base -= >> semakptr->u.sem_nsems; >> - mtx_unlock(&sema_mtx[i]); >> - } >> - } >> - semtot -= semakptr->u.sem_nsems; >> + sem_remove(semidx, cred); >> break; >> >> case IPC_SET: >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_M))) >> goto done2; >> @@ -681,15 +770,17 @@ kern_semctl(struct thread *td, int semid >> break; >> >> case IPC_STAT: >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_R))) >> goto done2; >> bcopy(&semakptr->u, arg->buf, sizeof(struct >> semid_ds)); >> + if (cred->cr_prison != semakptr->cred->cr_prison) >> + arg->buf->sem_perm.key = IPC_PRIVATE; >> break; >> >> case GETNCNT: >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_R))) >> goto done2; >> @@ -701,7 +792,7 @@ kern_semctl(struct thread *td, int semid >> break; >> >> case GETPID: >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_R))) >> goto done2; >> @@ -713,7 +804,7 @@ kern_semctl(struct thread *td, int semid >> break; >> >> case GETVAL: >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_R))) >> goto done2; >> @@ -749,7 +840,7 @@ kern_semctl(struct thread *td, int semid >> mtx_unlock(sema_mtxp); >> array = malloc(sizeof(*array) * count, M_TEMP, >> M_WAITOK); >> mtx_lock(sema_mtxp); >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> KASSERT(count == semakptr->u.sem_nsems, ("nsems >> changed")); >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_R))) >> @@ -762,7 +853,7 @@ kern_semctl(struct thread *td, int semid >> break; >> >> case GETZCNT: >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_R))) >> goto done2; >> @@ -774,7 +865,7 @@ kern_semctl(struct thread *td, int semid >> break; >> >> case SETVAL: >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_W))) >> goto done2; >> @@ -805,7 +896,7 @@ kern_semctl(struct thread *td, int semid >> mtx_lock(sema_mtxp); >> if (error) >> break; >> - if ((error = semvalid(semid, semakptr)) != 0) >> + if ((error = semvalid(semid, rpr, semakptr)) != 0) >> goto done2; >> KASSERT(count == semakptr->u.sem_nsems, ("nsems >> changed")); >> if ((error = ipcperm(td, &semakptr->u.sem_perm, >> IPC_W))) >> @@ -855,13 +946,16 @@ sys_semget(struct thread *td, struct sem >> struct ucred *cred = td->td_ucred; >> >> DPRINTF(("semget(0x%x, %d, 0%o)\n", key, nsems, semflg)); >> - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) >> + >> + if (sem_find_prison(cred) == NULL) >> return (ENOSYS); >> >> mtx_lock(&sem_mtx); >> if (key != IPC_PRIVATE) { >> for (semid = 0; semid < seminfo.semmni; semid++) { >> if ((sema[semid].u.sem_perm.mode & SEM_ALLOC) >> && >> + sema[semid].cred != NULL && >> + sema[semid].cred->cr_prison == >> cred->cr_prison && >> sema[semid].u.sem_perm.key == key) >> break; >> } >> @@ -978,6 +1072,7 @@ sys_semop(struct thread *td, struct semo >> struct sembuf small_sops[SMALL_SOPS]; >> int semid = uap->semid; >> size_t nsops = uap->nsops; >> + struct prison *rpr; >> struct sembuf *sops; >> struct semid_kernel *semakptr; >> struct sembuf *sopptr = NULL; >> @@ -994,7 +1089,8 @@ sys_semop(struct thread *td, struct semo >> #endif >> DPRINTF(("call to semop(%d, %p, %u)\n", semid, sops, nsops)); >> >> - if (!prison_allow(td->td_ucred, PR_ALLOW_SYSVIPC)) >> + rpr = sem_find_prison(td->td_ucred); >> + if (sem == NULL) >> return (ENOSYS); >> >> semid = IPCID_TO_IX(semid); /* Convert back to zero origin >> */ >> @@ -1044,6 +1140,8 @@ sys_semop(struct thread *td, struct semo >> error = EINVAL; >> goto done2; >> } >> + if ((error = sem_prison_cansee(rpr, semakptr)) != 0) >> + goto done2; >> /* >> * Initial pass thru sops to see what permissions are needed. >> * Also perform any checks that don't need repeating on each >> @@ -1367,11 +1465,217 @@ semexit_myhook(void *arg, struct proc *p >> static int >> sysctl_sema(SYSCTL_HANDLER_ARGS) >> { >> + struct prison *rpr; >> + struct sbuf sb; >> + struct semid_kernel tmp, empty; >> + struct semid_kernel *semakptr; >> + int error, i; >> + >> + error = sysctl_wire_old_buffer(req, 0); >> + if (error != 0) >> + goto done; >> + rpr = sem_find_prison(req->td->td_ucred); >> + sbuf_new_for_sysctl(&sb, NULL, sizeof(struct semid_kernel) * >> + seminfo.semmni, req); >> + >> + bzero(&empty, sizeof(empty)); >> + for (i = 0; i < seminfo.semmni; i++) { >> + semakptr = &sema[i]; >> + if ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || >> + rpr == NULL || sem_prison_cansee(rpr, semakptr) != >> 0) { >> + semakptr = ∅ >> + } else if (req->td->td_ucred->cr_prison != >> + semakptr->cred->cr_prison) { >> + bcopy(semakptr, &tmp, sizeof(tmp)); >> + semakptr = &tmp; >> + semakptr->u.sem_perm.key = IPC_PRIVATE; >> + } >> >> - return (SYSCTL_OUT(req, sema, >> - sizeof(struct semid_kernel) * seminfo.semmni)); >> + sbuf_bcat(&sb, semakptr, sizeof(*semakptr)); >> + } >> + error = sbuf_finish(&sb); >> + sbuf_delete(&sb); >> + >> +done: >> + return (error); >> } >> >> +static int >> +sem_prison_check(void *obj, void *data) >> +{ >> + struct prison *pr = obj; >> + struct prison *prpr; >> + struct vfsoptlist *opts = data; >> + int error, jsys; >> + >> + /* >> + * sysvsem is a jailsys integer. >> + * It must be "disable" if the parent jail is disabled. >> + */ >> + error = vfs_copyopt(opts, "sysvsem", &jsys, sizeof(jsys)); >> + if (error != ENOENT) { >> + if (error != 0) >> + return (error); >> + switch (jsys) { >> + case JAIL_SYS_DISABLE: >> + break; >> + case JAIL_SYS_NEW: >> + case JAIL_SYS_INHERIT: >> + prison_lock(pr->pr_parent); >> + prpr = osd_jail_get(pr->pr_parent, >> sem_prison_slot); >> + prison_unlock(pr->pr_parent); >> + if (prpr == NULL) >> + return (EPERM); >> + break; >> + default: >> + return (EINVAL); >> + } >> >> *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to >> "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Mon Apr 25 22:29:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D5F1B1CFF7; Mon, 25 Apr 2016 22:29:01 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E43121D6B; Mon, 25 Apr 2016 22:29:00 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 3A24525D38A4; Mon, 25 Apr 2016 22:28:56 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 46FBAD1F7F9; Mon, 25 Apr 2016 22:28:55 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id A3h3bmDypNra; Mon, 25 Apr 2016 22:28:54 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4410:f42d:156f:b392:2ded] (unknown [IPv6:fde9:577b:c1a9:4410:f42d:156f:b392:2ded]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 66007D1F7F7; Mon, 25 Apr 2016 22:28:53 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn: head/usr.bin/mkuzip From: "Bjoern A. Zeeb" In-Reply-To: <1461610184.1191.58.camel@freebsd.org> Date: Mon, 25 Apr 2016 22:28:33 +0000 Cc: Maxim Sobolev , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201604251320.u3PDKZtI057759@repo.freebsd.org> <1461610184.1191.58.camel@freebsd.org> To: Ian Lepore X-Mailer: Apple Mail (2.3112) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 22:29:01 -0000 > On 25 Apr 2016, at 18:49 , Ian Lepore wrote: >=20 > On Mon, 2016-04-25 at 11:39 -0700, Maxim Sobolev wrote: >> Thanks and sorry about that. I did not realize we use different >> compilers >> for different architectures. By any chance, do you know is there a >> way to >> test buildworld on amd64 with gcc? >>=20 >=20 > Add these args to src.conf or the command line. I haven't tried these > with anything except arm platforms for a couple years, but in theory = it > should work on amd64... I usually just do a make -k -s -j16 tinderbox TARGETS=3D=E2=80=9Camd64 = sparc64=E2=80=9D or something like that for those cases. Well, I actually try to compile all platforms all the time in a loop, = which is why I notice but .. that=E2=80=99s a different story ;-) /bz= From owner-svn-src-head@freebsd.org Mon Apr 25 22:30:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F24FFB1C06F; Mon, 25 Apr 2016 22:30:11 +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 C2B251EEC; Mon, 25 Apr 2016 22:30:11 +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 u3PMUATO033824; Mon, 25 Apr 2016 22:30:10 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PMUA6g033823; Mon, 25 Apr 2016 22:30:10 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604252230.u3PMUA6g033823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Mon, 25 Apr 2016 22:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298597 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 22:30:12 -0000 Author: jamie Date: Mon Apr 25 22:30:10 2016 New Revision: 298597 URL: https://svnweb.freebsd.org/changeset/base/298597 Log: Fix the logic in r298585: shm_prison_cansee returns an errno, so is the opposite of a boolean. PR: 48471 Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Mon Apr 25 22:25:57 2016 (r298596) +++ head/sys/kern/sysv_shm.c Mon Apr 25 22:30:10 2016 (r298597) @@ -230,7 +230,7 @@ shm_find_segment(struct prison *rpr, int (!shm_allow_removed && (shmseg->u.shm_perm.mode & SHMSEG_REMOVED) != 0) || (is_shmid && shmseg->u.shm_perm.seq != IPCID_TO_SEQ(arg)) || - !shm_prison_cansee(rpr, shmseg)) + shm_prison_cansee(rpr, shmseg) != 0) return (NULL); return (shmseg); } From owner-svn-src-head@freebsd.org Mon Apr 25 23:12:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F33E6B1CD44; Mon, 25 Apr 2016 23:12:40 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4253196C; Mon, 25 Apr 2016 23:12:40 +0000 (UTC) (envelope-from loos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3PNCdDA049388; Mon, 25 Apr 2016 23:12:39 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3PNCde7049387; Mon, 25 Apr 2016 23:12:39 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201604252312.u3PNCde7049387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Mon, 25 Apr 2016 23:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298598 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2016 23:12:41 -0000 Author: loos Date: Mon Apr 25 23:12:39 2016 New Revision: 298598 URL: https://svnweb.freebsd.org/changeset/base/298598 Log: Fixes the comment to reflect the code. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Mon Apr 25 22:30:10 2016 (r298597) +++ head/sys/netinet6/nd6.c Mon Apr 25 23:12:39 2016 (r298598) @@ -2352,8 +2352,7 @@ nd6_resolve_slow(struct ifnet *ifp, int /* * There is a neighbor cache entry, but no ethernet address * response yet. Append this latest packet to the end of the - * packet queue in the mbuf, unless the number of the packet - * does not exceed nd6_maxqueuelen. When it exceeds nd6_maxqueuelen, + * packet queue in the mbuf. When it exceeds nd6_maxqueuelen, * the oldest packet in the queue will be removed. */ From owner-svn-src-head@freebsd.org Tue Apr 26 00:29:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39FFCB1CD82; Tue, 26 Apr 2016 00:29:02 +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 F0CE412F0; Tue, 26 Apr 2016 00:29:01 +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 u3Q0T1lM070278; Tue, 26 Apr 2016 00:29:01 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q0T1KZ070277; Tue, 26 Apr 2016 00:29:01 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604260029.u3Q0T1KZ070277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 26 Apr 2016 00:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298599 - head/usr.bin/stat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 00:29:02 -0000 Author: araujo Date: Tue Apr 26 00:29:00 2016 New Revision: 298599 URL: https://svnweb.freebsd.org/changeset/base/298599 Log: Use MIN() instead of MAX() as the previous syntax was wrote in a weird and confused way: "prec > 9 ? 9 : prec". Submitted by: pfg, ngie and luke MFC after: 2 weeks. Modified: head/usr.bin/stat/stat.c Modified: head/usr.bin/stat/stat.c ============================================================================== --- head/usr.bin/stat/stat.c Mon Apr 25 23:12:39 2016 (r298598) +++ head/usr.bin/stat/stat.c Tue Apr 26 00:29:00 2016 (r298599) @@ -1025,7 +1025,7 @@ format1(const struct stat *st, * * Nanoseconds: long. */ - (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec)); + (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9)); (void)strcat(lfmt, tmp); /* From owner-svn-src-head@freebsd.org Tue Apr 26 00:29:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 499AFB1CDEE; Tue, 26 Apr 2016 00:29:37 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com [IPv6:2607:f8b0:4003:c01::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 0B99114A3; Tue, 26 Apr 2016 00:29:37 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-ob0-x22d.google.com with SMTP id n10so78590379obb.2; Mon, 25 Apr 2016 17:29:37 -0700 (PDT) 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; bh=uGCTAG03vnofk5Z1QY1welEOUdQW1nsA8XOMmUst1n0=; b=pr48yFxy+O5AnTBavv4UmeZcXhF3ZPw10I17BiuoLd5/C3gRoOSoVVY8vcVj3l99KZ LY8C2h2SliWaJaEsvgVAC6cTiuCwF3FQsnUOOkNq7utTjbOuk+chT0rh9FMA8kIS2ST9 cLBZxf4OodcWXufU8HVG9aiKggjYMQ8yqdx+8HIhcRnlP0bwIv+poPHcQMPIv3koC61O YSoGtLRV8WHpqZcouC30yrGctpzeqELTwPaGpSXw61OR89bqd+eIofl9d4ClJr/K53ZS IJgu7unvIVpkGtd+t1gXvu+CJIzlTuUfYUV9pgIqUArFMhAS1+kdlVAFThoH0k+LPvTq DN8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=uGCTAG03vnofk5Z1QY1welEOUdQW1nsA8XOMmUst1n0=; b=CmdJiPe0FetpmAGAQVFza447YYARYKZNyNoGwbCYyOYkRtq4m3qrDWlnmCpttvcG+9 4Rx9E8822iNlmnUWQv2t79nBgHiJG0TMYaHSi+z8IuydbRek+3VSHtsueljWr+c1Zrwl p+GSpegRbauijDGYpFDHILV7JbpRg2mNEOzubEplPabZ+iFKAnmSm44NCr/Gq+3eiUhT umyg2aMn6yrB7Vs7E21lRe29A/uHCiNKV89WUeuuJNkfbKNWvKACpq6LZl/w6e4qu8nT uzfQT2K3LWZYV6yMOcuYBEFMlzzykZBF/wLshZeL492eEueHlwjQBSGfMrzL4ufE5bdk yqbQ== X-Gm-Message-State: AOPr4FXH7skn2DBfHMTcoDGmFMaMung9+ev+5x4T8UMC5Bkz6gYTLpFZ1Kj+RD3MNmFk9m3VBsB7mr8YQgLP/w== MIME-Version: 1.0 X-Received: by 10.182.182.35 with SMTP id eb3mr15878140obc.64.1461630576357; Mon, 25 Apr 2016 17:29:36 -0700 (PDT) Received: by 10.182.156.65 with HTTP; Mon, 25 Apr 2016 17:29:36 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <571E2AF2.2060300@FreeBSD.org> References: <201604220343.u3M3h69m058753@repo.freebsd.org> <571E2AF2.2060300@FreeBSD.org> Date: Tue, 26 Apr 2016 08:29:36 +0800 Message-ID: Subject: Re: svn commit: r298443 - head/usr.bin/stat From: Marcelo Araujo To: Pedro Giffuni Cc: luke , "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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 00:29:37 -0000 2016-04-25 22:34 GMT+08:00 Pedro Giffuni : > Marcelo, please revert. > > And check your script, of course. > Fixed thanks! The problem is the weird way the expression was wrote before. Best, > > Pedro. > > > On 23/04/2016 04:23, luke wrote: > > On Fri, Apr 22, 2016 at 11:43 AM, Marcelo Araujo < > araujo@freebsd.org> wrote: > >> Author: araujo >> Date: Fri Apr 22 03:43:06 2016 >> New Revision: 298443 >> URL: https://svnweb.freebsd.org/changeset/base/298443 >> >> Log: >> Use macro MAX() from sys/param.h. >> >> MFC after: 2 weeks. >> >> Modified: >> head/usr.bin/stat/stat.c >> >> Modified: head/usr.bin/stat/stat.c >> >> ============================================================================== >> --- head/usr.bin/stat/stat.c Fri Apr 22 03:37:27 2016 (r298442) >> +++ head/usr.bin/stat/stat.c Fri Apr 22 03:43:06 2016 (r298443) >> @@ -1025,7 +1025,7 @@ format1(const struct stat *st, >> * >> * Nanoseconds: long. >> */ >> - (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ? 9 : >> prec); >> + (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec)); >> (void)strcat(lfmt, tmp); >> >> /* >> _______________________________________________ >> svn-src-head@freebsd.org mailing list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to " >> svn-src-head-unsubscribe@freebsd.org" >> > > > Hi, > > Should this be MIN() ? > > (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9)); > > > -- > Chang-Hsien Tsai > > > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Tue Apr 26 01:15:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DCB5B1D7A2; Tue, 26 Apr 2016 01:15:21 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: from mail-oi0-x234.google.com (mail-oi0-x234.google.com [IPv6:2607:f8b0:4003:c06::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 628FB19F5; Tue, 26 Apr 2016 01:15:21 +0000 (UTC) (envelope-from araujobsdport@gmail.com) Received: by mail-oi0-x234.google.com with SMTP id r78so179264oie.0; Mon, 25 Apr 2016 18:15:21 -0700 (PDT) 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; bh=Q67c6MNe9J5YYvYq3LSOice4oKqX5O26q9aQ72pyNOo=; b=Xc/PLVnqSTXAQXB7qLtez7kqpDcR9rGqLfTjwACOOiHWxgarnVkfoqItZGexJT2jaM 3+aR1d9R9EB+xmgE24BylbypgpH01iTErygC93pThHh+xy/AyW/v4BitAyNU6FVpLneT zmsomj1Wq/1kZSvxrQG38mPukdbWhGTP5+CwuM8aB2rjiscmjd1INJG8uvFc2YHbkMVu cpIc6EgzYokTNJ3AHDWt6FptyYOzE0AAOlGixWePuYm7DZKr+Z+lTe3xbf+2NtfCYCs+ 6wlRU0FNfvuaQGLWW4c81WlJ46udQc68/03zL93qJLrq4Lh8P23bcDDKaZjlSsI6+9C6 i9Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=Q67c6MNe9J5YYvYq3LSOice4oKqX5O26q9aQ72pyNOo=; b=SCzRKh467T67C4Bvti1t2/fS9L4yJ1mry2Y640SDOClPAziEBD0qje7d6ptCzMYriv BFMV+oe5hRNjHM3+o3pXy01qQbneaPUugnHhpVxnDIFzU8yq+zeI3jo+PAmJRlsUPA7+ jcO5pQbLi6AoDTD7N8i9HQFVTGAhD6a3OZMtLZYBBwWP3Ig8y7yQCEUTUm2/qmqrfLX5 /5btFfcdyphrG/125jzm/Zn4IPHu9o99aOXc8CH3dNzgfa6RLo23LLxO0oalP2BKI7F+ ULKFQVxO5D3ZVHSD/9I/A81tU7e9ibZ9wacLhz8THbcoKVQOgBGMVfArnUoX/my6Zcrr Xyiw== X-Gm-Message-State: AOPr4FVGNyfxrUD2/12+WcfHQtuXORp3i0Cg1jZVobNLWi9Do7iXguaf4b49OY69dzpk+O/UPc5mUocq89By2A== MIME-Version: 1.0 X-Received: by 10.157.3.97 with SMTP id 88mr17289050otv.137.1461633320737; Mon, 25 Apr 2016 18:15:20 -0700 (PDT) Received: by 10.182.156.65 with HTTP; Mon, 25 Apr 2016 18:15:20 -0700 (PDT) Reply-To: araujo@FreeBSD.org In-Reply-To: <69810c2f-ee32-5d7b-8367-689b2afb0d97@FreeBSD.org> References: <201604220343.u3M3h69m058753@repo.freebsd.org> <69810c2f-ee32-5d7b-8367-689b2afb0d97@FreeBSD.org> Date: Tue, 26 Apr 2016 09:15:20 +0800 Message-ID: Subject: Re: HEADS UP: I will revert this. (was Re: svn commit: r298443 - head/usr.bin/stat) From: Marcelo Araujo To: Pedro Giffuni Cc: "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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:15:21 -0000 2016-04-26 5:33 GMT+08:00 Pedro Giffuni : > Hi Marcelo; > > Hi; > > I assume you have been very busy. > > I will revert this in a couple of hours unless you either explain > or revert it yourself. > Fixed! Sorry my delay, I got a bit busy! Thanks for the hands up. > > Pedro. > > On 04/23/16 04:23, luke wrote: > >> On Fri, Apr 22, 2016 at 11:43 AM, Marcelo Araujo > > wrote: >> >> Author: araujo >> Date: Fri Apr 22 03:43:06 2016 >> New Revision: 298443 >> URL: https://svnweb.freebsd.org/changeset/base/298443 >> >> Log: >> Use macro MAX() from sys/param.h. >> >> MFC after: 2 weeks. >> >> Modified: >> head/usr.bin/stat/stat.c >> >> Modified: head/usr.bin/stat/stat.c >> >> ============================================================================== >> --- head/usr.bin/stat/stat.c Fri Apr 22 03:37:27 2016 >> (r298442) >> +++ head/usr.bin/stat/stat.c Fri Apr 22 03:43:06 2016 >> (r298443) >> @@ -1025,7 +1025,7 @@ format1(const struct stat *st, >> * >> * Nanoseconds: long. >> */ >> - (void)snprintf(tmp, sizeof(tmp), "%dld", prec > 9 ? >> 9 : prec); >> + (void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, >> prec)); >> (void)strcat(lfmt, tmp); >> >> /* >> _______________________________________________ >> svn-src-head@freebsd.org mailing >> list >> https://lists.freebsd.org/mailman/listinfo/svn-src-head >> To unsubscribe, send any mail to >> "svn-src-head-unsubscribe@freebsd.org >> " >> >> >> >> Hi, >> >> Should this be MIN() ? >> >> (void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9)); >> >> >> -- >> Chang-Hsien Tsai >> >> -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org \/ \ ^ Power To Server. .\. /_) From owner-svn-src-head@freebsd.org Tue Apr 26 01:17:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEAAAB1D851; Tue, 26 Apr 2016 01:17:06 +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 C111E1AE7; Tue, 26 Apr 2016 01:17:06 +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 u3Q1H50S085085; Tue, 26 Apr 2016 01:17:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1H5xB085083; Tue, 26 Apr 2016 01:17:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604260117.u3Q1H5xB085083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 01:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298600 - in head/lib/libc/db: btree hash X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:17:07 -0000 Author: pfg Date: Tue Apr 26 01:17:05 2016 New Revision: 298600 URL: https://svnweb.freebsd.org/changeset/base/298600 Log: libc: make more use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: head/lib/libc/db/btree/bt_open.c head/lib/libc/db/hash/hash.c Modified: head/lib/libc/db/btree/bt_open.c ============================================================================== --- head/lib/libc/db/btree/bt_open.c Tue Apr 26 00:29:00 2016 (r298599) +++ head/lib/libc/db/btree/bt_open.c Tue Apr 26 01:17:05 2016 (r298600) @@ -277,7 +277,7 @@ __bt_open(const char *fname, int flags, b.cachesize = b.psize * MINCACHE; /* Calculate number of pages to cache. */ - ncache = (b.cachesize + t->bt_psize - 1) / t->bt_psize; + ncache = howmany(b.cachesize, t->bt_psize); /* * The btree data structure requires that at least two keys can fit on Modified: head/lib/libc/db/hash/hash.c ============================================================================== --- head/lib/libc/db/hash/hash.c Tue Apr 26 00:29:00 2016 (r298599) +++ head/lib/libc/db/hash/hash.c Tue Apr 26 01:17:05 2016 (r298600) @@ -160,8 +160,7 @@ __hash_open(const char *file, int flags, * maximum bucket number, so the number of buckets is * max_bucket + 1. */ - nsegs = (hashp->MAX_BUCKET + 1 + hashp->SGSIZE - 1) / - hashp->SGSIZE; + nsegs = howmany(hashp->MAX_BUCKET + 1, hashp->SGSIZE); if (alloc_segs(hashp, nsegs)) /* * If alloc_segs fails, table will have been destroyed From owner-svn-src-head@freebsd.org Tue Apr 26 01:19:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF871B1D913; Tue, 26 Apr 2016 01:19:37 +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 C0A2E1D0E; Tue, 26 Apr 2016 01:19:37 +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 u3Q1JakA085199; Tue, 26 Apr 2016 01:19:36 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1Ja69085198; Tue, 26 Apr 2016 01:19:36 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604260119.u3Q1Ja69085198@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 01:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298601 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:19:38 -0000 Author: pfg Date: Tue Apr 26 01:19:36 2016 New Revision: 298601 URL: https://svnweb.freebsd.org/changeset/base/298601 Log: libstand: make more use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: head/lib/libstand/nandfs.c Modified: head/lib/libstand/nandfs.c ============================================================================== --- head/lib/libstand/nandfs.c Tue Apr 26 01:17:05 2016 (r298600) +++ head/lib/libstand/nandfs.c Tue Apr 26 01:19:36 2016 (r298601) @@ -1017,7 +1017,7 @@ ioread(struct open_file *f, off_t pos, v off = pos % bsize; pos /= bsize; - nsec = (length + (bsize - 1)) / bsize; + nsec = howmany(length, bsize); NANDFS_DEBUG("pos=%lld length=%d off=%d nsec=%d\n", pos, length, off, nsec); From owner-svn-src-head@freebsd.org Tue Apr 26 01:20:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57BA8B1D971; Tue, 26 Apr 2016 01:20:17 +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 25A551E8B; Tue, 26 Apr 2016 01:20:17 +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 u3Q1KGP7085280; Tue, 26 Apr 2016 01:20:16 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1KGX2085279; Tue, 26 Apr 2016 01:20:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604260120.u3Q1KGX2085279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 01:20:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298602 - head/lib/libcuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:20:17 -0000 Author: pfg Date: Tue Apr 26 01:20:16 2016 New Revision: 298602 URL: https://svnweb.freebsd.org/changeset/base/298602 Log: libcuse: make more use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: head/lib/libcuse/cuse_lib.c Modified: head/lib/libcuse/cuse_lib.c ============================================================================== --- head/lib/libcuse/cuse_lib.c Tue Apr 26 01:19:36 2016 (r298601) +++ head/lib/libcuse/cuse_lib.c Tue Apr 26 01:20:16 2016 (r298602) @@ -184,7 +184,7 @@ cuse_vmalloc(int size) if (size < 1) return (NULL); - info.page_count = (size + PAGE_SIZE - 1) / PAGE_SIZE; + info.page_count = howmany(size, PAGE_SIZE); CUSE_LOCK(); for (n = 0; n != CUSE_ALLOC_UNIT_MAX; n++) { From owner-svn-src-head@freebsd.org Tue Apr 26 01:26:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BA7AB1DAD6; Tue, 26 Apr 2016 01:26:13 +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 C465C12E5; Tue, 26 Apr 2016 01:26: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 u3Q1QCSL088099; Tue, 26 Apr 2016 01:26:12 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1QCQD088098; Tue, 26 Apr 2016 01:26:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260126.u3Q1QCQD088098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 01:26:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298603 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:26:13 -0000 Author: adrian Date: Tue Apr 26 01:26:11 2016 New Revision: 298603 URL: https://svnweb.freebsd.org/changeset/base/298603 Log: [net80211] add an ioctl for LDPC configuration. Modified: head/sys/net80211/ieee80211_ioctl.h Modified: head/sys/net80211/ieee80211_ioctl.h ============================================================================== --- head/sys/net80211/ieee80211_ioctl.h Tue Apr 26 01:20:16 2016 (r298602) +++ head/sys/net80211/ieee80211_ioctl.h Tue Apr 26 01:26:11 2016 (r298603) @@ -702,6 +702,7 @@ struct ieee80211req { #define IEEE80211_IOC_RIFS 111 /* RIFS config (on, off) */ #define IEEE80211_IOC_GREENFIELD 112 /* Greenfield (on, off) */ #define IEEE80211_IOC_STBC 113 /* STBC Tx/RX (on, off) */ +#define IEEE80211_IOC_LDPC 114 /* LDPC Tx/RX (on, off) */ #define IEEE80211_IOC_MESH_ID 170 /* mesh identifier */ #define IEEE80211_IOC_MESH_AP 171 /* accepting peerings */ From owner-svn-src-head@freebsd.org Tue Apr 26 01:29:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6338B1DB92; Tue, 26 Apr 2016 01:29:04 +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 7397414F2; Tue, 26 Apr 2016 01:29:04 +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 u3Q1T3aN088229; Tue, 26 Apr 2016 01:29:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1T31A088228; Tue, 26 Apr 2016 01:29:03 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260129.u3Q1T31A088228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 01:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298604 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:29:04 -0000 Author: adrian Date: Tue Apr 26 01:29:03 2016 New Revision: 298604 URL: https://svnweb.freebsd.org/changeset/base/298604 Log: [net80211] add STBC capability flags to iv_flags_ht. This is in preparation for exposing configuring STBC flags up to ifconfig so STBC TX/RX can be configured at runtime. * Set the FHT_STBC flags for TX/RX if the HT capabilitiex exist * Clear the RX STBC HT capability flag when creating a HTCAP IE, so we only announce it if it's configured in the FHT flags. Tested: * AR9331 (carambola2), AP/STA modes Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Tue Apr 26 01:26:11 2016 (r298603) +++ head/sys/net80211/ieee80211_ht.c Tue Apr 26 01:29:03 2016 (r298604) @@ -293,6 +293,11 @@ ieee80211_ht_vattach(struct ieee80211vap vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_RX; if (vap->iv_htcaps & IEEE80211_HTC_AMSDU) vap->iv_flags_ht |= IEEE80211_FHT_AMSDU_TX; + + if (vap->iv_htcaps & IEEE80211_HTCAP_TXSTBC) + vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX; + if (vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC) + vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX; } /* NB: disable default legacy WDS, too many issues right now */ if (vap->iv_flags_ext & IEEE80211_FEXT_WDSLEGACY) @@ -2778,6 +2783,13 @@ ieee80211_add_htcap_body(uint8_t *frm, s if ((vap->iv_flags_ht & IEEE80211_FHT_SHORTGI40) == 0 || (caps & IEEE80211_HTCAP_CHWIDTH40) == 0) caps &= ~IEEE80211_HTCAP_SHORTGI40; + + /* adjust STBC based on receive capabilities */ + if ((vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) == 0) + caps &= ~IEEE80211_HTCAP_RXSTBC; + + /* XXX TODO: adjust LDPC based on receive capabilities */ + ADDSHORT(frm, caps); /* HT parameters */ From owner-svn-src-head@freebsd.org Tue Apr 26 01:29:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53D98B1DBE9; Tue, 26 Apr 2016 01:29:27 +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 21A5B1779; Tue, 26 Apr 2016 01:29:27 +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 u3Q1TQ6m088285; Tue, 26 Apr 2016 01:29:26 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1TQWD088284; Tue, 26 Apr 2016 01:29:26 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260129.u3Q1TQWD088284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 01:29:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298605 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:29:27 -0000 Author: adrian Date: Tue Apr 26 01:29:26 2016 New Revision: 298605 URL: https://svnweb.freebsd.org/changeset/base/298605 Log: [net80211] add the STBC ioctl support. This adds configurable STBC TX and RX support. Modified: head/sys/net80211/ieee80211_ioctl.c Modified: head/sys/net80211/ieee80211_ioctl.c ============================================================================== --- head/sys/net80211/ieee80211_ioctl.c Tue Apr 26 01:29:03 2016 (r298604) +++ head/sys/net80211/ieee80211_ioctl.c Tue Apr 26 01:29:26 2016 (r298605) @@ -1128,6 +1128,13 @@ ieee80211_ioctl_get80211(struct ieee8021 ireq->i_val = (vap->iv_flags_ht & IEEE80211_FHT_RIFS) != 0; break; + case IEEE80211_IOC_STBC: + ireq->i_val = 0; + if (vap->iv_flags_ht & IEEE80211_FHT_STBC_TX) + ireq->i_val |= 1; + if (vap->iv_flags_ht & IEEE80211_FHT_STBC_RX) + ireq->i_val |= 2; + break; default: error = ieee80211_ioctl_getdefault(vap, ireq); break; @@ -3265,6 +3272,31 @@ ieee80211_ioctl_set80211(struct ieee8021 if (isvapht(vap)) error = ERESTART; break; + case IEEE80211_IOC_STBC: + /* Check if we can do STBC TX/RX before changing the setting */ + if ((ireq->i_val & 1) && + ((vap->iv_htcaps & IEEE80211_HTCAP_TXSTBC) == 0)) + return EOPNOTSUPP; + if ((ireq->i_val & 2) && + ((vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC) == 0)) + return EOPNOTSUPP; + + /* TX */ + if (ireq->i_val & 1) + vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX; + else + vap->iv_flags_ht &= ~IEEE80211_FHT_STBC_TX; + + /* RX */ + if (ireq->i_val & 2) + vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX; + else + vap->iv_flags_ht &= ~IEEE80211_FHT_STBC_RX; + + /* NB: reset only if we're operating on an 11n channel */ + if (isvapht(vap)) + error = ERESTART; + break; default: error = ieee80211_ioctl_setdefault(vap, ireq); break; From owner-svn-src-head@freebsd.org Tue Apr 26 01:30:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 736BDB1DC5E; Tue, 26 Apr 2016 01:30:30 +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 2C1EF195C; Tue, 26 Apr 2016 01:30:30 +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 u3Q1UTwS088386; Tue, 26 Apr 2016 01:30:29 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1UT1v088385; Tue, 26 Apr 2016 01:30:29 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260130.u3Q1UT1v088385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 01:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298606 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:30:30 -0000 Author: adrian Date: Tue Apr 26 01:30:29 2016 New Revision: 298606 URL: https://svnweb.freebsd.org/changeset/base/298606 Log: [ifconfig] add STBC TX/RX configuration This adds the ability to view and configure the STBC parameter for both transmit and receive. Whilst here, fix a typo for AMSDU. TODO: * manpage update Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Tue Apr 26 01:29:26 2016 (r298605) +++ head/sbin/ifconfig/ifieee80211.c Tue Apr 26 01:30:29 2016 (r298606) @@ -1697,7 +1697,7 @@ set80211ampdu(const char *val, int d, in int ampdu; if (get80211val(s, IEEE80211_IOC_AMPDU, &du) < 0) - errx(-1, "cannot get AMPDU setting"); + errx(-1, "cannot set AMPDU setting"); if (d < 0) { d = -d; ampdu &= ~d; @@ -1706,6 +1706,21 @@ set80211ampdu(const char *val, int d, in set80211(s, IEEE80211_IOC_AMPDU, ampdu, 0, NULL); } +static void +set80211stbc(const char *val, int d, int s, const struct afswtch *rafp) +{ + int stbc; + + if (get80211val(s, IEEE80211_IOC_STBC, &stbc) < 0) + errx(-1, "cannot set STBC setting"); + if (d < 0) { + d = -d; + stbc &= ~d; + } else + stbc |= d; + set80211(s, IEEE80211_IOC_STBC, stbc, 0, NULL); +} + static DECL_CMD_FUNC(set80211ampdulimit, val, d) { @@ -4828,6 +4843,23 @@ end: else if (verbose) LINE_CHECK("-rifs"); } + if (get80211val(s, IEEE80211_IOC_STBC, &val) != -1) { + switch (val) { + case 0: + LINE_CHECK("-stbc"); + break; + case 1: + LINE_CHECK("stbctx -stbcrx"); + break; + case 2: + LINE_CHECK("-stbctx stbcrx"); + break; + case 3: + if (verbose) + LINE_CHECK("stbc"); + break; + } + } } if (get80211val(s, IEEE80211_IOC_WME, &wme) != -1) { @@ -5324,6 +5356,12 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("amsdu", 3, set80211amsdu), /* NB: tx+rx */ DEF_CMD("-amsdu", -3, set80211amsdu), DEF_CMD_ARG("amsdulimit", set80211amsdulimit), + DEF_CMD("stbcrx", 2, set80211stbc), + DEF_CMD("-stbcrx", -2, set80211stbc), + DEF_CMD("stbctx", 1, set80211stbc), + DEF_CMD("-stbctx", -1, set80211stbc), + DEF_CMD("stbc", 3, set80211stbc), /* NB: tx+rx */ + DEF_CMD("-ampdu", -3, set80211stbc), DEF_CMD("puren", 1, set80211puren), DEF_CMD("-puren", 0, set80211puren), DEF_CMD("doth", 1, set80211doth), From owner-svn-src-head@freebsd.org Tue Apr 26 01:34:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5136B1DDBA; Tue, 26 Apr 2016 01:34: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 8FE661DB8; Tue, 26 Apr 2016 01:34: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 u3Q1YLhO091435; Tue, 26 Apr 2016 01:34:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1YL7e091434; Tue, 26 Apr 2016 01:34:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260134.u3Q1YL7e091434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 01:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298607 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:34:22 -0000 Author: adrian Date: Tue Apr 26 01:34:21 2016 New Revision: 298607 URL: https://svnweb.freebsd.org/changeset/base/298607 Log: [ath] obey the STBC flag setting in iv_flags_ht Add support for the FHT_STBC_TX flag in iv_flags_ht, so it'll now obey the per-vap ifconfig stbctx flag. This means that we can do STBC TX on one vap and not another VAP. (As well as STBC RX on said vap; that changes the HTCAP announcement.) Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Tue Apr 26 01:30:29 2016 (r298606) +++ head/sys/dev/ath/if_ath_tx_ht.c Tue Apr 26 01:34:21 2016 (r298607) @@ -272,8 +272,11 @@ ath_tx_rate_fill_rcflags(struct ath_soft * can receive (at least) 1 stream STBC, AND it's * MCS 0-7, AND we have at least two chains enabled, * enable STBC. + * + * XXX TODO: .. and the rate is an 11n rate? */ if (ic->ic_htcaps & IEEE80211_HTCAP_TXSTBC && + ni->ni_vap->iv_flags_ht & IEEE80211_FHT_STBC_TX && ni->ni_htcap & IEEE80211_HTCAP_RXSTBC_1STREAM && (sc->sc_cur_txchainmask > 1) && HT_RC_2_STREAMS(rate) == 1) { @@ -281,10 +284,6 @@ ath_tx_rate_fill_rcflags(struct ath_soft } /* - * XXX TODO: LDPC - */ - - /* * Dual / Triple stream rate? */ if (HT_RC_2_STREAMS(rate) == 2) @@ -565,6 +564,12 @@ ath_rateseries_setup(struct ath_softc *s } /* + * TODO: If we're all doing 11n rates then we can set LDPC. + * If we've been asked to /do/ LDPC but we are handed a + * legacy rate, then we should complain. Loudly. + */ + + /* * PktDuration doesn't include slot, ACK, RTS, etc timing - * it's just the packet duration */ From owner-svn-src-head@freebsd.org Tue Apr 26 01:37:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76D6CB1DE3C; Tue, 26 Apr 2016 01:37:04 +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 2F69C1F7B; Tue, 26 Apr 2016 01:37:04 +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 u3Q1b3wg091567; Tue, 26 Apr 2016 01:37:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1b3hR091565; Tue, 26 Apr 2016 01:37:03 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260137.u3Q1b3hR091565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 01:37:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298608 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:37:04 -0000 Author: adrian Date: Tue Apr 26 01:37:03 2016 New Revision: 298608 URL: https://svnweb.freebsd.org/changeset/base/298608 Log: [ath] add LDPC capability support and LDPC RX support. This enables LDPC receive support for the AR9300 chips that support it. It'll announce LDPC support via net80211. Tested: * AR9380, STA mode * AR9331, (to verify the HAL didn't attach it to a chip which doesn't support LDPC.) TODO: * Add in net80211 machinery to make this configurable at runtime. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Apr 26 01:34:21 2016 (r298607) +++ head/sys/dev/ath/if_ath.c Tue Apr 26 01:37:03 2016 (r298608) @@ -1062,6 +1062,7 @@ ath_attach(u_int16_t devid, struct ath_s if (ath_hal_getcapability(ah, HAL_CAP_HT, 0, NULL) == HAL_OK && (wmodes & (HAL_MODE_HT20 | HAL_MODE_HT40))) { uint32_t rxs, txs; + uint32_t ldpc; device_printf(sc->sc_dev, "[HT] enabling HT modes\n"); @@ -1130,6 +1131,18 @@ ath_attach(u_int16_t devid, struct ath_s "[HT] RTS aggregates limited to %d KiB\n", sc->sc_rts_aggr_limit / 1024); + /* + * LDPC + */ + if ((ath_hal_getcapability(ah, HAL_CAP_LDPC, 0, &ldpc)) + == HAL_OK && (ldpc == 1)) { + sc->sc_has_ldpc = 1; + device_printf(sc->sc_dev, + "[HT] LDPC transmit/receive enabled\n"); + ic->ic_htcaps |= IEEE80211_HTCAP_LDPC; + } + + device_printf(sc->sc_dev, "[HT] %d RX streams; %d TX streams\n", rxs, txs); } Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Apr 26 01:34:21 2016 (r298607) +++ head/sys/dev/ath/if_athvar.h Tue Apr 26 01:37:03 2016 (r298608) @@ -653,6 +653,7 @@ struct ath_softc { sc_use_ent : 1, sc_rx_stbc : 1, sc_tx_stbc : 1, + sc_has_ldpc : 1, sc_hasenforcetxop : 1, /* support enforce TxOP */ sc_hasdivcomb : 1, /* RX diversity combining */ sc_rx_lnamixer : 1; /* RX using LNA mixing */ @@ -1307,6 +1308,10 @@ void ath_intr(void *); #define ath_hal_hasdivantcomb(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_ANT_DIV_COMB, 0, NULL) == HAL_OK) +#define ath_hal_hasldpc(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_LDPC, 0, NULL) == HAL_OK) +#define ath_hal_hasldpcwar(_ah) \ + (ath_hal_getcapability(_ah, HAL_CAP_LDPCWAR, 0, NULL) == HAL_OK) /* EDMA definitions */ #define ath_hal_hasedma(_ah) \ From owner-svn-src-head@freebsd.org Tue Apr 26 01:41:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95948B1DEBE; Tue, 26 Apr 2016 01:41:16 +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 5CEBC1299; Tue, 26 Apr 2016 01:41:16 +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 u3Q1fFwN093703; Tue, 26 Apr 2016 01:41:15 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1fFSY093702; Tue, 26 Apr 2016 01:41:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604260141.u3Q1fFSY093702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 01:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298609 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:41:16 -0000 Author: pfg Date: Tue Apr 26 01:41:15 2016 New Revision: 298609 URL: https://svnweb.freebsd.org/changeset/base/298609 Log: ext2fs: make use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_vfsops.c Modified: head/sys/fs/ext2fs/ext2_vfsops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vfsops.c Tue Apr 26 01:37:03 2016 (r298608) +++ head/sys/fs/ext2fs/ext2_vfsops.c Tue Apr 26 01:41:15 2016 (r298609) @@ -357,10 +357,10 @@ compute_sb_data(struct vnode *devvp, str fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb; /* s_resuid / s_resgid ? */ - fs->e2fs_gcount = (es->e2fs_bcount - es->e2fs_first_dblock + - EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); + fs->e2fs_gcount = howmany(es->e2fs_bcount - es->e2fs_first_dblock, + EXT2_BLOCKS_PER_GROUP(fs)); e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); - db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb; + db_count = howmany(fs->e2fs_gcount, e2fs_descpb); fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, M_EXT2MNT, M_WAITOK); @@ -970,7 +970,7 @@ ext2_vget(struct mount *mp, ino_t ino, i */ if (!(ip->i_flag & IN_E4EXTENTS) && (S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode))) { - used_blocks = (ip->i_size+fs->e2fs_bsize-1) / fs->e2fs_bsize; + used_blocks = howmany(ip->i_size, fs->e2fs_bsize); for (i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; } From owner-svn-src-head@freebsd.org Tue Apr 26 01:52:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 586F6B0C391; Tue, 26 Apr 2016 01:52:36 +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 2A96F1AF3; Tue, 26 Apr 2016 01:52:36 +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 u3Q1qZOi097319; Tue, 26 Apr 2016 01:52:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q1qZrg097318; Tue, 26 Apr 2016 01:52:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604260152.u3Q1qZrg097318@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 01:52:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298610 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 01:52:36 -0000 Author: pfg Date: Tue Apr 26 01:52:35 2016 New Revision: 298610 URL: https://svnweb.freebsd.org/changeset/base/298610 Log: ddb: Make use of our roundup() macro when available. Modified: head/sys/ddb/db_expr.c Modified: head/sys/ddb/db_expr.c ============================================================================== --- head/sys/ddb/db_expr.c Tue Apr 26 01:41:15 2016 (r298609) +++ head/sys/ddb/db_expr.c Tue Apr 26 01:52:35 2016 (r298610) @@ -154,7 +154,7 @@ db_mult_expr(db_expr_t *valuep) else if (t == tPCT) lhs %= rhs; else - lhs = ((lhs+rhs-1)/rhs)*rhs; + lhs = roundup(lhs, rhs); } t = db_read_token(); } From owner-svn-src-head@freebsd.org Tue Apr 26 03:24:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 226FAB0DDE3; Tue, 26 Apr 2016 03:24:30 +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 C9E361491; Tue, 26 Apr 2016 03:24:29 +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 u3Q3OS2v024615; Tue, 26 Apr 2016 03:24:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q3OSbp024614; Tue, 26 Apr 2016 03:24:28 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260324.u3Q3OSbp024614@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 03:24:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298611 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 03:24:30 -0000 Author: adrian Date: Tue Apr 26 03:24:28 2016 New Revision: 298611 URL: https://svnweb.freebsd.org/changeset/base/298611 Log: [iwm] add extra transmit setup/completion logging so I can see what's going on. I'm seeing 5GHz association work but data not work until the rate drops, so I need way more information about what's being programmed into the transmit descriptors. Tested: * 7260AC, STA mode Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Tue Apr 26 01:52:35 2016 (r298610) +++ head/sys/dev/iwm/if_iwm.c Tue Apr 26 03:24:28 2016 (r298611) @@ -2410,6 +2410,17 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_soft KASSERT(tx_resp->frame_count == 1, ("too many frames")); /* Update rate control statistics. */ + IWM_DPRINTF(sc, IWM_DEBUG_XMIT, "%s: status=0x%04x, seq=%d, fc=%d, btc=%d, frts=%d, ff=%d, irate=%08x, wmt=%d\n", + __func__, + (int) le16toh(tx_resp->status.status), + (int) le16toh(tx_resp->status.sequence), + tx_resp->frame_count, + tx_resp->bt_kill_count, + tx_resp->failure_rts, + tx_resp->failure_frame, + le32toh(tx_resp->initial_rate), + (int) le16toh(tx_resp->wireless_media_time)); + if (status != IWM_TX_STATUS_SUCCESS && status != IWM_TX_STATUS_DIRECT_DONE) { ieee80211_ratectl_tx_complete(vap, ni, @@ -2802,8 +2813,12 @@ iwm_tx(struct iwm_softc *sc, struct mbuf KASSERT(data->in != NULL, ("node is NULL")); IWM_DPRINTF(sc, IWM_DEBUG_XMIT, - "sending data: qid=%d idx=%d len=%d nsegs=%d\n", - ring->qid, ring->cur, totlen, nsegs); + "sending data: qid=%d idx=%d len=%d nsegs=%d txflags=0x%08x rate_n_flags=0x%08x rateidx=%d\n", + ring->qid, ring->cur, totlen, nsegs, + le32toh(tx->tx_flags), + le32toh(tx->rate_n_flags), + (int) tx->initial_rate_index + ); /* Fill TX descriptor. */ desc->num_tbs = 2 + nsegs; From owner-svn-src-head@freebsd.org Tue Apr 26 04:41:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19794B1CE9E; Tue, 26 Apr 2016 04:41: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 C5519129B; Tue, 26 Apr 2016 04:41:00 +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 u3Q4f0li045898; Tue, 26 Apr 2016 04:41:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q4exZD045896; Tue, 26 Apr 2016 04:40:59 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604260440.u3Q4exZD045896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 04:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298612 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 04:41:01 -0000 Author: adrian Date: Tue Apr 26 04:40:59 2016 New Revision: 298612 URL: https://svnweb.freebsd.org/changeset/base/298612 Log: [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all This allows wifi to associate correctly after a suspend/resume cycle. Yes, I'm using this now day to day. Tested: * Intel 7260AC, STA mode Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwmvar.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Tue Apr 26 03:24:28 2016 (r298611) +++ head/sys/dev/iwm/if_iwm.c Tue Apr 26 04:40:59 2016 (r298612) @@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1) static int iwm_resume(device_t dev) { + struct iwm_softc *sc = device_get_softc(dev); + int do_reinit = 0; uint16_t reg; /* Clear device-specific "PCI retry timeout" register (41h). */ @@ -4941,17 +4943,33 @@ iwm_resume(device_t dev) pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); iwm_init_task(device_get_softc(dev)); + IWM_LOCK(sc); + if (sc->sc_flags & IWM_FLAG_DORESUME) { + sc->sc_flags &= ~IWM_FLAG_DORESUME; + do_reinit = 1; + } + IWM_UNLOCK(sc); + + if (do_reinit) + ieee80211_resume_all(&sc->sc_ic); + return 0; } static int iwm_suspend(device_t dev) { + int do_stop = 0; struct iwm_softc *sc = device_get_softc(dev); - if (sc->sc_ic.ic_nrunning > 0) { + do_stop = !! (sc->sc_ic.ic_nrunning > 0); + + ieee80211_suspend_all(&sc->sc_ic); + + if (do_stop) { IWM_LOCK(sc); iwm_stop(sc); + sc->sc_flags |= IWM_FLAG_DORESUME; IWM_UNLOCK(sc); } Modified: head/sys/dev/iwm/if_iwmvar.h ============================================================================== --- head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 03:24:28 2016 (r298611) +++ head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 04:40:59 2016 (r298612) @@ -405,6 +405,7 @@ struct iwm_softc { #define IWM_FLAG_STOPPED (1 << 2) #define IWM_FLAG_RFKILL (1 << 3) #define IWM_FLAG_BUSY (1 << 4) +#define IWM_FLAG_DORESUME (1 << 5) struct intr_config_hook sc_preinit_hook; struct callout sc_watchdog_to; From owner-svn-src-head@freebsd.org Tue Apr 26 04:45:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CCE2B1D004; Tue, 26 Apr 2016 04:45:23 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (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 234C21792; Tue, 26 Apr 2016 04:45:23 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp002.me.com by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) id <0O6800D004OJGC00@mr11p00im-asmtp002.me.com>; Tue, 26 Apr 2016 04:45:17 +0000 (GMT) Received: from [192.168.1.4] (c-50-174-208-73.hsd1.ca.comcast.net [50.174.208.73]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O6800CVP57F9S20@mr11p00im-asmtp002.me.com>; Tue, 26 Apr 2016 04:45:16 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-04-26_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 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-1604260079 User-Agent: Microsoft-MacOutlook/f.15.1.160411 Date: Mon, 25 Apr 2016 21:45:15 -0700 Subject: Re: svn commit: r298612 - head/sys/dev/iwm From: Ravi Pokala Sender: "Pokala, Ravi" To: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r298612 - head/sys/dev/iwm References: <201604260440.u3Q4exZD045896@repo.freebsd.org> In-reply-to: <201604260440.u3Q4exZD045896@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=4d515a; t=1461645917; bh=0raATdlLCrrQe8Ra1iHA79BRJ664czyKCedKWyjnr8o=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=ByRnbLv2YqgGJWdD9XG06vQqa2GtfzZyJnbVyQJY7OMVDM2JnQws9pMRKsMCiHEMi Q9ah3wHsiBUOy/sBqnCcBRu9Qw2fljsW3YrTOMULcLGbWuD18O7vFIezg+X6rrOOTP 1wd12L92ZGOg5CzbmZMIjzU5qm/mNo5V397n9SSJWNn3Nl8aYwQF8hMTUAjChYtaw+ pYuuTgq2/AjXjSlYxEtRSOiHbRGZZhouGAdJliZ3PMvII6AxYW9sCDdffRwq4JEE3f kd1HqW4xNPIrt+CtrT+Q/t0eEimtO0Q2yTnwHxxut0vWneM8BVsj91ZWH9cUhuGQ1w 8tmgGhnMGt5og== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 04:45:23 -0000 > do_stop = !! (sc->sc_ic.ic_nrunning > 0); Why the double-negation? Isn't do_stop = (sc->sc_ic.ic_nrunning > 0); equivalent? -Ravi (rpokala@) -----Original Message----- From: on behalf of Adrian Chadd Date: 2016-04-25, Monday at 21:40 To: , , Subject: svn commit: r298612 - head/sys/dev/iwm >Author: adrian >Date: Tue Apr 26 04:40:59 2016 >New Revision: 298612 >URL: https://svnweb.freebsd.org/changeset/base/298612 > >Log: > [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all > > This allows wifi to associate correctly after a suspend/resume cycle. > > Yes, I'm using this now day to day. > > Tested: > > * Intel 7260AC, STA mode > >Modified: > head/sys/dev/iwm/if_iwm.c > head/sys/dev/iwm/if_iwmvar.h > >Modified: head/sys/dev/iwm/if_iwm.c >============================================================================== >--- head/sys/dev/iwm/if_iwm.c Tue Apr 26 03:24:28 2016 (r298611) >+++ head/sys/dev/iwm/if_iwm.c Tue Apr 26 04:40:59 2016 (r298612) >@@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1) > static int > iwm_resume(device_t dev) > { >+ struct iwm_softc *sc = device_get_softc(dev); >+ int do_reinit = 0; > uint16_t reg; > > /* Clear device-specific "PCI retry timeout" register (41h). */ >@@ -4941,17 +4943,33 @@ iwm_resume(device_t dev) > pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); > iwm_init_task(device_get_softc(dev)); > >+ IWM_LOCK(sc); >+ if (sc->sc_flags & IWM_FLAG_DORESUME) { >+ sc->sc_flags &= ~IWM_FLAG_DORESUME; >+ do_reinit = 1; >+ } >+ IWM_UNLOCK(sc); >+ >+ if (do_reinit) >+ ieee80211_resume_all(&sc->sc_ic); >+ > return 0; > } > > static int > iwm_suspend(device_t dev) > { >+ int do_stop = 0; > struct iwm_softc *sc = device_get_softc(dev); > >- if (sc->sc_ic.ic_nrunning > 0) { >+ do_stop = !! (sc->sc_ic.ic_nrunning > 0); >+ >+ ieee80211_suspend_all(&sc->sc_ic); >+ >+ if (do_stop) { > IWM_LOCK(sc); > iwm_stop(sc); >+ sc->sc_flags |= IWM_FLAG_DORESUME; > IWM_UNLOCK(sc); > } > > >Modified: head/sys/dev/iwm/if_iwmvar.h >============================================================================== >--- head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 03:24:28 2016 (r298611) >+++ head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 04:40:59 2016 (r298612) >@@ -405,6 +405,7 @@ struct iwm_softc { > #define IWM_FLAG_STOPPED (1 << 2) > #define IWM_FLAG_RFKILL (1 << 3) > #define IWM_FLAG_BUSY (1 << 4) >+#define IWM_FLAG_DORESUME (1 << 5) > > struct intr_config_hook sc_preinit_hook; > struct callout sc_watchdog_to; > From owner-svn-src-head@freebsd.org Tue Apr 26 04:48:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AED8B1D083; Tue, 26 Apr 2016 04:48:59 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F28D719A3; Tue, 26 Apr 2016 04:48:58 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3Q4mwCf048780; Tue, 26 Apr 2016 04:48:58 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q4mwtL048779; Tue, 26 Apr 2016 04:48:58 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604260448.u3Q4mwtL048779@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 26 Apr 2016 04:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298613 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 04:48:59 -0000 Author: sephe Date: Tue Apr 26 04:48:57 2016 New Revision: 298613 URL: https://svnweb.freebsd.org/changeset/base/298613 Log: hyperv/stor: Remove the useless hs_open_multi_channel This fixes the sub-channel offer race after Hyper-V device probe/attach is moved to vmbus SYSINIT/attach. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 26 04:40:59 2016 (r298612) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 26 04:48:57 2016 (r298613) @@ -140,7 +140,6 @@ struct storvsc_softc { uint32_t hs_num_out_reqs; boolean_t hs_destroy; boolean_t hs_drain_notify; - boolean_t hs_open_multi_channel; struct sema hs_drain_sema; struct hv_storvsc_request hs_init_req; struct hv_storvsc_request hs_reset_req; @@ -336,9 +335,6 @@ storvsc_handle_sc_creation(void *context if (sc == NULL) return; - if (FALSE == sc->hs_open_multi_channel) - return; - memset(&props, 0, sizeof(props)); ret = hv_vmbus_channel_open(new_channel, @@ -417,8 +413,6 @@ storvsc_send_multichannel_request(struct return; } - sc->hs_open_multi_channel = TRUE; - if (bootverbose) printf("Storvsc create multi-channel success!\n"); } @@ -1034,7 +1028,6 @@ storvsc_attach(device_t dev) sc->hs_destroy = FALSE; sc->hs_drain_notify = FALSE; - sc->hs_open_multi_channel = FALSE; sema_init(&sc->hs_drain_sema, 0, "Store Drain Sema"); ret = hv_storvsc_connect_vsp(hv_dev); From owner-svn-src-head@freebsd.org Tue Apr 26 05:00:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0790AB1D266; Tue, 26 Apr 2016 05:00:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C53741E56; Tue, 26 Apr 2016 05:00:41 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3Q50eb3051830; Tue, 26 Apr 2016 05:00:40 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q50eiV051828; Tue, 26 Apr 2016 05:00:40 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604260500.u3Q50eiV051828@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 26 Apr 2016 05:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298614 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 05:00:42 -0000 Author: sephe Date: Tue Apr 26 05:00:40 2016 New Revision: 298614 URL: https://svnweb.freebsd.org/changeset/base/298614 Log: hyperv/stor: Synchronize sub-channel offers MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 26 04:48:57 2016 (r298613) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 26 05:00:40 2016 (r298614) @@ -357,6 +357,7 @@ storvsc_handle_sc_creation(void *context static void storvsc_send_multichannel_request(struct hv_device *dev, int max_chans) { + struct hv_vmbus_channel **subchan; struct storvsc_softc *sc; struct hv_storvsc_request *request; struct vstor_packet *vstor_packet; @@ -413,6 +414,12 @@ storvsc_send_multichannel_request(struct return; } + /* + * Wait for sub-channels setup to complete. + */ + subchan = vmbus_get_subchan(dev->channel, request_channels_cnt); + vmbus_rel_subchan(subchan, request_channels_cnt); + if (bootverbose) printf("Storvsc create multi-channel success!\n"); } From owner-svn-src-head@freebsd.org Tue Apr 26 05:08:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0F70B1D300; Tue, 26 Apr 2016 05:08:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7627C123F; Tue, 26 Apr 2016 05:08:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3Q58t2d054896; Tue, 26 Apr 2016 05:08:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q58tGT054892; Tue, 26 Apr 2016 05:08:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604260508.u3Q58tGT054892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 26 Apr 2016 05:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298615 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 05:08:56 -0000 Author: sephe Date: Tue Apr 26 05:08:55 2016 New Revision: 298615 URL: https://svnweb.freebsd.org/changeset/base/298615 Log: hyperv/hn: Avoid sub-channel creation callback. Since the sub-channel offers are synchronized, we can do our own channel setup without using the sub-channel creation callback. This paves the way to whack the sub-channel creation callback. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c head/sys/dev/hyperv/netvsc/hv_rndis.h Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Apr 26 05:00:40 2016 (r298614) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.c Tue Apr 26 05:08:55 2016 (r298615) @@ -661,30 +661,12 @@ hv_nv_disconnect_from_vsp(netvsc_dev *ne hv_nv_destroy_send_buffer(net_dev); } -/* - * Callback handler for subchannel offer - * @@param context new subchannel - */ -static void -hv_nv_subchan_callback(void *xchan) +void +hv_nv_subchan_attach(struct hv_vmbus_channel *chan) { - struct hv_vmbus_channel *chan = xchan; - netvsc_dev *net_dev; - uint16_t chn_index = chan->offer_msg.offer.sub_channel_index; - struct hv_device *device = chan->device; - hn_softc_t *sc = device_get_softc(device->device); - int ret; - - net_dev = sc->net_dev; - - if (chn_index >= net_dev->num_channel) { - /* Would this ever happen? */ - return; - } - netvsc_subchan_callback(sc, chan); chan->hv_chan_rdbuf = malloc(NETVSC_PACKET_SIZE, M_NETVSC, M_WAITOK); - ret = hv_vmbus_channel_open(chan, NETVSC_DEVICE_RING_BUFFER_SIZE, + hv_vmbus_channel_open(chan, NETVSC_DEVICE_RING_BUFFER_SIZE, NETVSC_DEVICE_RING_BUFFER_SIZE, NULL, 0, hv_nv_on_channel_callback, chan); } @@ -721,7 +703,6 @@ hv_nv_on_device_add(struct hv_device *de free(chan->hv_chan_rdbuf, M_NETVSC); goto cleanup; } - chan->sc_creation_callback = hv_nv_subchan_callback; /* * Connect with the NetVsp Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Apr 26 05:00:40 2016 (r298614) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Tue Apr 26 05:08:55 2016 (r298615) @@ -1266,6 +1266,7 @@ int hv_nv_on_device_remove(struct hv_dev boolean_t destroy_channel); int hv_nv_on_send(struct hv_vmbus_channel *chan, netvsc_packet *pkt); int hv_nv_get_next_send_section(netvsc_dev *net_dev); +void hv_nv_subchan_attach(struct hv_vmbus_channel *chan); #endif /* __HV_NET_VSC_H__ */ Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Apr 26 05:00:40 2016 (r298614) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Apr 26 05:08:55 2016 (r298615) @@ -332,6 +332,7 @@ static void hn_create_rx_data(struct hn_ static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_tx_chimney_size(struct hn_softc *, int); static void hn_channel_attach(struct hn_softc *, struct hv_vmbus_channel *); +static void hn_subchan_attach(struct hn_softc *, struct hv_vmbus_channel *); static int hn_transmit(struct ifnet *, struct mbuf *); static void hn_xmit_qflush(struct ifnet *); @@ -547,19 +548,6 @@ netvsc_attach(device_t dev) error = hv_rf_on_device_add(device_ctx, &device_info, ring_cnt); if (error) goto failed; - - if (sc->net_dev->num_channel > 1) { - struct hv_vmbus_channel **subchan; - int subchan_cnt = sc->net_dev->num_channel - 1; - - /* - * Wait for sub-channels setup to complete. - */ - subchan = vmbus_get_subchan(pri_chan, subchan_cnt); - vmbus_rel_subchan(subchan, subchan_cnt); - device_printf(dev, "%d sub-channels setup done\n", subchan_cnt); - } - KASSERT(sc->net_dev->num_channel > 0 && sc->net_dev->num_channel <= sc->hn_rx_ring_inuse, ("invalid channel count %u, should be less than %d", @@ -575,6 +563,26 @@ netvsc_attach(device_t dev) device_printf(dev, "%d TX ring, %d RX ring\n", sc->hn_tx_ring_inuse, sc->hn_rx_ring_inuse); + if (sc->net_dev->num_channel > 1) { + struct hv_vmbus_channel **subchan; + int subchan_cnt = sc->net_dev->num_channel - 1; + int i; + + /* Wait for sub-channels setup to complete. */ + subchan = vmbus_get_subchan(pri_chan, subchan_cnt); + + /* Attach the sub-channels. */ + for (i = 0; i < subchan_cnt; ++i) { + /* NOTE: Calling order is critical. */ + hn_subchan_attach(sc, subchan[i]); + hv_nv_subchan_attach(subchan[i]); + } + + /* Release the sub-channels */ + vmbus_rel_subchan(subchan, subchan_cnt); + device_printf(dev, "%d sub-channels setup done\n", subchan_cnt); + } + #if __FreeBSD_version >= 1100099 if (sc->hn_rx_ring_inuse > 1) { /* @@ -2867,8 +2875,8 @@ hn_channel_attach(struct hn_softc *sc, s vmbus_channel_cpu_set(chan, (sc->hn_cpu + idx) % mp_ncpus); } -void -netvsc_subchan_callback(struct hn_softc *sc, struct hv_vmbus_channel *chan) +static void +hn_subchan_attach(struct hn_softc *sc, struct hv_vmbus_channel *chan) { KASSERT(!HV_VMBUS_CHAN_ISPRIMARY(chan), Modified: head/sys/dev/hyperv/netvsc/hv_rndis.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_rndis.h Tue Apr 26 05:00:40 2016 (r298614) +++ head/sys/dev/hyperv/netvsc/hv_rndis.h Tue Apr 26 05:08:55 2016 (r298615) @@ -1068,8 +1068,6 @@ struct hv_vmbus_channel; int netvsc_recv(struct hv_vmbus_channel *chan, netvsc_packet *packet, rndis_tcp_ip_csum_info *csum_info); void netvsc_channel_rollup(struct hv_vmbus_channel *chan); -void netvsc_subchan_callback(struct hn_softc *sc, - struct hv_vmbus_channel *chan); void* hv_set_rppi_data(rndis_msg *rndis_mesg, uint32_t rppi_size, From owner-svn-src-head@freebsd.org Tue Apr 26 05:15:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E14E2B1D45F; Tue, 26 Apr 2016 05:15:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 986001793; Tue, 26 Apr 2016 05:15:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3Q5FFYw057858; Tue, 26 Apr 2016 05:15:15 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q5FFS4057857; Tue, 26 Apr 2016 05:15:15 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604260515.u3Q5FFS4057857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 26 Apr 2016 05:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298616 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 05:15:17 -0000 Author: sephe Date: Tue Apr 26 05:15:15 2016 New Revision: 298616 URL: https://svnweb.freebsd.org/changeset/base/298616 Log: hyperv/stor: Avoid sub-channel creation callback. Since the sub-channel offers are synchronized, we can do our own channel setup without using the sub-channel creation callback. This paves the way to whack the sub-channel creation callback. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 26 05:08:55 2016 (r298615) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 26 05:15:15 2016 (r298616) @@ -315,21 +315,14 @@ get_stor_device(struct hv_device *device return sc; } -/** - * @brief Callback handler, will be invoked when receive mutil-channel offer - * - * @param context new multi-channel - */ static void -storvsc_handle_sc_creation(void *context) +storvsc_subchan_attach(struct hv_vmbus_channel *new_channel) { - hv_vmbus_channel *new_channel; struct hv_device *device; struct storvsc_softc *sc; struct vmstor_chan_props props; int ret = 0; - new_channel = (hv_vmbus_channel *)context; device = new_channel->device; sc = get_stor_device(device, TRUE); if (sc == NULL) @@ -362,7 +355,7 @@ storvsc_send_multichannel_request(struct struct hv_storvsc_request *request; struct vstor_packet *vstor_packet; int request_channels_cnt = 0; - int ret; + int ret, i; /* get multichannels count that need to create */ request_channels_cnt = MIN(max_chans, mp_ncpus); @@ -376,9 +369,6 @@ storvsc_send_multichannel_request(struct request = &sc->hs_init_req; - /* Establish a handler for multi-channel */ - dev->channel->sc_creation_callback = storvsc_handle_sc_creation; - /* request the host to create multi-channel */ memset(request, 0, sizeof(struct hv_storvsc_request)); @@ -414,10 +404,14 @@ storvsc_send_multichannel_request(struct return; } - /* - * Wait for sub-channels setup to complete. - */ + /* Wait for sub-channels setup to complete. */ subchan = vmbus_get_subchan(dev->channel, request_channels_cnt); + + /* Attach the sub-channels. */ + for (i = 0; i < request_channels_cnt; ++i) + storvsc_subchan_attach(subchan[i]); + + /* Release the sub-channels. */ vmbus_rel_subchan(subchan, request_channels_cnt); if (bootverbose) From owner-svn-src-head@freebsd.org Tue Apr 26 05:21:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01216B1D661; Tue, 26 Apr 2016 05:21:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE4AF1A9B; Tue, 26 Apr 2016 05:21:28 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3Q5LRRN058099; Tue, 26 Apr 2016 05:21:27 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q5LRns058096; Tue, 26 Apr 2016 05:21:27 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604260521.u3Q5LRns058096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 26 Apr 2016 05:21:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298617 - in head/sys/dev/hyperv: include vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 05:21:29 -0000 Author: sephe Date: Tue Apr 26 05:21:27 2016 New Revision: 298617 URL: https://svnweb.freebsd.org/changeset/base/298617 Log: hyperv/channel: Git rid of the sub-channel creation callback It is no longer used. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/include/hyperv.h head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Modified: head/sys/dev/hyperv/include/hyperv.h ============================================================================== --- head/sys/dev/hyperv/include/hyperv.h Tue Apr 26 05:15:15 2016 (r298616) +++ head/sys/dev/hyperv/include/hyperv.h Tue Apr 26 05:21:27 2016 (r298617) @@ -691,7 +691,6 @@ typedef struct { } hv_vmbus_ring_buffer_info; typedef void (*hv_vmbus_pfn_channel_callback)(void *context); -typedef void (*hv_vmbus_sc_creation_callback)(void *context); typedef enum { HV_CHANNEL_OFFER_STATE, @@ -804,13 +803,6 @@ typedef struct hv_vmbus_channel { * response on the same channel. */ - /* - * Multi-channel creation callback. This callback will be called in - * process context when a Multi-channel offer is received from the host. - * The guest can open the Multi-channel in the context of this callback. - */ - hv_vmbus_sc_creation_callback sc_creation_callback; - struct mtx sc_lock; /* Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Tue Apr 26 05:15:15 2016 (r298616) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Tue Apr 26 05:21:27 2016 (r298617) @@ -618,7 +618,6 @@ hv_vmbus_channel_close_internal(hv_vmbus hv_vmbus_channel_msg_info* info; channel->state = HV_CHANNEL_OPEN_STATE; - channel->sc_creation_callback = NULL; /* * set rxq to NULL to avoid more requests be scheduled Modified: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Tue Apr 26 05:15:15 2016 (r298616) +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c Tue Apr 26 05:21:27 2016 (r298617) @@ -237,8 +237,6 @@ vmbus_channel_process_offer(hv_vmbus_cha new_channel, new_channel->primary_channel); new_channel->state = HV_CHANNEL_OPEN_STATE; - if (channel->sc_creation_callback != NULL) - channel->sc_creation_callback(new_channel); /* * Bump up sub-channel count and notify anyone that is From owner-svn-src-head@freebsd.org Tue Apr 26 05:21:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A628B1D695 for ; Tue, 26 Apr 2016 05:21:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001: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 2D99A1C6F for ; Tue, 26 Apr 2016 05:21:46 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id f89so6096354ioi.0 for ; Mon, 25 Apr 2016 22:21:46 -0700 (PDT) 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; bh=PEr7DenyAhSq329YOKPaUB/KP4LdqFkVy3d4Ik7hxSA=; b=bXWMlESg4AAVO2FhNmO6K5DYCU9VRQRSpev12Vy86iHa1+D8E1p8Y6N4/8o5VcZemN 14tU+JRnKqjlhIyfdz22n+zOxI6HZgmYRzW0fYwWD7LsdOyWbr6VsecW5kCoCqI5P3+F Ie3cfjsTvqA2k1e5viT1z772NGGD3kBwaB0dBk+Nobc7pdb0MaKuXPIsxefeERkPwaIW trpepF2ItGoruyteYWvBS0jf1vMwLjoBKaUGzLwoS6gd9d2ITUfj3KSET8sG1USZViBa wa4A7XLDcVJfKIYa0T2Ylaq4h+3+bb3uTPFpApbyCYn+c4jQ/yKfoFJdNanID6vu15Gw lIRA== 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; bh=PEr7DenyAhSq329YOKPaUB/KP4LdqFkVy3d4Ik7hxSA=; b=GNJK23g1XN2Bb1k4Pi4PxT6is4fiz7cty1Zch3HfrePVZG1XAyCKJ0KMxvMCskQk02 N+GvfLY5yeXWb8LXZsdsdYxMjeBe/Uoc1d0auYzg0zewzBhthzrwYntRv6npgsenb1Ji jdgKETTZeXYm9D/xjHU5E3qMSh/ufcilV0lQGV5jNKgwAOa+Cf2kmt0/uBnfQwVkpeAQ AHYQm33xtOZJJ7WWXdHE6C/0R1cj1SidNpBrUjuCmfoGmzcpN4ptoQhRPhjGHtN5REfj 3SDxTk1xSQ3iMXfk5YtYkPZhUGG9qjp6SZk6/xeXliNWg40Y2dz66xa11OHSOYdItXmQ BgQg== X-Gm-Message-State: AOPr4FV3sVCtIKvvc6qwIKAyBj7b3FGy924l3dFyVy4aHB0Ffs4oHovtRicQH3Yd4bKe+l4HIYF9p9LNdbm4VA== MIME-Version: 1.0 X-Received: by 10.107.40.9 with SMTP id o9mr1073915ioo.183.1461648105584; Mon, 25 Apr 2016 22:21:45 -0700 (PDT) Sender: wlosh@bsdimp.com Received: by 10.79.104.197 with HTTP; Mon, 25 Apr 2016 22:21:45 -0700 (PDT) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201604260440.u3Q4exZD045896@repo.freebsd.org> Date: Mon, 25 Apr 2016 23:21:45 -0600 X-Google-Sender-Auth: -eobxNpf6QmMxxobWwS81NtaxVY Message-ID: Subject: Re: svn commit: r298612 - head/sys/dev/iwm From: Warner Losh To: Ravi Pokala Cc: Adrian Chadd , src-committers , "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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 05:21:46 -0000 On Mon, Apr 25, 2016 at 10:45 PM, Ravi Pokala wrote: > > do_stop = !! (sc->sc_ic.ic_nrunning > 0); > > Why the double-negation? Isn't > > do_stop = (sc->sc_ic.ic_nrunning > 0); > > equivalent? > It is. However the !! style is from Linux. It converts a bit value to a 0/1 value. Since foo > 0 already is a Boolean, it isn't needed here. Warner > -Ravi (rpokala@) > > > > -----Original Message----- > From: on behalf of Adrian Chadd > > Date: 2016-04-25, Monday at 21:40 > To: , , < > svn-src-head@freebsd.org> > Subject: svn commit: r298612 - head/sys/dev/iwm > > >Author: adrian > >Date: Tue Apr 26 04:40:59 2016 > >New Revision: 298612 > >URL: https://svnweb.freebsd.org/changeset/base/298612 > > > >Log: > > [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all > > > > This allows wifi to associate correctly after a suspend/resume cycle. > > > > Yes, I'm using this now day to day. > > > > Tested: > > > > * Intel 7260AC, STA mode > > > >Modified: > > head/sys/dev/iwm/if_iwm.c > > head/sys/dev/iwm/if_iwmvar.h > > > >Modified: head/sys/dev/iwm/if_iwm.c > > >============================================================================== > >--- head/sys/dev/iwm/if_iwm.c Tue Apr 26 03:24:28 2016 (r298611) > >+++ head/sys/dev/iwm/if_iwm.c Tue Apr 26 04:40:59 2016 (r298612) > >@@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1) > > static int > > iwm_resume(device_t dev) > > { > >+ struct iwm_softc *sc = device_get_softc(dev); > >+ int do_reinit = 0; > > uint16_t reg; > > > > /* Clear device-specific "PCI retry timeout" register (41h). */ > >@@ -4941,17 +4943,33 @@ iwm_resume(device_t dev) > > pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); > > iwm_init_task(device_get_softc(dev)); > > > >+ IWM_LOCK(sc); > >+ if (sc->sc_flags & IWM_FLAG_DORESUME) { > >+ sc->sc_flags &= ~IWM_FLAG_DORESUME; > >+ do_reinit = 1; > >+ } > >+ IWM_UNLOCK(sc); > >+ > >+ if (do_reinit) > >+ ieee80211_resume_all(&sc->sc_ic); > >+ > > return 0; > > } > > > > static int > > iwm_suspend(device_t dev) > > { > >+ int do_stop = 0; > > struct iwm_softc *sc = device_get_softc(dev); > > > >- if (sc->sc_ic.ic_nrunning > 0) { > >+ do_stop = !! (sc->sc_ic.ic_nrunning > 0); > >+ > >+ ieee80211_suspend_all(&sc->sc_ic); > >+ > >+ if (do_stop) { > > IWM_LOCK(sc); > > iwm_stop(sc); > >+ sc->sc_flags |= IWM_FLAG_DORESUME; > > IWM_UNLOCK(sc); > > } > > > > > >Modified: head/sys/dev/iwm/if_iwmvar.h > > >============================================================================== > >--- head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 03:24:28 2016 > (r298611) > >+++ head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 04:40:59 2016 > (r298612) > >@@ -405,6 +405,7 @@ struct iwm_softc { > > #define IWM_FLAG_STOPPED (1 << 2) > > #define IWM_FLAG_RFKILL (1 << 3) > > #define IWM_FLAG_BUSY (1 << 4) > >+#define IWM_FLAG_DORESUME (1 << 5) > > > > struct intr_config_hook sc_preinit_hook; > > struct callout sc_watchdog_to; > > > > > From owner-svn-src-head@freebsd.org Tue Apr 26 06:27:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB1E8B1D331; Tue, 26 Apr 2016 06:27:28 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (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 6C3DA186F; Tue, 26 Apr 2016 06:27:27 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f67.google.com with SMTP id p64so758837lfg.0; Mon, 25 Apr 2016 23:27:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=4kWN1lS7ihjAQSFlbtJzeC1XtI9ATejUTbSJuAD7xRI=; b=RbmxfdEQ14i8j7g5YDEPlJA+hOuLiSLSGYYEawxsrQ7mBsqliHI2w06+J2F0Du/xtm uJ2Ys2nuzHN3buAS8NEmc9genhHWB8wjKaBl6WzbQNS0GUq8YLRKnKNBT8lb+cyB6o3R MD0ssfIoIqYyuMp1/XsVl1Q812CeRbFr3FKWYB2RVCQIYskRXCQ9qyf5N6DY5aHuEex6 o2LpI9/U9akGEOXoQo4K+qDiyrE/PbMENB7yZweG0gAsy50OTw0Z0KVp7d4q1kdCboha 9biaclZqJ1X0y5ULUBF5zPOO5FPfTyaWOx54W9Wwhc4fmqQTDpfpppHsoQlqG+yDo7rJ BLSg== X-Gm-Message-State: AOPr4FU1KPzZy/W0LB8tIsqLpmiVWOOfTylgetFKDc2LONCDNpnxgI7a+by5FApGD8VpUQ== X-Received: by 10.25.212.82 with SMTP id l79mr428525lfg.72.1461652040517; Mon, 25 Apr 2016 23:27:20 -0700 (PDT) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id xg1sm5044258lbb.10.2016.04.25.23.27.19 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 25 Apr 2016 23:27:19 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Adrian Chadd" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298612 - head/sys/dev/iwm References: <201604260440.u3Q4exZD045896@repo.freebsd.org> Date: Tue, 26 Apr 2016 09:27:12 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201604260440.u3Q4exZD045896@repo.freebsd.org> User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 06:27:29 -0000 Tue, 26 Apr 2016 07:40:59 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd = : > Author: adrian > Date: Tue Apr 26 04:40:59 2016 > New Revision: 298612 > URL: https://svnweb.freebsd.org/changeset/base/298612 > > Log: > [iwm] implement suspend/resume through ieee80211_{suspend,resume}_al= l > This allows wifi to associate correctly after a suspend/resume cycle.= > Yes, I'm using this now day to day. > Tested: > * Intel 7260AC, STA mode > > Modified: > head/sys/dev/iwm/if_iwm.c > head/sys/dev/iwm/if_iwmvar.h > > Modified: head/sys/dev/iwm/if_iwm.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/dev/iwm/if_iwm.c Tue Apr 26 03:24:28 2016 (r298611) > +++ head/sys/dev/iwm/if_iwm.c Tue Apr 26 04:40:59 2016 (r298612) > @@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1) > static int > iwm_resume(device_t dev) > { > + struct iwm_softc *sc =3D device_get_softc(dev); > + int do_reinit =3D 0; > uint16_t reg; > /* Clear device-specific "PCI retry timeout" register (41h). */ > @@ -4941,17 +4943,33 @@ iwm_resume(device_t dev) > pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); > iwm_init_task(device_get_softc(dev)); > + IWM_LOCK(sc); > + if (sc->sc_flags & IWM_FLAG_DORESUME) { > + sc->sc_flags &=3D ~IWM_FLAG_DORESUME; > + do_reinit =3D 1; If no vap was running, then nothing will be started (because of IEEE80211_FEXT_RESUME flag). > + } > + IWM_UNLOCK(sc); > + > + if (do_reinit) > + ieee80211_resume_all(&sc->sc_ic); AFAIK, suspend_all() / resume_all() should work without any additional logic (except (?) device-specific PCI registers (41h) pre-setup on resume). > + > return 0; > } > static int > iwm_suspend(device_t dev) > { > + int do_stop =3D 0; > struct iwm_softc *sc =3D device_get_softc(dev); > - if (sc->sc_ic.ic_nrunning > 0) { > + do_stop =3D !! (sc->sc_ic.ic_nrunning > 0); > + > + ieee80211_suspend_all(&sc->sc_ic); > + > + if (do_stop) { > IWM_LOCK(sc); > iwm_stop(sc); Is it really needed? (iwm_stop() will be already executed when the last = vap will be stopped + suspend_resume() waits for ic_parent method). > + sc->sc_flags |=3D IWM_FLAG_DORESUME; > IWM_UNLOCK(sc); > } > > Modified: head/sys/dev/iwm/if_iwmvar.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 03:24:28 2016 (r298611) > +++ head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 04:40:59 2016 (r298612) > @@ -405,6 +405,7 @@ struct iwm_softc { > #define IWM_FLAG_STOPPED (1 << 2) > #define IWM_FLAG_RFKILL (1 << 3) > #define IWM_FLAG_BUSY (1 << 4) > +#define IWM_FLAG_DORESUME (1 << 5) > struct intr_config_hook sc_preinit_hook; > struct callout sc_watchdog_to; From owner-svn-src-head@freebsd.org Tue Apr 26 06:41:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D61FAB1DB01; Tue, 26 Apr 2016 06:41:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5FC2178F; Tue, 26 Apr 2016 06:41:37 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3Q6fa1S081887; Tue, 26 Apr 2016 06:41:36 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q6fawZ081886; Tue, 26 Apr 2016 06:41:36 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604260641.u3Q6fawZ081886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 26 Apr 2016 06:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298618 - head/sys/dev/hyperv/storvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 06:41:37 -0000 Author: sephe Date: Tue Apr 26 06:41:36 2016 New Revision: 298618 URL: https://svnweb.freebsd.org/changeset/base/298618 Log: hyperv/stor: Set description properly in probe devmethod MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 26 05:21:27 2016 (r298617) +++ head/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Tue Apr 26 06:41:36 2016 (r298618) @@ -924,6 +924,7 @@ storvsc_probe(device_t dev) if(bootverbose) device_printf(dev, "Enlightened ATA/IDE detected\n"); + device_set_desc(dev, g_drv_props_table[DRIVER_BLKVSC].drv_desc); ret = BUS_PROBE_DEFAULT; } else if(bootverbose) device_printf(dev, "Emulated ATA/IDE set (hw.ata.disk_enable set)\n"); @@ -931,6 +932,7 @@ storvsc_probe(device_t dev) case DRIVER_STORVSC: if(bootverbose) device_printf(dev, "Enlightened SCSI device detected\n"); + device_set_desc(dev, g_drv_props_table[DRIVER_STORVSC].drv_desc); ret = BUS_PROBE_DEFAULT; break; default: @@ -982,7 +984,6 @@ storvsc_attach(device_t dev) /* fill in device specific properties */ sc->hs_unit = device_get_unit(dev); sc->hs_dev = hv_dev; - device_set_desc(dev, g_drv_props_table[stor_type].drv_desc); LIST_INIT(&sc->hs_free_list); mtx_init(&sc->hs_lock, "hvslck", NULL, MTX_DEF); From owner-svn-src-head@freebsd.org Tue Apr 26 06:50:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1B89B1DE56; Tue, 26 Apr 2016 06:50:39 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80BC21C1D; Tue, 26 Apr 2016 06:50:39 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3Q6ockO084911; Tue, 26 Apr 2016 06:50:38 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q6ocGh084910; Tue, 26 Apr 2016 06:50:38 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201604260650.u3Q6ocGh084910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Tue, 26 Apr 2016 06:50:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298619 - head/sys/geom/uzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 06:50:39 -0000 Author: sobomax Date: Tue Apr 26 06:50:38 2016 New Revision: 298619 URL: https://svnweb.freebsd.org/changeset/base/298619 Log: Relax TOC offsets checking somewhat, allowing offset pointing to the next byte past EOF to denote zero-block(s) at the very end of the file. Modified: head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Apr 26 06:41:36 2016 (r298618) +++ head/sys/geom/uzip/g_uzip.c Tue Apr 26 06:50:38 2016 (r298619) @@ -492,7 +492,7 @@ g_uzip_parse_toc(struct g_uzip_softc *sc for (i = 0; i < sc->nblocks; i++) { /* First do some bounds checking */ if ((sc->toc[i].offset < min_offset) || - (sc->toc[i].offset >= pp->mediasize)) { + (sc->toc[i].offset > pp->mediasize)) { goto error_offset; } DPRINTF_BLK(GUZ_DBG_IO, i, ("%s: cluster #%u " @@ -711,6 +711,11 @@ g_uzip_taste(struct g_class *mp, struct sc->nblocks < offsets_read ? "more" : "less")); goto e5; } + /* + * "Fake" last+1 block, to make it easier for the TOC parser to + * iterate without making the last element a special case. + */ + sc->toc[sc->nblocks].offset = pp->mediasize; /* Massage TOC (table of contents), make sure it is sound */ if (g_uzip_parse_toc(sc, pp, gp) != 0) { DPRINTF(GUZ_DBG_ERR, ("%s: TOC error\n", gp->name)); From owner-svn-src-head@freebsd.org Tue Apr 26 06:50:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E0BB1DE64; Tue, 26 Apr 2016 06:50:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 253371C26; Tue, 26 Apr 2016 06:50:42 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3Q6ofSR084956; Tue, 26 Apr 2016 06:50:41 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3Q6ofnd084955; Tue, 26 Apr 2016 06:50:41 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604260650.u3Q6ofnd084955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Tue, 26 Apr 2016 06:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298620 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 06:50:42 -0000 Author: sephe Date: Tue Apr 26 06:50:41 2016 New Revision: 298620 URL: https://svnweb.freebsd.org/changeset/base/298620 Log: hyperv/hn: Change description to "Hyper-V Network Interface" This is consistent w/ other Hyper-V devices. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Apr 26 06:50:38 2016 (r298619) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Tue Apr 26 06:50:41 2016 (r298620) @@ -402,7 +402,7 @@ netvsc_probe(device_t dev) p = vmbus_get_type(dev); if (!memcmp(p, &g_net_vsc_device_type.data, sizeof(hv_guid))) { - device_set_desc(dev, "Synthetic Network Interface"); + device_set_desc(dev, "Hyper-V Network Interface"); if (bootverbose) printf("Netvsc probe... DONE \n"); From owner-svn-src-head@freebsd.org Tue Apr 26 10:04:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 727DFB1C34D; Tue, 26 Apr 2016 10:04:07 +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 2A18F1A50; Tue, 26 Apr 2016 10:04:07 +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 u3QA46wr044465; Tue, 26 Apr 2016 10:04:06 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QA46sY044464; Tue, 26 Apr 2016 10:04:06 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201604261004.u3QA46sY044464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Tue, 26 Apr 2016 10:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298624 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 10:04:07 -0000 Author: ed Date: Tue Apr 26 10:04:06 2016 New Revision: 298624 URL: https://svnweb.freebsd.org/changeset/base/298624 Log: Remove unportable calls to basename(). The POSIX version of basename() doesn't use a 'const char *' argument; the function may overwrite its input buffer. Instead of copying the input string, let's just simplify this code by using our getprogname() function that already returns the name of the application in the right format. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D6094 Modified: head/usr.sbin/bsdinstall/partedit/partedit.c Modified: head/usr.sbin/bsdinstall/partedit/partedit.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit.c Tue Apr 26 07:47:01 2016 (r298623) +++ head/usr.sbin/bsdinstall/partedit/partedit.c Tue Apr 26 10:04:06 2016 (r298624) @@ -27,15 +27,15 @@ */ #include -#include -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include +#include +#include #include "diskeditor.h" #include "partedit.h" @@ -71,13 +71,14 @@ int main(int argc, const char **argv) { struct partition_metadata *md; - const char *prompt; + const char *progname, *prompt; struct partedit_item *items = NULL; struct gmesh mesh; int i, op, nitems, nscroll; int error; - if (strcmp(basename(argv[0]), "sade") == 0) + progname = getprogname(); + if (strcmp(progname, "sade") == 0) sade_mode = 1; TAILQ_INIT(&part_metadata); @@ -93,7 +94,7 @@ main(int argc, const char **argv) /* Revert changes on SIGINT */ signal(SIGINT, sigint_handler); - if (strcmp(basename(argv[0]), "autopart") == 0) { /* Guided */ + if (strcmp(progname, "autopart") == 0) { /* Guided */ prompt = "Please review the disk setup. When complete, press " "the Finish button."; /* Experimental ZFS autopartition support */ @@ -102,7 +103,7 @@ main(int argc, const char **argv) } else { part_wizard("ufs"); } - } else if (strcmp(basename(argv[0]), "scriptedpart") == 0) { + } else if (strcmp(progname, "scriptedpart") == 0) { error = scripted_editor(argc, argv); prompt = NULL; if (error != 0) { From owner-svn-src-head@freebsd.org Tue Apr 26 11:15:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E6F3B1B175; Tue, 26 Apr 2016 11:15:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E7FA18B8; Tue, 26 Apr 2016 11:15:49 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3QBFmaY065721; Tue, 26 Apr 2016 11:15:48 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QBFm59065718; Tue, 26 Apr 2016 11:15:48 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201604261115.u3QBFm59065718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Tue, 26 Apr 2016 11:15:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298625 - in head/sys/arm: allwinner allwinner/a10 conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 11:15:49 -0000 Author: manu Date: Tue Apr 26 11:15:48 2016 New Revision: 298625 URL: https://svnweb.freebsd.org/changeset/base/298625 Log: Convert A10 interrupt controller to INTRNG Reviewed by: skra Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D5573 Added: head/sys/arm/allwinner/a10/ head/sys/arm/allwinner/a10/a10_intc.c - copied, changed from r298624, head/sys/arm/allwinner/aintc.c Deleted: head/sys/arm/allwinner/aintc.c Modified: head/sys/arm/allwinner/files.a10 head/sys/arm/conf/A10 Copied and modified: head/sys/arm/allwinner/a10/a10_intc.c (from r298624, head/sys/arm/allwinner/aintc.c) ============================================================================== --- head/sys/arm/allwinner/aintc.c Tue Apr 26 10:04:06 2016 (r298624, copy source) +++ head/sys/arm/allwinner/a10/a10_intc.c Tue Apr 26 11:15:48 2016 (r298625) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012 Ganbold Tsagaankhuu + * Copyright (c) 2016 Emmanuel Vadot * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,13 +28,24 @@ #include __FBSDID("$FreeBSD$"); -#include -#include +#include "opt_platform.h" + +#include #include +#include #include #include #include +#include +#include +#include +#include #include +#include +#include +#ifdef INTRNG +#include +#endif #include #include @@ -42,63 +54,288 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef INTRNG +#include "pic_if.h" +#endif + /** * Interrupt controller registers * */ -#define SW_INT_VECTOR_REG 0x00 -#define SW_INT_BASE_ADR_REG 0x04 -#define SW_INT_PROTECTION_REG 0x08 -#define SW_INT_NMI_CTRL_REG 0x0c - -#define SW_INT_IRQ_PENDING_REG0 0x10 -#define SW_INT_IRQ_PENDING_REG1 0x14 -#define SW_INT_IRQ_PENDING_REG2 0x18 - -#define SW_INT_FIQ_PENDING_REG0 0x20 -#define SW_INT_FIQ_PENDING_REG1 0x24 -#define SW_INT_FIQ_PENDING_REG2 0x28 - -#define SW_INT_SELECT_REG0 0x30 -#define SW_INT_SELECT_REG1 0x34 -#define SW_INT_SELECT_REG2 0x38 - -#define SW_INT_ENABLE_REG0 0x40 -#define SW_INT_ENABLE_REG1 0x44 -#define SW_INT_ENABLE_REG2 0x48 - -#define SW_INT_MASK_REG0 0x50 -#define SW_INT_MASK_REG1 0x54 -#define SW_INT_MASK_REG2 0x58 - -#define SW_INT_IRQNO_ENMI 0 - -#define SW_INT_IRQ_PENDING_REG(_b) (0x10 + ((_b) * 4)) -#define SW_INT_FIQ_PENDING_REG(_b) (0x20 + ((_b) * 4)) -#define SW_INT_SELECT_REG(_b) (0x30 + ((_b) * 4)) -#define SW_INT_ENABLE_REG(_b) (0x40 + ((_b) * 4)) -#define SW_INT_MASK_REG(_b) (0x50 + ((_b) * 4)) - -static struct ofw_compat_data compat_data[] = { - {"allwinner,sun4i-a10-ic", 1}, - {"allwinner,sun7i-a20-sc-nmi", 1}, - {NULL, 0} +#define SW_INT_VECTOR_REG 0x00 +#define SW_INT_BASE_ADR_REG 0x04 +#define SW_INT_PROTECTION_REG 0x08 +#define SW_INT_NMI_CTRL_REG 0x0c + +#define SW_INT_IRQ_PENDING_REG0 0x10 +#define SW_INT_IRQ_PENDING_REG1 0x14 +#define SW_INT_IRQ_PENDING_REG2 0x18 + +#define SW_INT_FIQ_PENDING_REG0 0x20 +#define SW_INT_FIQ_PENDING_REG1 0x24 +#define SW_INT_FIQ_PENDING_REG2 0x28 + +#define SW_INT_SELECT_REG0 0x30 +#define SW_INT_SELECT_REG1 0x34 +#define SW_INT_SELECT_REG2 0x38 + +#define SW_INT_ENABLE_REG0 0x40 +#define SW_INT_ENABLE_REG1 0x44 +#define SW_INT_ENABLE_REG2 0x48 + +#define SW_INT_MASK_REG0 0x50 +#define SW_INT_MASK_REG1 0x54 +#define SW_INT_MASK_REG2 0x58 + +#define SW_INT_IRQNO_ENMI 0 + +#define A10_INTR_MAX_NIRQS 81 + +#define SW_INT_IRQ_PENDING_REG(_b) (0x10 + ((_b) * 4)) +#define SW_INT_FIQ_PENDING_REG(_b) (0x20 + ((_b) * 4)) +#define SW_INT_SELECT_REG(_b) (0x30 + ((_b) * 4)) +#define SW_INT_ENABLE_REG(_b) (0x40 + ((_b) * 4)) +#define SW_INT_MASK_REG(_b) (0x50 + ((_b) * 4)) + +#ifdef INTRNG +struct a10_intr_irqsrc { + struct intr_irqsrc isrc; + u_int irq; }; +#endif struct a10_aintc_softc { device_t sc_dev; struct resource * aintc_res; bus_space_tag_t aintc_bst; bus_space_handle_t aintc_bsh; - uint8_t ver; + struct mtx mtx; +#ifdef INTRNG + struct a10_intr_irqsrc isrcs[A10_INTR_MAX_NIRQS]; +#endif }; +#define aintc_read_4(sc, reg) \ + bus_space_read_4(sc->aintc_bst, sc->aintc_bsh, reg) +#define aintc_write_4(sc, reg, val) \ + bus_space_write_4(sc->aintc_bst, sc->aintc_bsh, reg, val) + +static __inline void +a10_intr_eoi(struct a10_aintc_softc *sc, u_int irq) +{ + + if (irq != SW_INT_IRQNO_ENMI) + return; + mtx_lock_spin(&sc->mtx); + aintc_write_4(sc, SW_INT_IRQ_PENDING_REG(0), + (1 << SW_INT_IRQNO_ENMI)); + mtx_unlock_spin(&sc->mtx); +} + +static void +a10_intr_unmask(struct a10_aintc_softc *sc, u_int irq) +{ + uint32_t bit, block, value; + + bit = (irq % 32); + block = (irq / 32); + + mtx_lock_spin(&sc->mtx); + value = aintc_read_4(sc, SW_INT_ENABLE_REG(block)); + value |= (1 << bit); + aintc_write_4(sc, SW_INT_ENABLE_REG(block), value); + + value = aintc_read_4(sc, SW_INT_MASK_REG(block)); + value &= ~(1 << bit); + aintc_write_4(sc, SW_INT_MASK_REG(block), value); + mtx_unlock_spin(&sc->mtx); +} + +static void +a10_intr_mask(struct a10_aintc_softc *sc, u_int irq) +{ + uint32_t bit, block, value; + + bit = (irq % 32); + block = (irq / 32); + + mtx_lock_spin(&sc->mtx); + value = aintc_read_4(sc, SW_INT_ENABLE_REG(block)); + value &= ~(1 << bit); + aintc_write_4(sc, SW_INT_ENABLE_REG(block), value); + + value = aintc_read_4(sc, SW_INT_MASK_REG(block)); + value |= (1 << bit); + aintc_write_4(sc, SW_INT_MASK_REG(block), value); + mtx_unlock_spin(&sc->mtx); +} + +static int +a10_pending_irq(struct a10_aintc_softc *sc) +{ + uint32_t value; + int i, b; + + for (i = 0; i < 3; i++) { + value = aintc_read_4(sc, SW_INT_IRQ_PENDING_REG(i)); + if (value == 0) + continue; + for (b = 0; b < 32; b++) + if (value & (1 << b)) { + return (i * 32 + b); + } + } + + return (-1); +} + +#ifndef INTRNG + static struct a10_aintc_softc *a10_aintc_sc = NULL; -#define aintc_read_4(reg) \ - bus_space_read_4(a10_aintc_sc->aintc_bst, a10_aintc_sc->aintc_bsh, reg) -#define aintc_write_4(reg, val) \ - bus_space_write_4(a10_aintc_sc->aintc_bst, a10_aintc_sc->aintc_bsh, reg, val) +int +arm_get_next_irq(int last_irq) +{ + return (a10_pending_irq(a10_aintc_sc)); +} + +void +arm_mask_irq(uintptr_t irq) +{ + a10_intr_mask(a10_aintc_sc, irq); +} + +void +arm_unmask_irq(uintptr_t irq) +{ + a10_intr_unmask(a10_aintc_sc, irq); + a10_intr_eoi(a10_aintc_sc, irq); +} + +#else /* INTRNG */ + +static int +a10_intr(void *arg) +{ + struct a10_aintc_softc *sc = arg; + u_int irq; + + irq = a10_pending_irq(sc); + if (irq == -1 || irq > A10_INTR_MAX_NIRQS) { + device_printf(sc->sc_dev, "Spurious interrupt %d\n", irq); + return (FILTER_HANDLED); + } + + while (irq != -1) { + if (irq > A10_INTR_MAX_NIRQS) { + device_printf(sc->sc_dev, "Spurious interrupt %d\n", + irq); + return (FILTER_HANDLED); + } + if (intr_isrc_dispatch(&sc->isrcs[irq].isrc, + curthread->td_intr_frame) != 0) { + a10_intr_mask(sc, irq); + a10_intr_eoi(sc, irq); + device_printf(sc->sc_dev, + "Stray interrupt %d disabled\n", irq); + } + + arm_irq_memory_barrier(irq); + irq = a10_pending_irq(sc); + } + + return (FILTER_HANDLED); +} + +static int +a10_intr_pic_attach(struct a10_aintc_softc *sc) +{ + int error; + uint32_t irq; + const char *name; + intptr_t xref; + + name = device_get_nameunit(sc->sc_dev); + for (irq = 0; irq < A10_INTR_MAX_NIRQS; irq++) { + sc->isrcs[irq].irq = irq; + + error = intr_isrc_register(&sc->isrcs[irq].isrc, + sc->sc_dev, 0, "%s,%u", name, irq); + if (error != 0) + return (error); + } + + xref = OF_xref_from_node(ofw_bus_get_node(sc->sc_dev)); + error = intr_pic_register(sc->sc_dev, xref); + if (error != 0) + return (error); + + return (intr_pic_claim_root(sc->sc_dev, xref, a10_intr, sc, 0)); +} + +static void +a10_intr_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct a10_aintc_softc *sc; + u_int irq = ((struct a10_intr_irqsrc *)isrc)->irq; + + sc = device_get_softc(dev); + arm_irq_memory_barrier(irq); + a10_intr_unmask(sc, irq); +} + +static void +a10_intr_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct a10_aintc_softc *sc; + u_int irq = ((struct a10_intr_irqsrc *)isrc)->irq; + + sc = device_get_softc(dev); + a10_intr_mask(sc, irq); +} + +static int +a10_intr_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct a10_aintc_softc *sc; + + if (data->type != INTR_MAP_DATA_FDT || data->fdt.ncells != 1 || + data->fdt.cells[0] >= A10_INTR_MAX_NIRQS) + return (EINVAL); + + sc = device_get_softc(dev); + *isrcp = &sc->isrcs[data->fdt.cells[0]].isrc; + return (0); +} + +static void +a10_intr_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct a10_aintc_softc *sc = device_get_softc(dev); + u_int irq = ((struct a10_intr_irqsrc *)isrc)->irq; + + a10_intr_mask(sc, irq); + a10_intr_eoi(sc, irq); +} + +static void +a10_intr_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + a10_intr_enable_intr(dev, isrc); +} + +static void +a10_intr_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct a10_aintc_softc *sc = device_get_softc(dev); + u_int irq = ((struct a10_intr_irqsrc *)isrc)->irq; + + a10_intr_eoi(sc, irq); +} + +#endif /* INTRNG */ static int a10_aintc_probe(device_t dev) @@ -107,7 +344,7 @@ a10_aintc_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + if (!ofw_bus_is_compatible(dev, "allwinner,sun4i-a10-ic")) return (ENXIO); device_set_desc(dev, "A10 AINTC Interrupt Controller"); return (BUS_PROBE_DEFAULT); @@ -119,40 +356,65 @@ a10_aintc_attach(device_t dev) struct a10_aintc_softc *sc = device_get_softc(dev); int rid = 0; int i; - sc->sc_dev = dev; +#ifndef INTRNG if (a10_aintc_sc) - return (ENXIO); + goto error; - sc->aintc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + a10_aintc_sc = sc; +#endif + + sc->aintc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); if (!sc->aintc_res) { device_printf(dev, "could not allocate resource\n"); - return (ENXIO); + goto error; } sc->aintc_bst = rman_get_bustag(sc->aintc_res); sc->aintc_bsh = rman_get_bushandle(sc->aintc_res); - a10_aintc_sc = sc; + mtx_init(&sc->mtx, "A10 AINTC lock", "", MTX_SPIN); /* Disable & clear all interrupts */ for (i = 0; i < 3; i++) { - aintc_write_4(SW_INT_ENABLE_REG(i), 0); - aintc_write_4(SW_INT_MASK_REG(i), 0xffffffff); + aintc_write_4(sc, SW_INT_ENABLE_REG(i), 0); + aintc_write_4(sc, SW_INT_MASK_REG(i), 0xffffffff); } /* enable protection mode*/ - aintc_write_4(SW_INT_PROTECTION_REG, 0x01); + aintc_write_4(sc, SW_INT_PROTECTION_REG, 0x01); /* config the external interrupt source type*/ - aintc_write_4(SW_INT_NMI_CTRL_REG, 0x00); + aintc_write_4(sc, SW_INT_NMI_CTRL_REG, 0x00); + +#ifdef INTRNG + if (a10_intr_pic_attach(sc) != 0) { + device_printf(dev, "could not attach PIC\n"); + return (ENXIO); + } +#endif return (0); + +error: + bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->aintc_res); + return (ENXIO); } static device_method_t a10_aintc_methods[] = { DEVMETHOD(device_probe, a10_aintc_probe), DEVMETHOD(device_attach, a10_aintc_attach), +#ifdef INTRNG + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, a10_intr_disable_intr), + DEVMETHOD(pic_enable_intr, a10_intr_enable_intr), + DEVMETHOD(pic_map_intr, a10_intr_map_intr), + DEVMETHOD(pic_post_filter, a10_intr_post_filter), + DEVMETHOD(pic_post_ithread, a10_intr_post_ithread), + DEVMETHOD(pic_pre_ithread, a10_intr_pre_ithread), +#endif { 0, 0 } }; @@ -166,57 +428,3 @@ static devclass_t a10_aintc_devclass; EARLY_DRIVER_MODULE(aintc, simplebus, a10_aintc_driver, a10_aintc_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_FIRST); - -int -arm_get_next_irq(int last_irq) -{ - uint32_t value; - int i, b; - - for (i = 0; i < 3; i++) { - value = aintc_read_4(SW_INT_IRQ_PENDING_REG(i)); - for (b = 0; b < 32; b++) - if (value & (1 << b)) { - return (i * 32 + b); - } - } - - return (-1); -} - -void -arm_mask_irq(uintptr_t nb) -{ - uint32_t bit, block, value; - - bit = (nb % 32); - block = (nb / 32); - - value = aintc_read_4(SW_INT_ENABLE_REG(block)); - value &= ~(1 << bit); - aintc_write_4(SW_INT_ENABLE_REG(block), value); - - value = aintc_read_4(SW_INT_MASK_REG(block)); - value |= (1 << bit); - aintc_write_4(SW_INT_MASK_REG(block), value); -} - -void -arm_unmask_irq(uintptr_t nb) -{ - uint32_t bit, block, value; - - bit = (nb % 32); - block = (nb / 32); - - value = aintc_read_4(SW_INT_ENABLE_REG(block)); - value |= (1 << bit); - aintc_write_4(SW_INT_ENABLE_REG(block), value); - - value = aintc_read_4(SW_INT_MASK_REG(block)); - value &= ~(1 << bit); - aintc_write_4(SW_INT_MASK_REG(block), value); - - if(nb == SW_INT_IRQNO_ENMI) /* must clear pending bit when enabled */ - aintc_write_4(SW_INT_IRQ_PENDING_REG(0), (1 << SW_INT_IRQNO_ENMI)); -} Modified: head/sys/arm/allwinner/files.a10 ============================================================================== --- head/sys/arm/allwinner/files.a10 Tue Apr 26 10:04:06 2016 (r298624) +++ head/sys/arm/allwinner/files.a10 Tue Apr 26 11:15:48 2016 (r298625) @@ -1,5 +1,5 @@ # $FreeBSD$ +arm/allwinner/a10/a10_intc.c standard arm/allwinner/a10_padconf.c standard -arm/allwinner/aintc.c standard arm/allwinner/timer.c standard Modified: head/sys/arm/conf/A10 ============================================================================== --- head/sys/arm/conf/A10 Tue Apr 26 10:04:06 2016 (r298624) +++ head/sys/arm/conf/A10 Tue Apr 26 11:15:48 2016 (r298625) @@ -23,6 +23,8 @@ ident A10 include "std.armv6" include "../allwinner/std.a10" +options INTRNG + options SOC_ALLWINNER_A10 options HZ=100 From owner-svn-src-head@freebsd.org Tue Apr 26 11:39:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11EF4B1B532; Tue, 26 Apr 2016 11:39:34 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D34C51211; Tue, 26 Apr 2016 11:39:33 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3QBdW2x071896; Tue, 26 Apr 2016 11:39:32 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QBdWuo071895; Tue, 26 Apr 2016 11:39:32 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604261139.u3QBdWuo071895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 26 Apr 2016 11:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298626 - head/bin/csh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 11:39:34 -0000 Author: andrew Date: Tue Apr 26 11:39:32 2016 New Revision: 298626 URL: https://svnweb.freebsd.org/changeset/base/298626 Log: Stop using sbrk in csh. This is a legacy interface and its use within csh is invalid. It is used to find the size of allocated memory. As malloc may allocate memory with mmap it will fail to take this memory into account. Obtained from: brooks Modified: head/bin/csh/config.h Modified: head/bin/csh/config.h ============================================================================== --- head/bin/csh/config.h Tue Apr 26 11:15:48 2016 (r298625) +++ head/bin/csh/config.h Tue Apr 26 11:39:32 2016 (r298626) @@ -99,7 +99,7 @@ #define HAVE_PATHS_H 1 /* Define to 1 if you have the `sbrk' function. */ -#define HAVE_SBRK 1 +/* #undef HAVE_SBRK 1 */ /* Define to 1 if you have the `setpgid' function. */ #define HAVE_SETPGID 1 From owner-svn-src-head@freebsd.org Tue Apr 26 11:53:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FDA5B1B95D; Tue, 26 Apr 2016 11:53:41 +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 572021AE6; Tue, 26 Apr 2016 11:53:41 +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 u3QBreNh077593; Tue, 26 Apr 2016 11:53:40 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QBrbKK077561; Tue, 26 Apr 2016 11:53:37 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604261153.u3QBrbKK077561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Apr 2016 11:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298627 - in head/sys: arm/allwinner arm/altera/socfpga arm/amlogic/aml8726 arm/annapurna/alpine arm/arm arm/at91 arm/broadcom/bcm2835 arm/cavium/cns11xx arm/freescale arm/freescale/imx... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 11:53:41 -0000 Author: br Date: Tue Apr 26 11:53:37 2016 New Revision: 298627 URL: https://svnweb.freebsd.org/changeset/base/298627 Log: Move arm's devmap to some generic place, so it can be used by other architectures. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D6091 Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Added: head/sys/kern/subr_devmap.c - copied, changed from r298626, head/sys/arm/arm/devmap.c head/sys/sys/devmap.h - copied, changed from r298581, head/sys/arm/include/devmap.h Deleted: head/sys/arm/arm/devmap.c head/sys/arm/include/devmap.h head/sys/arm64/include/devmap.h head/sys/riscv/riscv/devmap.c Modified: head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/altera/socfpga/socfpga_machdep.c head/sys/arm/amlogic/aml8726/aml8726_machdep.c head/sys/arm/annapurna/alpine/alpine_machdep.c head/sys/arm/arm/bus_space_generic.c head/sys/arm/arm/machdep.c head/sys/arm/at91/at91.c head/sys/arm/at91/at91_common.c head/sys/arm/at91/at91_machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/cavium/cns11xx/econa_machdep.c head/sys/arm/freescale/fsl_ocotp.c head/sys/arm/freescale/imx/imx51_machdep.c head/sys/arm/freescale/imx/imx53_machdep.c head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/freescale/imx/imx_machdep.c head/sys/arm/freescale/vybrid/vf_machdep.c head/sys/arm/include/vmparam.h head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_common.c head/sys/arm/mv/mv_localbus.c head/sys/arm/mv/mv_machdep.c head/sys/arm/mv/mv_pci.c head/sys/arm/mv/mvvar.h head/sys/arm/mv/orion/db88f5xxx.c head/sys/arm/nvidia/tegra124/tegra124_machdep.c head/sys/arm/nvidia/tegra_pcie.c head/sys/arm/qemu/virt_machdep.c head/sys/arm/rockchip/rk30xx_machdep.c head/sys/arm/samsung/exynos/exynos5_machdep.c head/sys/arm/ti/ti_machdep.c head/sys/arm/versatile/versatile_machdep.c head/sys/arm/xilinx/zy7_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 head/sys/arm64/arm64/machdep.c head/sys/arm64/include/vmparam.h head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/conf/files.riscv head/sys/riscv/include/vmparam.h Modified: head/sys/arm/allwinner/allwinner_machdep.c ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/allwinner/allwinner_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -39,12 +39,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include #include @@ -98,7 +98,7 @@ static vm_offset_t allwinner_lastaddr(platform_t plat) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } /* @@ -115,7 +115,7 @@ static int allwinner_devmap_init(platform_t plat) { - arm_devmap_add_entry(0x01C00000, 0x00400000); /* 4MB */ + devmap_add_entry(0x01C00000, 0x00400000); /* 4MB */ return (0); } Modified: head/sys/arm/altera/socfpga/socfpga_machdep.c ============================================================================== --- head/sys/arm/altera/socfpga/socfpga_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/altera/socfpga/socfpga_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -38,12 +38,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include #include @@ -51,7 +51,7 @@ vm_offset_t platform_lastaddr(void) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } void @@ -77,7 +77,7 @@ platform_devmap_init(void) { /* UART */ - arm_devmap_add_entry(0xffc00000, 0x100000); + devmap_add_entry(0xffc00000, 0x100000); /* * USB OTG @@ -87,16 +87,16 @@ platform_devmap_init(void) * It might be caused due to some power save options being turned * on or something else. */ - arm_devmap_add_entry(0xffb00000, 0x100000); + devmap_add_entry(0xffb00000, 0x100000); /* dwmmc */ - arm_devmap_add_entry(0xff700000, 0x100000); + devmap_add_entry(0xff700000, 0x100000); /* scu */ - arm_devmap_add_entry(0xfff00000, 0x100000); + devmap_add_entry(0xfff00000, 0x100000); /* FPGA memory window, 256MB */ - arm_devmap_add_entry(0xd0000000, 0x10000000); + devmap_add_entry(0xd0000000, 0x10000000); return (0); } Modified: head/sys/arm/amlogic/aml8726/aml8726_machdep.c ============================================================================== --- head/sys/arm/amlogic/aml8726/aml8726_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/amlogic/aml8726/aml8726_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -35,13 +35,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include #include #include #include @@ -85,7 +85,7 @@ vm_offset_t platform_lastaddr(void) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } void @@ -108,7 +108,7 @@ platform_gpio_init(void) * and platform_gpio_init during which printf can't be used. */ aml8726_aobus_kva_base = - (vm_offset_t)arm_devmap_ptov(0xc8100000, 0x100000); + (vm_offset_t)devmap_ptov(0xc8100000, 0x100000); /* * The hardware mux used by clkmsr is unique to the SoC (though @@ -154,14 +154,14 @@ int platform_devmap_init(void) { - arm_devmap_add_entry(0xc1100000, 0x200000); /* cbus */ - arm_devmap_add_entry(0xc4200000, 0x100000); /* pl310 */ - arm_devmap_add_entry(0xc4300000, 0x100000); /* periph */ - arm_devmap_add_entry(0xc8000000, 0x100000); /* apbbus */ - arm_devmap_add_entry(0xc8100000, 0x100000); /* aobus */ - arm_devmap_add_entry(0xc9000000, 0x800000); /* ahbbus */ - arm_devmap_add_entry(0xd9000000, 0x100000); /* ahb */ - arm_devmap_add_entry(0xda000000, 0x100000); /* secbus */ + devmap_add_entry(0xc1100000, 0x200000); /* cbus */ + devmap_add_entry(0xc4200000, 0x100000); /* pl310 */ + devmap_add_entry(0xc4300000, 0x100000); /* periph */ + devmap_add_entry(0xc8000000, 0x100000); /* apbbus */ + devmap_add_entry(0xc8100000, 0x100000); /* aobus */ + devmap_add_entry(0xc9000000, 0x800000); /* ahbbus */ + devmap_add_entry(0xd9000000, 0x100000); /* ahb */ + devmap_add_entry(0xda000000, 0x100000); /* secbus */ return (0); } Modified: head/sys/arm/annapurna/alpine/alpine_machdep.c ============================================================================== --- head/sys/arm/annapurna/alpine/alpine_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/annapurna/alpine/alpine_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -42,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include #include /* For trapframe_t, used in */ #include -#include #include #include @@ -128,7 +128,7 @@ int platform_devmap_init(void) { alpine_get_devmap_base(&al_devmap_pa, &al_devmap_size); - arm_devmap_add_entry(al_devmap_pa, al_devmap_size); + devmap_add_entry(al_devmap_pa, al_devmap_size); return (0); } Modified: head/sys/arm/arm/bus_space_generic.c ============================================================================== --- head/sys/arm/arm/bus_space_generic.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/arm/bus_space_generic.c Tue Apr 26 11:53:37 2016 (r298627) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -51,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include void generic_bs_unimplemented(void) Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/arm/machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -100,7 +101,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -455,7 +455,7 @@ cpu_startup(void *dummy) (uintmax_t)arm32_ptob(vm_cnt.v_free_count) / mbyte); if (bootverbose) { arm_physmem_print_tables(); - arm_devmap_print_table(); + devmap_print_table(); } bufinit(); @@ -1692,7 +1692,7 @@ initarm(struct arm_boot_params *abp) /* Establish static device mappings. */ err_devmap = platform_devmap_init(); - arm_devmap_bootstrap(l1pagetable, NULL); + devmap_bootstrap(l1pagetable, NULL); vm_max_kernel_address = platform_lastaddr(); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); @@ -1913,7 +1913,7 @@ initarm(struct arm_boot_params *abp) /* Establish static device mappings. */ err_devmap = platform_devmap_init(); - arm_devmap_bootstrap(0, NULL); + devmap_bootstrap(0, NULL); vm_max_kernel_address = platform_lastaddr(); /* Modified: head/sys/arm/at91/at91.c ============================================================================== --- head/sys/arm/at91/at91.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/at91/at91.c Tue Apr 26 11:53:37 2016 (r298627) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -45,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #define _ARM32_BUS_DMA_PRIVATE #include -#include #include #include Modified: head/sys/arm/at91/at91_common.c ============================================================================== --- head/sys/arm/at91/at91_common.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/at91/at91_common.c Tue Apr 26 11:53:37 2016 (r298627) @@ -30,10 +30,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include #include #include #include @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); #include -extern const struct arm_devmap_entry at91_devmap[]; +extern const struct devmap_entry at91_devmap[]; struct fdt_fixup_entry fdt_fixup_table[] = { { NULL, NULL } @@ -91,7 +91,7 @@ vm_offset_t platform_lastaddr(void) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } void @@ -106,9 +106,9 @@ int platform_devmap_init(void) { -// arm_devmap_add_entry(0xfff00000, 0x00100000); /* 1MB - uart, aic and timers*/ +// devmap_add_entry(0xfff00000, 0x00100000); /* 1MB - uart, aic and timers*/ - arm_devmap_register_table(at91_devmap); + devmap_register_table(at91_devmap); return (0); } Modified: head/sys/arm/at91/at91_machdep.c ============================================================================== --- head/sys/arm/at91/at91_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/at91/at91_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -81,7 +82,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -117,7 +117,7 @@ __FBSDID("$FreeBSD$"); struct pv_addr kernel_pt_table[NUM_KERNEL_PTS]; /* Static device mappings. */ -const struct arm_devmap_entry at91_devmap[] = { +const struct devmap_entry at91_devmap[] = { /* * Map the critical on-board devices. The interrupt vector at * 0xffff0000 makes it impossible to map them PA == VA, so we map all @@ -552,7 +552,7 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } - arm_devmap_bootstrap(l1pagetable, at91_devmap); + devmap_bootstrap(l1pagetable, at91_devmap); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | DOMAIN_CLIENT); cpu_setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -46,12 +46,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include #include #include @@ -66,7 +66,7 @@ static vm_offset_t bcm2835_lastaddr(platform_t plat) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } static void @@ -98,7 +98,7 @@ static int bcm2835_devmap_init(platform_t plat) { - arm_devmap_add_entry(0x20000000, 0x01000000); + devmap_add_entry(0x20000000, 0x01000000); return (0); } #endif @@ -108,7 +108,7 @@ static int bcm2836_devmap_init(platform_t plat) { - arm_devmap_add_entry(0x3f000000, 0x01000000); + devmap_add_entry(0x3f000000, 0x01000000); return (0); } #endif Modified: head/sys/arm/cavium/cns11xx/econa_machdep.c ============================================================================== --- head/sys/arm/cavium/cns11xx/econa_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/cavium/cns11xx/econa_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -71,7 +72,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -105,7 +105,7 @@ struct pv_addr abtstack; struct pv_addr kernelstack; /* Static device mappings. */ -static const struct arm_devmap_entry econa_devmap[] = { +static const struct devmap_entry econa_devmap[] = { { /* * This maps DDR SDRAM @@ -263,7 +263,7 @@ initarm(struct arm_boot_params *abp) VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); } - arm_devmap_bootstrap(l1pagetable, econa_devmap); + devmap_bootstrap(l1pagetable, econa_devmap); cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT); cpu_setttb(kernel_l1pt.pv_pa); cpu_tlb_flushID(); Modified: head/sys/arm/freescale/fsl_ocotp.c ============================================================================== --- head/sys/arm/freescale/fsl_ocotp.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/freescale/fsl_ocotp.c Tue Apr 26 11:53:37 2016 (r298627) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include +#include static uint32_t *ocotp_regs; static vm_size_t ocotp_size; Modified: head/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/freescale/imx/imx51_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -33,11 +33,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include #include #include @@ -49,7 +49,7 @@ static vm_offset_t imx51_lastaddr(platform_t plat) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } static int @@ -74,9 +74,9 @@ static int imx51_devmap_init(platform_t plat) { - arm_devmap_add_entry(0x70000000, 0x00100000); - arm_devmap_add_entry(0x73f00000, 0x00100000); - arm_devmap_add_entry(0x83f00000, 0x00100000); + devmap_add_entry(0x70000000, 0x00100000); + devmap_add_entry(0x73f00000, 0x00100000); + devmap_add_entry(0x83f00000, 0x00100000); return (0); } Modified: head/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx53_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/freescale/imx/imx53_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -33,11 +33,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include #include #include @@ -49,7 +49,7 @@ static vm_offset_t imx53_lastaddr(platform_t plat) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } static int @@ -74,9 +74,9 @@ static int imx53_devmap_init(platform_t plat) { - arm_devmap_add_entry(0x50000000, 0x00100000); - arm_devmap_add_entry(0x53f00000, 0x00100000); - arm_devmap_add_entry(0x63f00000, 0x00100000); + devmap_add_entry(0x50000000, 0x00100000); + devmap_add_entry(0x53f00000, 0x00100000); + devmap_add_entry(0x63f00000, 0x00100000); return (0); } Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/freescale/imx/imx6_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -33,11 +33,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include #include #include #include @@ -166,7 +166,7 @@ static vm_offset_t imx6_lastaddr(platform_t plat) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } static int @@ -220,9 +220,9 @@ imx6_devmap_init(platform_t plat) const uint32_t IMX6_AIPS2_PHYS = 0x02100000; const uint32_t IMX6_AIPS2_SIZE = 0x00100000; - arm_devmap_add_entry(IMX6_ARMMP_PHYS, IMX6_ARMMP_SIZE); - arm_devmap_add_entry(IMX6_AIPS1_PHYS, IMX6_AIPS1_SIZE); - arm_devmap_add_entry(IMX6_AIPS2_PHYS, IMX6_AIPS2_SIZE); + devmap_add_entry(IMX6_ARMMP_PHYS, IMX6_ARMMP_SIZE); + devmap_add_entry(IMX6_AIPS1_PHYS, IMX6_AIPS1_SIZE); + devmap_add_entry(IMX6_AIPS2_PHYS, IMX6_AIPS2_SIZE); return (0); } @@ -287,7 +287,7 @@ u_int imx_soc_type() IMX6_ANALOG_DIGPROG_SOCTYPE_SHIFT; /*printf("digprog = 0x%08x\n", digprog);*/ if (hwsoc == HWSOC_MX6DL) { - pcr = arm_devmap_ptov(SCU_CONFIG_PHYSADDR, 4); + pcr = devmap_ptov(SCU_CONFIG_PHYSADDR, 4); if (pcr != NULL) { /*printf("scu config = 0x%08x\n", *pcr);*/ if ((*pcr & 0x03) == 0) { Modified: head/sys/arm/freescale/imx/imx_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/freescale/imx/imx_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -33,13 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include #include #include @@ -85,7 +85,7 @@ imx_wdog_cpu_reset(vm_offset_t wdcr_phys * control register. The reset happens on the next cycle of the wdog * 32KHz clock, so hang out in a spin loop until the reset takes effect. */ - if ((pcr = arm_devmap_ptov(wdcr_physaddr, sizeof(*pcr))) == NULL) { + if ((pcr = devmap_ptov(wdcr_physaddr, sizeof(*pcr))) == NULL) { printf("cpu_reset() can't find its control register... locking up now."); } else { *pcr &= ~WDOG_CR_SRS; @@ -99,7 +99,7 @@ imx_wdog_init_last_reset(vm_offset_t wds { volatile uint16_t * psr; - if ((psr = arm_devmap_ptov(wdsr_phys, sizeof(*psr))) == NULL) + if ((psr = devmap_ptov(wdsr_phys, sizeof(*psr))) == NULL) return; last_reset_status = *psr; if (last_reset_status & WDOG_RSR_SFTW) { Modified: head/sys/arm/freescale/vybrid/vf_machdep.c ============================================================================== --- head/sys/arm/freescale/vybrid/vf_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/freescale/vybrid/vf_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -34,12 +34,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include #include @@ -49,7 +49,7 @@ vm_offset_t platform_lastaddr(void) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } void @@ -74,7 +74,7 @@ int platform_devmap_init(void) { - arm_devmap_add_entry(0x40000000, 0x100000); + devmap_add_entry(0x40000000, 0x100000); return (0); } Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/include/vmparam.h Tue Apr 26 11:53:37 2016 (r298627) @@ -172,4 +172,6 @@ extern vm_offset_t vm_max_kernel_address #define SFBUF #define SFBUF_MAP +#define DEVMAP_MAX_VADDR ARM_VECTORS_HIGH + #endif /* _MACHINE_VMPARAM_H_ */ Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/lpc/lpc_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -45,13 +45,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include #include #include @@ -64,7 +64,7 @@ vm_offset_t platform_lastaddr(void) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } void @@ -90,13 +90,13 @@ platform_late_init(void) /* * Add a single static device mapping. * The values used were taken from the ranges property of the SoC node in the - * dts file when this code was converted to arm_devmap_add_entry(). + * dts file when this code was converted to devmap_add_entry(). */ int platform_devmap_init(void) { - arm_devmap_add_entry(LPC_DEV_PHYS_BASE, LPC_DEV_SIZE); + devmap_add_entry(LPC_DEV_PHYS_BASE, LPC_DEV_SIZE); return (0); } Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/mv/mv_common.c Tue Apr 26 11:53:37 2016 (r298627) @@ -381,7 +381,7 @@ soc_id(uint32_t *dev, uint32_t *rev) * Notice: system identifiers are available in the registers range of * PCIE controller, so using this function is only allowed (and * possible) after the internal registers range has been mapped in via - * arm_devmap_bootstrap(). + * devmap_bootstrap(). */ *dev = bus_space_read_4(fdtbus_bs_tag, MV_PCIE_BASE, 0) >> 16; *rev = bus_space_read_4(fdtbus_bs_tag, MV_PCIE_BASE, 8) & 0xff; Modified: head/sys/arm/mv/mv_localbus.c ============================================================================== --- head/sys/arm/mv/mv_localbus.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/mv/mv_localbus.c Tue Apr 26 11:53:37 2016 (r298627) @@ -36,10 +36,10 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include #include #include @@ -384,7 +384,7 @@ localbus_get_devinfo(device_t bus, devic } int -fdt_localbus_devmap(phandle_t dt_node, struct arm_devmap_entry *fdt_devmap, +fdt_localbus_devmap(phandle_t dt_node, struct devmap_entry *fdt_devmap, int banks_max_num, int *banks_added) { pcell_t ranges[MV_LOCALBUS_MAX_BANKS * MV_LOCALBUS_MAX_BANK_CELLS]; Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/mv/mv_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -45,12 +45,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include #include #include @@ -270,12 +270,12 @@ platform_late_init(void) } #define FDT_DEVMAP_MAX (MV_WIN_CPU_MAX + 2) -static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { +static struct devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = { { 0, 0, 0, } }; static int -platform_sram_devmap(struct arm_devmap_entry *map) +platform_sram_devmap(struct devmap_entry *map) { #if !defined(SOC_MV_ARMADAXP) phandle_t child, root; @@ -318,10 +318,10 @@ out: * real implementation of this function in arm/mv/mv_pci.c overrides the weak * alias defined here. */ -int mv_default_fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, +int mv_default_fdt_pci_devmap(phandle_t node, struct devmap_entry *devmap, vm_offset_t io_va, vm_offset_t mem_va); int -mv_default_fdt_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, +mv_default_fdt_pci_devmap(phandle_t node, struct devmap_entry *devmap, vm_offset_t io_va, vm_offset_t mem_va) { @@ -345,7 +345,7 @@ platform_devmap_init(void) int i, num_mapped; i = 0; - arm_devmap_register_table(&fdt_devmap[0]); + devmap_register_table(&fdt_devmap[0]); #ifdef SOC_MV_ARMADAXP vm_paddr_t cur_immr_pa; Modified: head/sys/arm/mv/mv_pci.c ============================================================================== --- head/sys/arm/mv/mv_pci.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/mv/mv_pci.c Tue Apr 26 11:53:37 2016 (r298627) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -70,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include "ofw_bus_if.h" #include "pcib_if.h" -#include #include #include @@ -221,7 +221,7 @@ mv_pci_ranges(phandle_t node, struct mv_ } int -mv_pci_devmap(phandle_t node, struct arm_devmap_entry *devmap, vm_offset_t io_va, +mv_pci_devmap(phandle_t node, struct devmap_entry *devmap, vm_offset_t io_va, vm_offset_t mem_va) { struct mv_pci_range io_space, mem_space; Modified: head/sys/arm/mv/mvvar.h ============================================================================== --- head/sys/arm/mv/mvvar.h Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/mv/mvvar.h Tue Apr 26 11:53:37 2016 (r298627) @@ -135,10 +135,10 @@ uint32_t mv_drbl_get_msg(int mnr, int di int mv_msi_data(int irq, uint64_t *addr, uint32_t *data); -struct arm_devmap_entry; +struct devmap_entry; -int mv_pci_devmap(phandle_t, struct arm_devmap_entry *, vm_offset_t, +int mv_pci_devmap(phandle_t, struct devmap_entry *, vm_offset_t, vm_offset_t); -int fdt_localbus_devmap(phandle_t, struct arm_devmap_entry *, int, int *); +int fdt_localbus_devmap(phandle_t, struct devmap_entry *, int, int *); #endif /* _MVVAR_H_ */ Modified: head/sys/arm/mv/orion/db88f5xxx.c ============================================================================== --- head/sys/arm/mv/orion/db88f5xxx.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/mv/orion/db88f5xxx.c Tue Apr 26 11:53:37 2016 (r298627) @@ -73,7 +73,7 @@ __FBSDID("$FreeBSD$"); int platform_pci_get_irq(u_int bus, u_int slot, u_int func, u_int pin); /* Static device mappings. */ -const struct arm_devmap_entry db88f5xxx_devmap[] = { +const struct devmap_entry db88f5xxx_devmap[] = { /* * Map the on-board devices VA == PA so that we can access them * with the MMU on or off. Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -34,11 +34,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include #include #include #include @@ -84,7 +84,7 @@ static vm_offset_t tegra124_lastaddr(platform_t plat) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } static int @@ -108,7 +108,7 @@ static int tegra124_devmap_init(platform_t plat) { - arm_devmap_add_entry(0x70000000, 0x01000000); + devmap_add_entry(0x70000000, 0x01000000); return (0); } Modified: head/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- head/sys/arm/nvidia/tegra_pcie.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/nvidia/tegra_pcie.c Tue Apr 26 11:53:37 2016 (r298627) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -60,7 +61,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -1688,4 +1688,4 @@ static driver_t tegra_pcib_driver = { devclass_t pcib_devclass; -DRIVER_MODULE(pcib, simplebus, tegra_pcib_driver, pcib_devclass, 0, 0); \ No newline at end of file +DRIVER_MODULE(pcib, simplebus, tegra_pcib_driver, pcib_devclass, 0, 0); Modified: head/sys/arm/qemu/virt_machdep.c ============================================================================== --- head/sys/arm/qemu/virt_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/qemu/virt_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -33,11 +33,11 @@ __FBSDID("$FreeBSD$"); #define _ARM32_BUS_DMA_PRIVATE #include #include +#include #include #include -#include #include #include @@ -70,7 +70,7 @@ static vm_offset_t virt_lastaddr(platform_t plat) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } /* @@ -80,7 +80,7 @@ static int virt_devmap_init(platform_t plat) { - arm_devmap_add_entry(0x09000000, 0x100000); /* Uart */ + devmap_add_entry(0x09000000, 0x100000); /* Uart */ return (0); } Modified: head/sys/arm/rockchip/rk30xx_machdep.c ============================================================================== --- head/sys/arm/rockchip/rk30xx_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/rockchip/rk30xx_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -38,13 +38,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include -#include #include #include @@ -56,7 +56,7 @@ vm_offset_t platform_lastaddr(void) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } void @@ -86,8 +86,8 @@ int platform_devmap_init(void) { - arm_devmap_add_entry(0x10000000, 0x00200000); - arm_devmap_add_entry(0x20000000, 0x00100000); + devmap_add_entry(0x10000000, 0x00200000); + devmap_add_entry(0x20000000, 0x00100000); return (0); } Modified: head/sys/arm/samsung/exynos/exynos5_machdep.c ============================================================================== --- head/sys/arm/samsung/exynos/exynos5_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/samsung/exynos/exynos5_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -34,12 +34,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include #include @@ -47,7 +47,7 @@ vm_offset_t platform_lastaddr(void) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } void @@ -73,13 +73,13 @@ platform_devmap_init(void) { /* CHIP ID */ - arm_devmap_add_entry(0x10000000, 0x100000); + devmap_add_entry(0x10000000, 0x100000); /* UART */ - arm_devmap_add_entry(0x12C00000, 0x100000); + devmap_add_entry(0x12C00000, 0x100000); /* DWMMC */ - arm_devmap_add_entry(0x12200000, 0x100000); + devmap_add_entry(0x12200000, 0x100000); return (0); } Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Tue Apr 26 11:39:32 2016 (r298626) +++ head/sys/arm/ti/ti_machdep.c Tue Apr 26 11:53:37 2016 (r298627) @@ -44,12 +44,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include -#include #include #include @@ -63,7 +63,7 @@ static vm_offset_t ti_lastaddr(platform_t plat) { - return (arm_devmap_lastaddr()); + return (devmap_lastaddr()); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Apr 26 12:02:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CB65B1C2F6; Tue, 26 Apr 2016 12:02:37 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 488E6171B; Tue, 26 Apr 2016 12:02:37 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3QC2aMn080940; Tue, 26 Apr 2016 12:02:36 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QC2aJm080939; Tue, 26 Apr 2016 12:02:36 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201604261202.u3QC2aJm080939@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Tue, 26 Apr 2016 12:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298630 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 12:02:37 -0000 Author: jmcneill Date: Tue Apr 26 12:02:36 2016 New Revision: 298630 URL: https://svnweb.freebsd.org/changeset/base/298630 Log: Add support for 8-bit eMMC. Set MMC_CAP_4_BIT_DATA and MMC_CAP_8_BIT_DATA based on the "bus-width" DT property and reduce maximum bus frequency from 52MHz to 50MHz to match the capabilities of the clock provider. Tested on a BananaPi BPI-M3 (A83T). Modified: head/sys/arm/allwinner/a10_mmc.c Modified: head/sys/arm/allwinner/a10_mmc.c ============================================================================== --- head/sys/arm/allwinner/a10_mmc.c Tue Apr 26 12:00:04 2016 (r298629) +++ head/sys/arm/allwinner/a10_mmc.c Tue Apr 26 12:02:36 2016 (r298630) @@ -152,8 +152,11 @@ a10_mmc_attach(device_t dev) struct a10_mmc_softc *sc; struct sysctl_ctx_list *ctx; struct sysctl_oid_list *tree; + uint32_t bus_width; + phandle_t node; int error; + node = ofw_bus_get_node(dev); sc = device_get_softc(dev); sc->a10_dev = dev; sc->a10_req = NULL; @@ -251,11 +254,18 @@ a10_mmc_attach(device_t dev) device_printf(sc->a10_dev, "DMA status: %s\n", a10_mmc_pio_mode ? "disabled" : "enabled"); + if (OF_getencprop(node, "bus-width", &bus_width, sizeof(uint32_t)) <= 0) + bus_width = 1; + sc->a10_host.f_min = 400000; - sc->a10_host.f_max = 52000000; + sc->a10_host.f_max = 50000000; sc->a10_host.host_ocr = MMC_OCR_320_330 | MMC_OCR_330_340; - sc->a10_host.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_HSPEED; sc->a10_host.mode = mode_sd; + sc->a10_host.caps = MMC_CAP_HSPEED; + if (bus_width >= 4) + sc->a10_host.caps |= MMC_CAP_4_BIT_DATA; + if (bus_width >= 8) + sc->a10_host.caps |= MMC_CAP_8_BIT_DATA; child = device_add_child(dev, "mmc", -1); if (child == NULL) { From owner-svn-src-head@freebsd.org Tue Apr 26 12:29:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA3FEB1CFC5; Tue, 26 Apr 2016 12:29:48 +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 8CB971380; Tue, 26 Apr 2016 12:29:48 +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 u3QCTlR3087190; Tue, 26 Apr 2016 12:29:47 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QCTlir087189; Tue, 26 Apr 2016 12:29:47 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604261229.u3QCTlir087189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Apr 2016 12:29:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298631 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 12:29:48 -0000 Author: br Date: Tue Apr 26 12:29:47 2016 New Revision: 298631 URL: https://svnweb.freebsd.org/changeset/base/298631 Log: Add support for RISC-V. Modified: head/sys/kern/subr_devmap.c Modified: head/sys/kern/subr_devmap.c ============================================================================== --- head/sys/kern/subr_devmap.c Tue Apr 26 12:02:36 2016 (r298630) +++ head/sys/kern/subr_devmap.c Tue Apr 26 12:29:47 2016 (r298631) @@ -56,7 +56,7 @@ static struct devmap_entry akva_devmap_e static u_int akva_devmap_idx; static vm_offset_t akva_devmap_vaddr = DEVMAP_MAX_VADDR; -#ifdef __aarch64__ +#if defined(__aarch64__) || defined(__riscv__) extern int early_boot; #endif @@ -200,7 +200,7 @@ devmap_bootstrap(vm_offset_t l1pt, const pmap_map_chunk(l1pt, pd->pd_va, pd->pd_pa, pd->pd_size, VM_PROT_READ | VM_PROT_WRITE, PTE_DEVICE); #endif -#elif defined(__aarch64__) +#elif defined(__aarch64__) || defined(__riscv__) pmap_kenter_device(pd->pd_va, pd->pd_size, pd->pd_pa); #endif } @@ -273,7 +273,7 @@ pmap_mapdev(vm_offset_t pa, vm_size_t si pa = trunc_page(pa); size = round_page(size + offset); -#ifdef __aarch64__ +#if defined(__aarch64__) || defined(__riscv__) if (early_boot) { akva_devmap_vaddr = trunc_page(akva_devmap_vaddr - size); va = akva_devmap_vaddr; From owner-svn-src-head@freebsd.org Tue Apr 26 12:31:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FFB4B1C05D; Tue, 26 Apr 2016 12:31:25 +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 D54C31705; Tue, 26 Apr 2016 12:31:24 +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 u3QCVO8K087298; Tue, 26 Apr 2016 12:31:24 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QCVO1r087297; Tue, 26 Apr 2016 12:31:24 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604261231.u3QCVO1r087297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Apr 2016 12:31:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298632 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 12:31:25 -0000 Author: br Date: Tue Apr 26 12:31:23 2016 New Revision: 298632 URL: https://svnweb.freebsd.org/changeset/base/298632 Log: Do not include fdt.h on RISC-V. Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Tue Apr 26 12:29:47 2016 (r298631) +++ head/sys/dev/uart/uart_cpu_fdt.c Tue Apr 26 12:31:23 2016 (r298632) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifndef __aarch64__ +#if !defined(__aarch64__) && !defined(__riscv__) #include #endif From owner-svn-src-head@freebsd.org Tue Apr 26 12:33:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5FE4B1C234; Tue, 26 Apr 2016 12:33:26 +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 7BF281B07; Tue, 26 Apr 2016 12:33:26 +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 u3QCXPqj090002; Tue, 26 Apr 2016 12:33:25 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QCXPKh090001; Tue, 26 Apr 2016 12:33:25 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604261233.u3QCXPKh090001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Apr 2016 12:33:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298633 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 12:33:26 -0000 Author: br Date: Tue Apr 26 12:33:25 2016 New Revision: 298633 URL: https://svnweb.freebsd.org/changeset/base/298633 Log: Add the implementation of OF_decode_addr(). Added: head/sys/riscv/riscv/ofw_machdep.c (contents, props changed) Added: head/sys/riscv/riscv/ofw_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/riscv/ofw_machdep.c Tue Apr 26 12:33:25 2016 (r298633) @@ -0,0 +1,58 @@ +/*- + * 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 + +extern struct bus_space memmap_bus; + +int +OF_decode_addr(phandle_t dev, int regno, bus_space_tag_t *tag, + bus_space_handle_t *handle, bus_size_t *sz) +{ + bus_addr_t addr; + bus_size_t size; + int err; + + err = ofw_reg_to_paddr(dev, regno, &addr, &size, NULL); + if (err != 0) + return (err); + + *tag = &memmap_bus; + + if (sz != NULL) + *sz = size; + + return (bus_space_map(*tag, addr, size, 0, handle)); +} From owner-svn-src-head@freebsd.org Tue Apr 26 12:36:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2E43B1C301; Tue, 26 Apr 2016 12:36:13 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 703171D41; Tue, 26 Apr 2016 12:36:13 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3QCaC7v090144; Tue, 26 Apr 2016 12:36:12 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QCaCS1090143; Tue, 26 Apr 2016 12:36:12 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201604261236.u3QCaCS1090143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Tue, 26 Apr 2016 12:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298634 - head/sys/arm/allwinner/clk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 12:36:13 -0000 Author: jmcneill Date: Tue Apr 26 12:36:12 2016 New Revision: 298634 URL: https://svnweb.freebsd.org/changeset/base/298634 Log: Fix calculation of LCD CH1 SCLK1 output frequency when SCLK2 /2 is used as source. PR: 208680 Reported by: David Binderman Modified: head/sys/arm/allwinner/clk/aw_lcdclk.c Modified: head/sys/arm/allwinner/clk/aw_lcdclk.c ============================================================================== --- head/sys/arm/allwinner/clk/aw_lcdclk.c Tue Apr 26 12:33:25 2016 (r298633) +++ head/sys/arm/allwinner/clk/aw_lcdclk.c Tue Apr 26 12:36:12 2016 (r298634) @@ -266,7 +266,7 @@ static int aw_lcdclk_recalc_freq(struct clknode *clk, uint64_t *freq) { struct aw_lcdclk_softc *sc; - uint32_t val, m; + uint32_t val, m, src_sel; sc = clknode_get_softc(clk); @@ -281,7 +281,8 @@ aw_lcdclk_recalc_freq(struct clknode *cl *freq = *freq / m; if (sc->id == CLK_IDX_CH1_SCLK1) { - if ((val & CH1_SCLK1_SEL) == CH1_SCLK1_SEL_SCLK2_DIV2) + src_sel = (val & CH1_SCLK1_SEL) >> CH1_SCLK1_SEL_SHIFT; + if (src_sel == CH1_SCLK1_SEL_SCLK2_DIV2) *freq /= 2; } From owner-svn-src-head@freebsd.org Tue Apr 26 12:45:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BBB5B1C72D; Tue, 26 Apr 2016 12:45:03 +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 19D121CE2; Tue, 26 Apr 2016 12:45:03 +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 u3QCj24s095100; Tue, 26 Apr 2016 12:45:02 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QCj2wm095098; Tue, 26 Apr 2016 12:45:02 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604261245.u3QCj2wm095098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Apr 2016 12:45:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298635 - head/sys/riscv/riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 12:45:03 -0000 Author: br Date: Tue Apr 26 12:45:01 2016 New Revision: 298635 URL: https://svnweb.freebsd.org/changeset/base/298635 Log: Add the implementation of basic bus_space_read/write functions. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Added: head/sys/riscv/riscv/bus_space_asm.S (contents, props changed) Modified: head/sys/riscv/riscv/bus_machdep.c Modified: head/sys/riscv/riscv/bus_machdep.c ============================================================================== --- head/sys/riscv/riscv/bus_machdep.c Tue Apr 26 12:36:12 2016 (r298634) +++ head/sys/riscv/riscv/bus_machdep.c Tue Apr 26 12:45:01 2016 (r298635) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2014 Andrew Turner * Copyright (c) 2015 Ruslan Bukin * All rights reserved. * @@ -42,27 +43,108 @@ __FBSDID("$FreeBSD$"); #include +uint8_t generic_bs_r_1(void *, bus_space_handle_t, bus_size_t); +uint16_t generic_bs_r_2(void *, bus_space_handle_t, bus_size_t); +uint32_t generic_bs_r_4(void *, bus_space_handle_t, bus_size_t); +uint64_t generic_bs_r_8(void *, bus_space_handle_t, bus_size_t); + +void generic_bs_rm_1(void *, bus_space_handle_t, bus_size_t, uint8_t *, + bus_size_t); +void generic_bs_rm_2(void *, bus_space_handle_t, bus_size_t, uint16_t *, + bus_size_t); +void generic_bs_rm_4(void *, bus_space_handle_t, bus_size_t, uint32_t *, + bus_size_t); +void generic_bs_rm_8(void *, bus_space_handle_t, bus_size_t, uint64_t *, + bus_size_t); + +void generic_bs_rr_1(void *, bus_space_handle_t, bus_size_t, uint8_t *, + bus_size_t); +void generic_bs_rr_2(void *, bus_space_handle_t, bus_size_t, uint16_t *, + bus_size_t); +void generic_bs_rr_4(void *, bus_space_handle_t, bus_size_t, uint32_t *, + bus_size_t); +void generic_bs_rr_8(void *, bus_space_handle_t, bus_size_t, uint64_t *, + bus_size_t); + +void generic_bs_w_1(void *, bus_space_handle_t, bus_size_t, uint8_t); +void generic_bs_w_2(void *, bus_space_handle_t, bus_size_t, uint16_t); +void generic_bs_w_4(void *, bus_space_handle_t, bus_size_t, uint32_t); +void generic_bs_w_8(void *, bus_space_handle_t, bus_size_t, uint64_t); + +void generic_bs_wm_1(void *, bus_space_handle_t, bus_size_t, const uint8_t *, + bus_size_t); +void generic_bs_wm_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *, + bus_size_t); +void generic_bs_wm_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *, + bus_size_t); +void generic_bs_wm_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *, + bus_size_t); + +void generic_bs_wr_1(void *, bus_space_handle_t, bus_size_t, const uint8_t *, + bus_size_t); +void generic_bs_wr_2(void *, bus_space_handle_t, bus_size_t, const uint16_t *, + bus_size_t); +void generic_bs_wr_4(void *, bus_space_handle_t, bus_size_t, const uint32_t *, + bus_size_t); +void generic_bs_wr_8(void *, bus_space_handle_t, bus_size_t, const uint64_t *, + bus_size_t); + +static int +generic_bs_map(void *t, bus_addr_t bpa, bus_size_t size, int flags, + bus_space_handle_t *bshp) +{ + void *va; + + va = pmap_mapdev(bpa, size); + if (va == NULL) + return (ENOMEM); + *bshp = (bus_space_handle_t)va; + return (0); +} + +static void +generic_bs_unmap(void *t, bus_space_handle_t bsh, bus_size_t size) +{ + + pmap_unmapdev(bsh, size); +} + +static void +generic_bs_barrier(void *t, bus_space_handle_t bsh, bus_size_t offset, + bus_size_t size, int flags) +{ +} + +static int +generic_bs_subregion(void *t, bus_space_handle_t bsh, bus_size_t offset, + bus_size_t size, bus_space_handle_t *nbshp) +{ + + *nbshp = bsh + offset; + return (0); +} + struct bus_space memmap_bus = { /* cookie */ .bs_cookie = NULL, /* mapping/unmapping */ - .bs_map = NULL, - .bs_unmap = NULL, - .bs_subregion = NULL, + .bs_map = generic_bs_map, + .bs_unmap = generic_bs_unmap, + .bs_subregion = generic_bs_subregion, /* allocation/deallocation */ .bs_alloc = NULL, .bs_free = NULL, /* barrier */ - .bs_barrier = NULL, + .bs_barrier = generic_bs_barrier, /* read single */ - .bs_r_1 = NULL, - .bs_r_2 = NULL, - .bs_r_4 = NULL, - .bs_r_8 = NULL, + .bs_r_1 = generic_bs_r_1, + .bs_r_2 = generic_bs_r_2, + .bs_r_4 = generic_bs_r_4, + .bs_r_8 = generic_bs_r_8, /* read multiple */ .bs_rm_1 = NULL, @@ -71,10 +153,10 @@ struct bus_space memmap_bus = { .bs_rm_8 = NULL, /* write single */ - .bs_w_1 = NULL, - .bs_w_2 = NULL, - .bs_w_4 = NULL, - .bs_w_8 = NULL, + .bs_w_1 = generic_bs_w_1, + .bs_w_2 = generic_bs_w_2, + .bs_w_4 = generic_bs_w_4, + .bs_w_8 = generic_bs_w_8, /* write multiple */ .bs_wm_1 = NULL, @@ -142,3 +224,7 @@ struct bus_space memmap_bus = { .bs_wr_4_s = NULL, .bs_wr_8_s = NULL, }; + +#ifdef FDT +bus_space_tag_t fdtbus_bs_tag = &memmap_bus; +#endif Added: head/sys/riscv/riscv/bus_space_asm.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/riscv/bus_space_asm.S Tue Apr 26 12:45:01 2016 (r298635) @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2016 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. + */ + +#include + +__FBSDID("$FreeBSD$"); + +ENTRY(generic_bs_r_1) + add a3, a1, a2 + lb a0, 0(a3) + ret +END(generic_bs_r_1) + +ENTRY(generic_bs_r_2) + add a3, a1, a2 + lh a0, 0(a3) + ret +END(generic_bs_r_2) + +ENTRY(generic_bs_r_4) + add a3, a1, a2 + lw a0, 0(a3) + ret +END(generic_bs_r_4) + +ENTRY(generic_bs_r_8) + add a3, a1, a2 + ld a0, 0(a3) + ret +END(generic_bs_r_8) + +ENTRY(generic_bs_w_1) + add a4, a1, a2 + sb a3, 0(a4) + ret +END(generic_bs_w_1) + +ENTRY(generic_bs_w_2) + add a4, a1, a2 + sh a3, 0(a4) + ret +END(generic_bs_w_2) + +ENTRY(generic_bs_w_4) + add a4, a1, a2 + sw a3, 0(a4) + ret +END(generic_bs_w_4) + +ENTRY(generic_bs_w_8) + add a4, a1, a2 + sd a3, 0(a4) + ret +END(generic_bs_w_8) From owner-svn-src-head@freebsd.org Tue Apr 26 12:56:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6D5EB1CAB3; Tue, 26 Apr 2016 12:56:46 +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 7713513B2; Tue, 26 Apr 2016 12:56:46 +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 u3QCujAw098133; Tue, 26 Apr 2016 12:56:45 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QCujga098127; Tue, 26 Apr 2016 12:56:45 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604261256.u3QCujga098127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Apr 2016 12:56:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298636 - in head/sys/riscv: include riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 12:56:46 -0000 Author: br Date: Tue Apr 26 12:56:44 2016 New Revision: 298636 URL: https://svnweb.freebsd.org/changeset/base/298636 Log: Add the non-standard "IO interrupt" vector used by lowRISC. For now they provide UART irq only. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/sys/riscv/include/intr.h head/sys/riscv/include/riscvreg.h head/sys/riscv/riscv/exception.S head/sys/riscv/riscv/intr_machdep.c Modified: head/sys/riscv/include/intr.h ============================================================================== --- head/sys/riscv/include/intr.h Tue Apr 26 12:45:01 2016 (r298635) +++ head/sys/riscv/include/intr.h Tue Apr 26 12:56:44 2016 (r298636) @@ -60,6 +60,8 @@ enum { IRQ_SOFTWARE, IRQ_TIMER, IRQ_HTIF, + IRQ_COP, /* lowRISC only */ + IRQ_UART, /* lowRISC only */ NIRQS }; Modified: head/sys/riscv/include/riscvreg.h ============================================================================== --- head/sys/riscv/include/riscvreg.h Tue Apr 26 12:45:01 2016 (r298635) +++ head/sys/riscv/include/riscvreg.h Tue Apr 26 12:56:44 2016 (r298636) @@ -47,7 +47,8 @@ #define ECALL_SEND_IPI 0x07 #define ECALL_CLEAR_IPI 0x08 #define ECALL_HTIF_LOWPUTC 0x09 -#define ECALL_MIE_SET 0x10 +#define ECALL_MIE_SET 0x0a +#define ECALL_IO_IRQ_MASK 0x0b #define EXCP_SHIFT 0 #define EXCP_MASK (0xf << EXCP_SHIFT) @@ -119,6 +120,7 @@ #define NCSRS 4096 #define CSR_IPI 0x783 +#define CSR_IO_IRQ 0x7c0 /* lowRISC only? */ #define XLEN 8 #define INSN_SIZE 4 Modified: head/sys/riscv/riscv/exception.S ============================================================================== --- head/sys/riscv/riscv/exception.S Tue Apr 26 12:45:01 2016 (r298635) +++ head/sys/riscv/riscv/exception.S Tue Apr 26 12:56:44 2016 (r298636) @@ -270,18 +270,27 @@ supervisor_trap: machine_interrupt: /* Type of interrupt ? */ csrr t0, mcause - andi t0, t0, 3 + andi t0, t0, EXCP_MASK li t1, 0 beq t1, t0, software_interrupt li t1, 1 beq t1, t0, timer_interrupt li t1, 2 beq t1, t0, htif_interrupt + li t1, 4 + beq t1, t0, io_interrupt /* lowRISC only */ /* not reached */ 1: j 1b +io_interrupt: + /* Disable IO interrupts so we can go to supervisor mode */ + csrwi CSR_IO_IRQ, 0 + + /* Handle the trap in supervisor mode */ + j exit_mrts + software_interrupt: li t0, MIP_MSIP csrc mip, t0 @@ -307,7 +316,7 @@ software_interrupt: j exit 1: - /* Serve a trap in supervisor mode */ + /* Handle the trap in supervisor mode */ j exit_mrts timer_interrupt: @@ -415,6 +424,12 @@ supervisor_call: beq t5, t4, htif_lowputc li t4, ECALL_MIE_SET beq t5, t4, mie_set + li t4, ECALL_IO_IRQ_MASK + beq t5, t4, io_irq_mask + j exit_next_instr + +io_irq_mask: + csrw CSR_IO_IRQ, t6 j exit_next_instr mie_set: Modified: head/sys/riscv/riscv/intr_machdep.c ============================================================================== --- head/sys/riscv/riscv/intr_machdep.c Tue Apr 26 12:45:01 2016 (r298635) +++ head/sys/riscv/riscv/intr_machdep.c Tue Apr 26 12:56:44 2016 (r298636) @@ -101,6 +101,9 @@ riscv_mask_irq(void *source) case IRQ_SOFTWARE: csr_clear(sie, SIE_SSIE); break; + case IRQ_UART: + machine_command(ECALL_IO_IRQ_MASK, 0); + break; default: panic("Unknown irq %d\n", irq); } @@ -120,6 +123,9 @@ riscv_unmask_irq(void *source) case IRQ_SOFTWARE: csr_set(sie, SIE_SSIE); break; + case IRQ_UART: + machine_command(ECALL_IO_IRQ_MASK, 1); + break; default: panic("Unknown irq %d\n", irq); } @@ -203,6 +209,7 @@ riscv_cpu_intr(struct trapframe *frame) active_irq = (frame->tf_scause & EXCP_MASK); switch (active_irq) { + case IRQ_UART: case IRQ_SOFTWARE: case IRQ_TIMER: event = intr_events[active_irq]; From owner-svn-src-head@freebsd.org Tue Apr 26 13:16:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0227CB1CF02; Tue, 26 Apr 2016 13:16:47 +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 C39301DBC; Tue, 26 Apr 2016 13:16:46 +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 u3QDGjfE004172; Tue, 26 Apr 2016 13:16:45 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QDGjYf004171; Tue, 26 Apr 2016 13:16:45 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604261316.u3QDGjYf004171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 26 Apr 2016 13:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298637 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 13:16:47 -0000 Author: andrew Date: Tue Apr 26 13:16:45 2016 New Revision: 298637 URL: https://svnweb.freebsd.org/changeset/base/298637 Log: Stop including machine/fdt.h from the fdt uart code, it's unneeded. Sponsored by: ABT Systems Ltd Modified: head/sys/dev/uart/uart_cpu_fdt.c Modified: head/sys/dev/uart/uart_cpu_fdt.c ============================================================================== --- head/sys/dev/uart/uart_cpu_fdt.c Tue Apr 26 12:56:44 2016 (r298636) +++ head/sys/dev/uart/uart_cpu_fdt.c Tue Apr 26 13:16:45 2016 (r298637) @@ -42,9 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if !defined(__aarch64__) && !defined(__riscv__) -#include -#endif #include #include From owner-svn-src-head@freebsd.org Tue Apr 26 13:22:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73149B1D126; Tue, 26 Apr 2016 13:22:10 +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 3624F110F; Tue, 26 Apr 2016 13:22:10 +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 u3QDM9RF007024; Tue, 26 Apr 2016 13:22:09 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QDM8jx007015; Tue, 26 Apr 2016 13:22:08 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604261322.u3QDM8jx007015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Apr 2016 13:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298638 - in head/sys: boot/fdt/dts/riscv conf riscv/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 13:22:10 -0000 Author: br Date: Tue Apr 26 13:22:08 2016 New Revision: 298638 URL: https://svnweb.freebsd.org/changeset/base/298638 Log: o Add device tree files and kernel configuration files for RISC-V cpus synthesized on FPGA hardware. o Include new files to the build. Added: head/sys/boot/fdt/dts/riscv/lowrisc.dts (contents, props changed) head/sys/boot/fdt/dts/riscv/rocket.dts (contents, props changed) head/sys/riscv/conf/LOWRISC (contents, props changed) head/sys/riscv/conf/LOWRISC.hints (contents, props changed) head/sys/riscv/conf/ROCKET (contents, props changed) Modified: head/sys/conf/files.riscv head/sys/riscv/conf/GENERIC head/sys/riscv/conf/QEMU head/sys/riscv/conf/SPIKE Added: head/sys/boot/fdt/dts/riscv/lowrisc.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/riscv/lowrisc.dts Tue Apr 26 13:22:08 2016 (r298638) @@ -0,0 +1,108 @@ +/*- + * Copyright (c) 2016 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$ + */ + +/dts-v1/; + +/ { + model = "UC Berkeley Spike Simulator RV64I"; + compatible = "riscv,rv64i"; + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "riscv,rv64i"; + reg = <0x40002000>; + }; + }; + + aliases { + serial0 = &serial0; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x8000000>; /* 128MB at 0x0 */ + }; + + soc { + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + compatible = "simple-bus"; + ranges; + + pic0: pic@0 { + compatible = "riscv,pic"; + interrupt-controller; + }; + + serial0: serial@80001000 { + compatible = "ns16550"; + reg = <0x80001000 0x1000>; + reg-shift = <2>; + interrupts = < 4 >; + interrupt-parent = <&pic0>; + current-speed = <115200>; + clock-frequency = < 1000000 >; + status = "okay"; + }; + + spi0: spi@80010000 { + compatible = "xlnx,xps-spi-3.2"; + reg = <0x80010000 0x1000>; + }; + + timer0: timer@0 { + compatible = "riscv,timer"; + interrupts = < 1 >; + interrupt-parent = < &pic0 >; + clock-frequency = < 1000000 >; + }; + }; + + chosen { + bootargs = "-v"; + stdin = "serial0"; + stdout = "serial0"; + }; +}; Added: head/sys/boot/fdt/dts/riscv/rocket.dts ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/riscv/rocket.dts Tue Apr 26 13:22:08 2016 (r298638) @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2016 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$ + */ + +/dts-v1/; + +/ { + model = "UC Berkeley Spike Simulator RV64I"; + compatible = "riscv,rv64i"; + #address-cells = <1>; + #size-cells = <1>; + #interrupt-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + cpu@0 { + device_type = "cpu"; + compatible = "riscv,rv64i"; + reg = <0x40002000>; + }; + }; + + aliases { + console0 = &console0; + }; + + memory { + device_type = "memory"; + reg = <0x0 0x10000000>; /* 256MB at 0x0 */ + }; + + soc { + #address-cells = <2>; + #size-cells = <2>; + #interrupt-cells = <1>; + + compatible = "simple-bus"; + ranges; + + pic0: pic@0 { + compatible = "riscv,pic"; + interrupt-controller; + }; + + timer0: timer@0 { + compatible = "riscv,timer"; + interrupts = < 1 >; + interrupt-parent = < &pic0 >; + clock-frequency = < 1000000 >; + }; + + htif0: htif@0 { + compatible = "riscv,htif"; + interrupts = < 0 >; + interrupt-parent = < &pic0 >; + + console0: console@0 { + compatible = "htif,console"; + status = "okay"; + }; + }; + }; + + chosen { + bootargs = "-v"; + stdin = "console0"; + stdout = "console0"; + }; +}; Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Tue Apr 26 13:16:45 2016 (r298637) +++ head/sys/conf/files.riscv Tue Apr 26 13:22:08 2016 (r298638) @@ -2,6 +2,8 @@ crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/ofw/ofw_cpu.c optional fdt +dev/uart/uart_cpu_fdt.c optional uart fdt +dev/xilinx/axi_quad_spi.c optional xilinx_spi kern/kern_clocksource.c standard kern/subr_devmap.c standard kern/subr_dummy_vdso_tc.c standard @@ -13,12 +15,13 @@ libkern/flsl.c standard libkern/flsll.c standard libkern/memmove.c standard libkern/memset.c standard -riscv/htif/htif.c standard -riscv/htif/htif_block.c standard -riscv/htif/htif_console.c standard +riscv/htif/htif.c optional htif +riscv/htif/htif_block.c optional htif +riscv/htif/htif_console.c optional htif riscv/riscv/autoconf.c standard riscv/riscv/bcopy.c standard riscv/riscv/bus_machdep.c standard +riscv/riscv/bus_space_asm.S standard riscv/riscv/busdma_machdep.c standard riscv/riscv/clock.c standard riscv/riscv/copyinout.S standard @@ -38,6 +41,7 @@ riscv/riscv/minidump_machdep.c standard riscv/riscv/mp_machdep.c optional smp riscv/riscv/mem.c standard riscv/riscv/nexus.c standard +riscv/riscv/ofw_machdep.c optional fdt riscv/riscv/pmap.c standard riscv/riscv/stack_machdep.c optional ddb | stack riscv/riscv/support.S standard Modified: head/sys/riscv/conf/GENERIC ============================================================================== --- head/sys/riscv/conf/GENERIC Tue Apr 26 13:16:45 2016 (r298637) +++ head/sys/riscv/conf/GENERIC Tue Apr 26 13:22:08 2016 (r298638) @@ -90,8 +90,6 @@ options INVARIANT_SUPPORT # Extra sanit # options WITNESS # Enable checks to detect deadlocks and cycles # options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones - -options ROOTDEVNAME=\"ufs:/dev/htif_blk0\" # options EARLY_PRINTF # Pseudo devices. Added: head/sys/riscv/conf/LOWRISC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/conf/LOWRISC Tue Apr 26 13:22:08 2016 (r298638) @@ -0,0 +1,43 @@ +# +# Kernel configuration file for lowRISC. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC +ident LOWRISC + +hints "LOWRISC.hints" + +options ROOTDEVNAME=\"ufs:mmcsd0s2\" + +# MMC/SD +device mmc +device mmcsd +# device mmc_spi + +# SPI +device spibus +device xilinx_spi + +# Serial (COM) ports +device uart # Generic UART driver +device uart_ns8250 # ns8250-type UART driver + +# RISCVTODO: This needs to be done via loader (when it's available). +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=lowrisc.dts Added: head/sys/riscv/conf/LOWRISC.hints ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/conf/LOWRISC.hints Tue Apr 26 13:22:08 2016 (r298638) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# MMC device +hint.mmc_spi.0.at="spibus0" +hint.mmc_spi.0.cs=0 Modified: head/sys/riscv/conf/QEMU ============================================================================== --- head/sys/riscv/conf/QEMU Tue Apr 26 13:16:45 2016 (r298637) +++ head/sys/riscv/conf/QEMU Tue Apr 26 13:22:08 2016 (r298638) @@ -21,6 +21,9 @@ include GENERIC ident QEMU +device htif +options ROOTDEVNAME=\"ufs:/dev/htif_blk0\" + # RISCVTODO: This needs to be done via loader (when it's available). options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=qemu.dts Added: head/sys/riscv/conf/ROCKET ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/conf/ROCKET Tue Apr 26 13:22:08 2016 (r298638) @@ -0,0 +1,29 @@ +# +# Kernel configuration file for Rocket Core. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC +ident ROCKET + +device htif +options ROOTDEVNAME=\"ufs:/dev/htif_blk0\" + +# RISCVTODO: This needs to be done via loader (when it's available). +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=rocket.dts Modified: head/sys/riscv/conf/SPIKE ============================================================================== --- head/sys/riscv/conf/SPIKE Tue Apr 26 13:16:45 2016 (r298637) +++ head/sys/riscv/conf/SPIKE Tue Apr 26 13:22:08 2016 (r298638) @@ -21,6 +21,9 @@ include GENERIC ident SPIKE +device htif +options ROOTDEVNAME=\"ufs:/dev/htif_blk0\" + # RISCVTODO: This needs to be done via loader (when it's available). options FDT_DTB_STATIC makeoptions FDT_DTS_FILE=spike.dts From owner-svn-src-head@freebsd.org Tue Apr 26 13:26:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CC63B1D200; Tue, 26 Apr 2016 13:26:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0893713DC; Tue, 26 Apr 2016 13:26:57 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x235.google.com with SMTP id u185so17904209iod.3; Tue, 26 Apr 2016 06:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=S9gHl1GiEea2o1bsV2Qlnf1LLqJgqPe4HGE3VZ8EmBo=; b=F6iLKKuZhKoxy+SeDttVyJVCnrwdaqJ0rlzQRfwe8xgWRWJ/x7zilyclMQzEQSKAc+ wsqKLWXLnBfyB1LPpu3w0eCfK2qYDPZDEHvYi3/q9ZegRPnziAliE2cXJX/fw6cxrAVf BqSx1NxAKKCtX1agCP6HseMF7j3YbyXGqd8AF3NgIO6mzn2Y/385Ox/sCan2NhD6rCTj rtRexwK0JKQ5+lXSX6lwpiAMzFuk30kxoMFKZtpiFY40u+qAx4dTxLAXGy2ovt8K32vF DQ0MX9pBi4vlxjFzxMdAhFIDHtpoNnrQd5jrUN9Wec/ZBAAZaaEwwRbE4YKHVE7dgkPZ c9wQ== 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; bh=S9gHl1GiEea2o1bsV2Qlnf1LLqJgqPe4HGE3VZ8EmBo=; b=hT2sRMAfJ96KDeeK1P8Qa81bTHd9Ef/LCIPBWxBMsybtuLs3yE7Qeoijw+IX2fCARl rC84AOn9E8OOcO+YDZ+20qM9jZCeBhCdg+OGSK7d7JlaVubCaLbrrwoMlQ9NuDg9ui7k xB1AgiE+H33YHTGum0v80dz1qNw7K0kYTrgvsRrbdc6y65dHGqbqW0m3bmHCvkoXvI3y nbdcbm54Fb66EL5zUEW1U/IuamqGGxLN6OIIRjG0l7XhWmcCR+YOkEJXB3BW6t7WnAMA bVleLoMj8RVevpKRilUeWmXFRLOrMsDGS5w1zqsjXYq50GaVUYg/Q59muFI4DVjEUHjs Flzg== X-Gm-Message-State: AOPr4FV8DSYis45CT+pkATmt9SBytFOi7UNgZT2W+V3poay89XBbM+X1s9DPdoZH6+SebmU5iWteSJKjCtMncA== MIME-Version: 1.0 X-Received: by 10.107.16.137 with SMTP id 9mr3441094ioq.75.1461677216494; Tue, 26 Apr 2016 06:26:56 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Tue, 26 Apr 2016 06:26:56 -0700 (PDT) In-Reply-To: References: <201604260440.u3Q4exZD045896@repo.freebsd.org> Date: Tue, 26 Apr 2016 06:26:56 -0700 X-Google-Sender-Auth: 7COoRwUtgk09YgEj2JWGSFg4dec Message-ID: Subject: Re: svn commit: r298612 - head/sys/dev/iwm From: Adrian Chadd To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 13:26:57 -0000 You're right in all counts; this was just a first cut to at least get it done and working. We can iterate over it and tidy things up. (It's creepy being able to use iwm now and have it magically "work"..) -adrian From owner-svn-src-head@freebsd.org Tue Apr 26 13:27:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 197DCB1D269; Tue, 26 Apr 2016 13:27:52 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8D2916EF; Tue, 26 Apr 2016 13:27:51 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x233.google.com with SMTP id u185so17933444iod.3; Tue, 26 Apr 2016 06:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=TT+Qcc/VJgBle0he5ZuMesCmCwxXdxF1eJQi/8c4pT8=; b=xFo6ZESLSWYodPitj8bB5PL2C4YwfUH7v2HDjJRx0+4BsoqTc1Cx/hImJUpIAQrYnG eErI3NjV7A2aoJmpS4W+1hlgCG96Sq7iccZOcq3pIJTFlcM81rj7FXDyPtOEwfG7h+pb f+zL0y6SY+h3AjfxmVafelGc2oGhodCKRQXtCDycNuH/64EHkHjzqiBuj5lAGeSWOusD qijdmJvRo9tTEFwSq0sQGiPjeF6O1Uk1qsEht9esKEz5BdywhiLP/GZBhpXxX/XDBBM9 pw6nPzOXYt8OpqLu1ASybZQ0yrep10+PF9c673wPCcHJ4ntvqzhuoMjOCG4T+8BtfLXm dy5g== 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; bh=TT+Qcc/VJgBle0he5ZuMesCmCwxXdxF1eJQi/8c4pT8=; b=CFDMpO11qxCCkXg4WYImu/5hrApeCrswf5M6yyNG4pYkOLxyDMtF23ETX4CpXJbaiF yF4ldyy5xIBqBOtcRAWj1F1oeWxpxIsLr/aKcuwf6c5seYWNCYBnj2N+g/s/03koQfEC sLJdlts6cV6kVK/f4Zf84uzvvqzSCcrU2B0S5K2ZeuhW34uw4JAm0sLJbhcti9pTV/bt +AQqM/2TdvRUSTYRuZZ6HNPBaZSVJpS0thgiE/eDehKjZ3NJ1JsuDAmtMrvMWf+xZuwb He3HZ97Q86Ds6Ij4ZR0m0tM1QYhRMBJITxGmmhmE4SsCxfFzzAG0yNF0MQf7eI/vJm7P mqHg== X-Gm-Message-State: AOPr4FUc8a4UnlL/OoRuc0NaGWbOlsKPbPtR7uhWXH2vykWs1XSTNOjFWNsEYcLQ2Zotsj6as74zZO40vAlZzg== MIME-Version: 1.0 X-Received: by 10.107.144.135 with SMTP id s129mr3361555iod.165.1461677271407; Tue, 26 Apr 2016 06:27:51 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Tue, 26 Apr 2016 06:27:51 -0700 (PDT) In-Reply-To: References: <201604260440.u3Q4exZD045896@repo.freebsd.org> Date: Tue, 26 Apr 2016 06:27:51 -0700 X-Google-Sender-Auth: 0OMhj1-RCNf4MrAkwHd9hDv9sdY Message-ID: Subject: Re: svn commit: r298612 - head/sys/dev/iwm From: Adrian Chadd 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 13:27:52 -0000 it's a dirty habit I learnt from linux. Seeing the '!!' says "it's always 1 or 0". I get into that habit so the same thing happens when you do bit masking, eg: do_stop = (foo & 0x10) ; is 0x10 or 0, but do_stop = !! (foo & 0x10); is 1 or 0. -adrian On 25 April 2016 at 21:45, Ravi Pokala wrote: >> do_stop = !! (sc->sc_ic.ic_nrunning > 0); > > Why the double-negation? Isn't > > do_stop = (sc->sc_ic.ic_nrunning > 0); > > equivalent? > > -Ravi (rpokala@) > > > > -----Original Message----- > From: on behalf of Adrian Chadd > Date: 2016-04-25, Monday at 21:40 > To: , , > Subject: svn commit: r298612 - head/sys/dev/iwm > >>Author: adrian >>Date: Tue Apr 26 04:40:59 2016 >>New Revision: 298612 >>URL: https://svnweb.freebsd.org/changeset/base/298612 >> >>Log: >> [iwm] implement suspend/resume through ieee80211_{suspend,resume}_all >> >> This allows wifi to associate correctly after a suspend/resume cycle. >> >> Yes, I'm using this now day to day. >> >> Tested: >> >> * Intel 7260AC, STA mode >> >>Modified: >> head/sys/dev/iwm/if_iwm.c >> head/sys/dev/iwm/if_iwmvar.h >> >>Modified: head/sys/dev/iwm/if_iwm.c >>============================================================================== >>--- head/sys/dev/iwm/if_iwm.c Tue Apr 26 03:24:28 2016 (r298611) >>+++ head/sys/dev/iwm/if_iwm.c Tue Apr 26 04:40:59 2016 (r298612) >>@@ -4934,6 +4934,8 @@ iwm_init_task(void *arg1) >> static int >> iwm_resume(device_t dev) >> { >>+ struct iwm_softc *sc = device_get_softc(dev); >>+ int do_reinit = 0; >> uint16_t reg; >> >> /* Clear device-specific "PCI retry timeout" register (41h). */ >>@@ -4941,17 +4943,33 @@ iwm_resume(device_t dev) >> pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); >> iwm_init_task(device_get_softc(dev)); >> >>+ IWM_LOCK(sc); >>+ if (sc->sc_flags & IWM_FLAG_DORESUME) { >>+ sc->sc_flags &= ~IWM_FLAG_DORESUME; >>+ do_reinit = 1; >>+ } >>+ IWM_UNLOCK(sc); >>+ >>+ if (do_reinit) >>+ ieee80211_resume_all(&sc->sc_ic); >>+ >> return 0; >> } >> >> static int >> iwm_suspend(device_t dev) >> { >>+ int do_stop = 0; >> struct iwm_softc *sc = device_get_softc(dev); >> >>- if (sc->sc_ic.ic_nrunning > 0) { >>+ do_stop = !! (sc->sc_ic.ic_nrunning > 0); >>+ >>+ ieee80211_suspend_all(&sc->sc_ic); >>+ >>+ if (do_stop) { >> IWM_LOCK(sc); >> iwm_stop(sc); >>+ sc->sc_flags |= IWM_FLAG_DORESUME; >> IWM_UNLOCK(sc); >> } >> >> >>Modified: head/sys/dev/iwm/if_iwmvar.h >>============================================================================== >>--- head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 03:24:28 2016 (r298611) >>+++ head/sys/dev/iwm/if_iwmvar.h Tue Apr 26 04:40:59 2016 (r298612) >>@@ -405,6 +405,7 @@ struct iwm_softc { >> #define IWM_FLAG_STOPPED (1 << 2) >> #define IWM_FLAG_RFKILL (1 << 3) >> #define IWM_FLAG_BUSY (1 << 4) >>+#define IWM_FLAG_DORESUME (1 << 5) >> >> struct intr_config_hook sc_preinit_hook; >> struct callout sc_watchdog_to; >> > From owner-svn-src-head@freebsd.org Tue Apr 26 14:21:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C92CB1DE3F; Tue, 26 Apr 2016 14:21: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 DE588106C; Tue, 26 Apr 2016 14:21:40 +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 u3QELeRR022957; Tue, 26 Apr 2016 14:21:40 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QELeH3022956; Tue, 26 Apr 2016 14:21:40 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604261421.u3QELeH3022956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 26 Apr 2016 14:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298639 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 14:21:41 -0000 Author: andrew Date: Tue Apr 26 14:21:39 2016 New Revision: 298639 URL: https://svnweb.freebsd.org/changeset/base/298639 Log: Disable ACPI on arm64 ad it has only had minimal testing and is causing boot issues when booting with FDT. It is planned to re-enable this at a later date. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Tue Apr 26 13:22:08 2016 (r298638) +++ head/sys/arm64/conf/GENERIC Tue Apr 26 14:21:39 2016 (r298639) @@ -153,7 +153,7 @@ device bpf # Berkeley packet filter options THUNDERX_PASS_1_1_ERRATA options FDT -device acpi +#device acpi # The crypto framework is required by IPSEC device crypto # Required by IPSEC From owner-svn-src-head@freebsd.org Tue Apr 26 14:31:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC0B3B1C22D; Tue, 26 Apr 2016 14:31:49 +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 7DF951AC9; Tue, 26 Apr 2016 14:31:49 +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 u3QEVm2d026136; Tue, 26 Apr 2016 14:31:48 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QEVm3w026135; Tue, 26 Apr 2016 14:31:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604261431.u3QEVm3w026135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 14:31:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298640 - head/bin/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 14:31:49 -0000 Author: pfg Date: Tue Apr 26 14:31:48 2016 New Revision: 298640 URL: https://svnweb.freebsd.org/changeset/base/298640 Log: ed(1): switch two statements so we check the index before dereferencing. This is related to r270256 but was missed in that occasion. MFC after: 3 days Modified: head/bin/ed/cbc.c Modified: head/bin/ed/cbc.c ============================================================================== --- head/bin/ed/cbc.c Tue Apr 26 14:21:39 2016 (r298639) +++ head/bin/ed/cbc.c Tue Apr 26 14:31:48 2016 (r298640) @@ -257,7 +257,7 @@ expand_des_key(char *obuf, char *kbuf) /* * now translate it, bombing on any illegal binary digit */ - for (i = 0; kbuf[i] && i < 16; i++) + for (i = 0; i < 16 && kbuf[i]; i++) if ((nbuf[i] = hex_to_binary((int) kbuf[i], 2)) == -1) des_error("bad binary digit in key"); while (i < 64) From owner-svn-src-head@freebsd.org Tue Apr 26 14:38:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6C9FB1C36B; Tue, 26 Apr 2016 14:38:19 +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 8F52C1EF0; Tue, 26 Apr 2016 14:38:19 +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 u3QEcIiH028347; Tue, 26 Apr 2016 14:38:18 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QEcIQ9028345; Tue, 26 Apr 2016 14:38:18 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604261438.u3QEcIQ9028345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Apr 2016 14:38:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298641 - in head/sys/riscv: include riscv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 14:38:19 -0000 Author: br Date: Tue Apr 26 14:38:18 2016 New Revision: 298641 URL: https://svnweb.freebsd.org/changeset/base/298641 Log: Rework the list of all pmaps: embed the list link into pmap. Modified: head/sys/riscv/include/pmap.h head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/include/pmap.h ============================================================================== --- head/sys/riscv/include/pmap.h Tue Apr 26 14:31:48 2016 (r298640) +++ head/sys/riscv/include/pmap.h Tue Apr 26 14:38:18 2016 (r298641) @@ -74,18 +74,12 @@ struct pv_addr { vm_paddr_t pv_pa; }; -/* An entry in the list of all pmaps */ -struct pmap_list_entry { - SLIST_ENTRY(pmap_list_entry) pmap_link; - struct pmap *pmap; -}; - struct pmap { struct mtx pm_mtx; struct pmap_statistics pm_stats; /* pmap statictics */ pd_entry_t *pm_l1; TAILQ_HEAD(,pv_chunk) pm_pvchunk; /* list of mappings in pmap */ - struct pmap_list_entry *p_entry; /* Place in the list of all pmaps */ + LIST_ENTRY(pmap) pm_list; /* List of all pmaps */ }; typedef struct pv_entry { Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Tue Apr 26 14:31:48 2016 (r298640) +++ head/sys/riscv/riscv/pmap.c Tue Apr 26 14:38:18 2016 (r298641) @@ -207,9 +207,9 @@ __FBSDID("$FreeBSD$"); #define VM_PAGE_TO_PV_LIST_LOCK(m) \ PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) -/* The list of all the pmaps */ -static SLIST_HEAD(, pmap_list_entry) pmap_list = - SLIST_HEAD_INITIALIZER(pmap_list); +/* The list of all the user pmaps */ +LIST_HEAD(pmaplist, pmap); +static struct pmaplist allpmaps; static MALLOC_DEFINE(M_VMPMAP, "pmap", "PMAP L1"); @@ -416,7 +416,6 @@ static void pmap_distribute_l1(struct pmap *pmap, vm_pindex_t l1index, pt_entry_t entry) { - struct pmap_list_entry *p_entry; struct pmap *user_pmap; pd_entry_t *l1; @@ -424,8 +423,7 @@ pmap_distribute_l1(struct pmap *pmap, vm if (pmap != kernel_pmap) return; - SLIST_FOREACH(p_entry, &pmap_list, pmap_link) { - user_pmap = p_entry->pmap; + LIST_FOREACH(user_pmap, &allpmaps, pm_list) { l1 = &user_pmap->pm_l1[l1index]; if (entry) pmap_load_store(l1, entry); @@ -569,6 +567,8 @@ pmap_bootstrap(vm_offset_t l1pt, vm_padd */ rw_init(&pvh_global_lock, "pmap pv global"); + LIST_INIT(&allpmaps); + /* Assume the address we were loaded to is a valid physical address */ min_pa = KERNBASE - kern_delta; @@ -1177,7 +1177,6 @@ pmap_pinit0(pmap_t pmap) int pmap_pinit(pmap_t pmap) { - struct pmap_list_entry *p_entry; vm_paddr_t l1phys; vm_page_t l1pt; @@ -1199,12 +1198,8 @@ pmap_pinit(pmap_t pmap) /* Install kernel pagetables */ memcpy(pmap->pm_l1, kernel_pmap->pm_l1, PAGE_SIZE); - p_entry = malloc(sizeof(struct pmap_list_entry), M_VMPMAP, M_WAITOK); - p_entry->pmap = pmap; - pmap->p_entry = p_entry; - - /* Add to the list of all pmaps */ - SLIST_INSERT_HEAD(&pmap_list, p_entry, pmap_link); + /* Add to the list of all user pmaps */ + LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); return (1); } @@ -1374,12 +1369,11 @@ pmap_release(pmap_t pmap) atomic_subtract_int(&vm_cnt.v_wire_count, 1); vm_page_free_zero(m); + /* Remove pmap from the allpmaps list */ + LIST_REMOVE(pmap, pm_list); + /* Remove kernel pagetables */ bzero(pmap->pm_l1, PAGE_SIZE); - - /* Remove pmap from the all pmaps list */ - SLIST_REMOVE(&pmap_list, pmap->p_entry, - pmap_list_entry, pmap_link); } #if 0 From owner-svn-src-head@freebsd.org Tue Apr 26 14:40:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DEFBB1C461; Tue, 26 Apr 2016 14:40:14 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) Received: from ppsw-32.csi.cam.ac.uk (ppsw-32.csi.cam.ac.uk [131.111.8.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2679B10C1; Tue, 26 Apr 2016 14:40:13 +0000 (UTC) (envelope-from rb743@hermes.cam.ac.uk) X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from xc1.bsdpad.com ([195.154.136.64]:23887) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (LOGIN:rb743) (TLSv1:ECDHE-RSA-AES256-SHA:256) id 1av49s-000ZTB-08 (Exim 4.86_36-e07b163) (return-path ); Tue, 26 Apr 2016 15:40:12 +0100 Date: Tue, 26 Apr 2016 15:24:55 +0100 From: Ruslan Bukin To: Konstantin Belousov Cc: Ruslan Bukin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298580 - in head/sys/riscv: include riscv Message-ID: <20160426142455.GA25801@bsdpad.com> References: <201604251447.u3PElpfe084901@repo.freebsd.org> <20160425155044.GO2422@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160425155044.GO2422@kib.kiev.ua> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: "R. Bukin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 14:40:14 -0000 On Mon, Apr 25, 2016 at 06:50:44PM +0300, Konstantin Belousov wrote: > On Mon, Apr 25, 2016 at 02:47:51PM +0000, Ruslan Bukin wrote: > > +/* An entry in the list of all pmaps */ > > +struct pmap_list_entry { > > + SLIST_ENTRY(pmap_list_entry) pmap_link; > > + struct pmap *pmap; > > +}; > > This is weird. Why do you need separate structure to track the all > pmaps list, instead of embedding the list link into pmap itself ? In > particular, the pmap_list_entry.pmap pointing to the pmap looks strange. > > And why do you use single-linked list for the container where you need > to remove elements ? The cost is the iteration over the whole container > on removal, vs. additional pointer in each pmap. > Many thanks. I have committed the fix (same way as i386 do). Ruslan From owner-svn-src-head@freebsd.org Tue Apr 26 14:44:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02AFAB1C627; Tue, 26 Apr 2016 14:44:51 +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 AA1B31529; Tue, 26 Apr 2016 14:44:50 +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 u3QEinQu031481; Tue, 26 Apr 2016 14:44:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QEinsC031478; Tue, 26 Apr 2016 14:44:49 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604261444.u3QEinsC031478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 14:44:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298642 - in head/sys/powerpc: booke mpc85xx powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 14:44:51 -0000 Author: pfg Date: Tue Apr 26 14:44:49 2016 New Revision: 298642 URL: https://svnweb.freebsd.org/changeset/base/298642 Log: sys/powerpc: make use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: head/sys/powerpc/booke/pmap.c head/sys/powerpc/mpc85xx/fsl_sdhc.c head/sys/powerpc/powerpc/clock.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Tue Apr 26 14:38:18 2016 (r298641) +++ head/sys/powerpc/booke/pmap.c Tue Apr 26 14:44:49 2016 (r298642) @@ -1115,8 +1115,8 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Allocate PTE tables for kernel KVA. */ kernel_pdir = data_end; - kernel_ptbls = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS + - PDIR_SIZE - 1) / PDIR_SIZE; + kernel_ptbls = howmany(VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS, + PDIR_SIZE); data_end += kernel_ptbls * PTBL_PAGES * PAGE_SIZE; debugf(" kernel ptbls: %d\n", kernel_ptbls); debugf(" kernel pdir at 0x%08x end = 0x%08x\n", kernel_pdir, data_end); Modified: head/sys/powerpc/mpc85xx/fsl_sdhc.c ============================================================================== --- head/sys/powerpc/mpc85xx/fsl_sdhc.c Tue Apr 26 14:38:18 2016 (r298641) +++ head/sys/powerpc/mpc85xx/fsl_sdhc.c Tue Apr 26 14:44:49 2016 (r298642) @@ -271,7 +271,7 @@ set_clock(struct fsl_sdhc_softc *sc, uin * divisor = ceil(base_clock / clock) * TODO: Reconsider symmetric rounding here instead of ceiling. */ - divisor = (base_clock + clock - 1) / clock; + divisor = howmany(base_clock, clock); while (divisor > 16) { round = divisor & 0x1; Modified: head/sys/powerpc/powerpc/clock.c ============================================================================== --- head/sys/powerpc/powerpc/clock.c Tue Apr 26 14:38:18 2016 (r298641) +++ head/sys/powerpc/powerpc/clock.c Tue Apr 26 14:44:49 2016 (r298642) @@ -301,7 +301,7 @@ DELAY(int n) u_quad_t tb, ttb; tb = mftb(); - ttb = tb + (n * 1000 + ns_per_tick - 1) / ns_per_tick; + ttb = tb + howmany(n * 1000, ns_per_tick); while (tb < ttb) tb = mftb(); } From owner-svn-src-head@freebsd.org Tue Apr 26 14:47:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 779C6B1C6E0; Tue, 26 Apr 2016 14:47: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 2E861181A; Tue, 26 Apr 2016 14:47: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 u3QElrA4031623; Tue, 26 Apr 2016 14:47:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QElrL8031619; Tue, 26 Apr 2016 14:47:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604261447.u3QElrL8031619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 14:47:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298643 - in head/sys/arm: arm at91 freescale/imx nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 14:47:54 -0000 Author: pfg Date: Tue Apr 26 14:47:52 2016 New Revision: 298643 URL: https://svnweb.freebsd.org/changeset/base/298643 Log: sys/arm: make use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: head/sys/arm/arm/pmap-v4.c head/sys/arm/at91/at91_pit.c head/sys/arm/freescale/imx/imx_i2c.c head/sys/arm/nvidia/as3722_regulators.c Modified: head/sys/arm/arm/pmap-v4.c ============================================================================== --- head/sys/arm/arm/pmap-v4.c Tue Apr 26 14:44:49 2016 (r298642) +++ head/sys/arm/arm/pmap-v4.c Tue Apr 26 14:47:52 2016 (r298643) @@ -2285,7 +2285,7 @@ pmap_bootstrap(vm_offset_t firstaddr, st round_page(size * L2_TABLE_SIZE_REAL) / PAGE_SIZE, &pmap_kernel_l2ptp_kva, NULL); - size = (size + (L2_BUCKET_SIZE - 1)) / L2_BUCKET_SIZE; + size = howmany(size, L2_BUCKET_SIZE); pmap_alloc_specials(&virtual_avail, round_page(size * sizeof(struct l2_dtable)) / PAGE_SIZE, &pmap_kernel_l2dtable_kva, NULL); Modified: head/sys/arm/at91/at91_pit.c ============================================================================== --- head/sys/arm/at91/at91_pit.c Tue Apr 26 14:44:49 2016 (r298642) +++ head/sys/arm/at91/at91_pit.c Tue Apr 26 14:47:52 2016 (r298643) @@ -98,7 +98,7 @@ at91_pit_delay(int us) /* Max delay ~= 260s. @ 133Mhz */ pit_freq = at91_master_clock / PIT_PRESCALE; - cnt = ((pit_freq * us) + (mhz -1)) / mhz; + cnt = howmany(pit_freq * us, mhz); cnt = (cnt <= 0) ? 1 : cnt; while (cnt > 0) { Modified: head/sys/arm/freescale/imx/imx_i2c.c ============================================================================== --- head/sys/arm/freescale/imx/imx_i2c.c Tue Apr 26 14:44:49 2016 (r298642) +++ head/sys/arm/freescale/imx/imx_i2c.c Tue Apr 26 14:47:52 2016 (r298643) @@ -388,7 +388,7 @@ i2c_reset(device_t dev, u_char speed, u_ */ ipgfreq = imx_ccm_ipg_hz(); busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed); - div = (ipgfreq + busfreq - 1) / busfreq; + div = howmany(ipgfreq, busfreq); for (i = 0; i < nitems(clkdiv_table); i++) { if (clkdiv_table[i].divisor >= div) break; Modified: head/sys/arm/nvidia/as3722_regulators.c ============================================================================== --- head/sys/arm/nvidia/as3722_regulators.c Tue Apr 26 14:44:49 2016 (r298642) +++ head/sys/arm/nvidia/as3722_regulators.c Tue Apr 26 14:47:52 2016 (r298643) @@ -48,7 +48,7 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_AS3722_REG, "AS3722 regulator", "AS3722 power regulator"); -#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) +#define DIV_ROUND_UP(n,d) howmany(n, d) enum as3722_reg_id { AS3722_REG_ID_SD0, From owner-svn-src-head@freebsd.org Tue Apr 26 14:48:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9619B1C73F; Tue, 26 Apr 2016 14:48:59 +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 BA7CF19F4; Tue, 26 Apr 2016 14:48:59 +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 u3QEmwRg031706; Tue, 26 Apr 2016 14:48:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QEmwKl031705; Tue, 26 Apr 2016 14:48:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604261448.u3QEmwKl031705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 26 Apr 2016 14:48:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298644 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 14:49:00 -0000 Author: asomers Date: Tue Apr 26 14:48:58 2016 New Revision: 298644 URL: https://svnweb.freebsd.org/changeset/base/298644 Log: Add GEOM::physpath documentation to devd.conf(5) Suggested by: trasz Reviewed by: trasz MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6063 Modified: head/sbin/devd/devd.conf.5 Modified: head/sbin/devd/devd.conf.5 ============================================================================== --- head/sbin/devd/devd.conf.5 Tue Apr 26 14:47:52 2016 (r298643) +++ head/sbin/devd/devd.conf.5 Tue Apr 26 14:48:58 2016 (r298644) @@ -433,6 +433,8 @@ device node is created. A .Xr geom 4 device node is destroyed. +.It Li GEOM::physpath +The physical path of a device has changed. .It Li MEDIACHANGE Physical media has changed. .El From owner-svn-src-head@freebsd.org Tue Apr 26 14:52:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76727B1C916; Tue, 26 Apr 2016 14:52:00 +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 2E5901E25; Tue, 26 Apr 2016 14:52:00 +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 u3QEpx7N032474; Tue, 26 Apr 2016 14:51:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QEpxCp032471; Tue, 26 Apr 2016 14:51:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604261451.u3QEpxCp032471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 14:51:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298645 - in head/sys/boot: common powerpc/ps3 sparc64/boot1 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 14:52:00 -0000 Author: pfg Date: Tue Apr 26 14:51:58 2016 New Revision: 298645 URL: https://svnweb.freebsd.org/changeset/base/298645 Log: sys/boot: make use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: head/sys/boot/common/part.c head/sys/boot/powerpc/ps3/main.c head/sys/boot/sparc64/boot1/boot1.c Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Tue Apr 26 14:48:58 2016 (r298644) +++ head/sys/boot/common/part.c Tue Apr 26 14:51:58 2016 (r298645) @@ -257,8 +257,9 @@ ptable_gptread(struct ptable *table, voi table->sectorsize); if (phdr != NULL) { /* Read the primary GPT table. */ - size = MIN(MAXTBLSZ, (phdr->hdr_entries * phdr->hdr_entsz + - table->sectorsize - 1) / table->sectorsize); + size = MIN(MAXTBLSZ, + howmany(phdr->hdr_entries * phdr->hdr_entsz, + table->sectorsize)); if (dread(dev, tbl, size, phdr->hdr_lba_table) == 0 && gpt_checktbl(phdr, tbl, size * table->sectorsize, table->sectors - 1) == 0) { @@ -290,9 +291,9 @@ ptable_gptread(struct ptable *table, voi hdr.hdr_entsz != phdr->hdr_entsz || hdr.hdr_crc_table != phdr->hdr_crc_table) { /* Read the backup GPT table. */ - size = MIN(MAXTBLSZ, (phdr->hdr_entries * - phdr->hdr_entsz + table->sectorsize - 1) / - table->sectorsize); + size = MIN(MAXTBLSZ, + howmany(phdr->hdr_entries * phdr->hdr_entsz, + table->sectorsize)); if (dread(dev, tbl, size, phdr->hdr_lba_table) == 0 && gpt_checktbl(phdr, tbl, size * table->sectorsize, table->sectors - 1) == 0) { Modified: head/sys/boot/powerpc/ps3/main.c ============================================================================== --- head/sys/boot/powerpc/ps3/main.c Tue Apr 26 14:48:58 2016 (r298644) +++ head/sys/boot/powerpc/ps3/main.c Tue Apr 26 14:51:58 2016 (r298645) @@ -174,7 +174,7 @@ delay(int usecs) uint64_t tb,ttb; tb = mftb(); - ttb = tb + (usecs * 1000 + ns_per_tick - 1) / ns_per_tick; + ttb = tb + howmany(usecs * 1000, ns_per_tick); while (tb < ttb) tb = mftb(); } Modified: head/sys/boot/sparc64/boot1/boot1.c ============================================================================== --- head/sys/boot/sparc64/boot1/boot1.c Tue Apr 26 14:48:58 2016 (r298644) +++ head/sys/boot/sparc64/boot1/boot1.c Tue Apr 26 14:51:58 2016 (r298645) @@ -390,7 +390,7 @@ zbread(char *buf, off_t off, size_t byte p = buf; soff = VDEV_BOOT_OFFSET + off; - lb = (soff + bytes + DEV_BSIZE - 1) / DEV_BSIZE; + lb = howmany(soff + bytes, DEV_BSIZE); poff = soff; while (poff < soff + bytes) { nb = lb - poff / DEV_BSIZE; From owner-svn-src-head@freebsd.org Tue Apr 26 15:03:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C49BB1CC4D; Tue, 26 Apr 2016 15:03:20 +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 C454C1519; Tue, 26 Apr 2016 15:03:19 +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 u3QF3JtJ037468; Tue, 26 Apr 2016 15:03:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QF3FNp037438; Tue, 26 Apr 2016 15:03:15 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604261503.u3QF3FNp037438@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 15:03:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298646 - in head/sys/dev: age amr bwn cy fatm fb jme mcd mfi mlx mmc/host ncr patm ral sbni scd sfxge siba sound/usb sym usb usb/controller usb/wlan vt/hw/vga xen/grant_table xen/netback X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 15:03:20 -0000 Author: pfg Date: Tue Apr 26 15:03:15 2016 New Revision: 298646 URL: https://svnweb.freebsd.org/changeset/base/298646 Log: sys/dev: extend use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: head/sys/dev/age/if_age.c head/sys/dev/amr/amr.c head/sys/dev/bwn/if_bwn.c head/sys/dev/cy/cy.c head/sys/dev/fatm/if_fatm.c head/sys/dev/fb/vga.c head/sys/dev/jme/if_jme.c head/sys/dev/mcd/mcd.c head/sys/dev/mfi/mfi.c head/sys/dev/mlx/mlx.c head/sys/dev/mmc/host/dwmmc.c head/sys/dev/ncr/ncr.c head/sys/dev/patm/if_patm_tx.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/sbni/if_sbni.c head/sys/dev/scd/scd.c head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/siba/siba_core.c head/sys/dev/sound/usb/uaudio.c head/sys/dev/sym/sym_hipd.c head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ohci.c head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/usb_transfer.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/vt/hw/vga/vt_vga.c head/sys/dev/xen/grant_table/grant_table.c head/sys/dev/xen/netback/netback.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/age/if_age.c Tue Apr 26 15:03:15 2016 (r298646) @@ -2486,7 +2486,7 @@ age_rxintr(struct age_softc *sc, int rr_ * I'm not sure whether this check is really needed. */ pktlen = AGE_RX_BYTES(le32toh(rxrd->len)); - if (nsegs != (pktlen + (AGE_RX_BUF_SIZE - 1)) / AGE_RX_BUF_SIZE) + if (nsegs != howmany(pktlen, AGE_RX_BUF_SIZE)) break; /* Received a frame. */ Modified: head/sys/dev/amr/amr.c ============================================================================== --- head/sys/dev/amr/amr.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/amr/amr.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1316,7 +1316,7 @@ amr_bio_command(struct amr_softc *sc, st } amrd = (struct amrd_softc *)bio->bio_disk->d_drv1; driveno = amrd->amrd_drive - sc->amr_drive; - blkcount = (bio->bio_bcount + AMR_BLKSIZE - 1) / AMR_BLKSIZE; + blkcount = howmany(bio->bio_bcount, AMR_BLKSIZE); ac->ac_mailbox.mb_command = cmd; if (bio->bio_cmd == BIO_READ || bio->bio_cmd == BIO_WRITE) { Modified: head/sys/dev/bwn/if_bwn.c ============================================================================== --- head/sys/dev/bwn/if_bwn.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/bwn/if_bwn.c Tue Apr 26 15:03:15 2016 (r298646) @@ -11166,7 +11166,7 @@ bwn_phy_lp_b2063_switch_channel(struct b tmp[2] = ((41 * (val[2] - 3000)) /1200) + 27; tmp[3] = bwn_phy_lp_roundup(132000 * tmp[0], 8451, 16); - if ((tmp[3] + tmp[2] - 1) / tmp[2] > 60) { + if (howmany(tmp[3], tmp[2]) > 60) { scale = 1; tmp[4] = ((tmp[3] + tmp[2]) / (tmp[2] << 1)) - 8; } else { Modified: head/sys/dev/cy/cy.c ============================================================================== --- head/sys/dev/cy/cy.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/cy/cy.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1347,7 +1347,7 @@ cyparam(struct tty *tp, struct termios * /* * Set receive time-out period, normally to max(one char time, 5 ms). */ - itimeout = (1000 * bits + t->c_ispeed - 1) / t->c_ispeed; + itimeout = howmany(1000 * bits, t->c_ispeed); #ifdef SOFT_HOTCHAR #define MIN_RTP 1 #else Modified: head/sys/dev/fatm/if_fatm.c ============================================================================== --- head/sys/dev/fatm/if_fatm.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/fatm/if_fatm.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1085,7 +1085,7 @@ fatm_supply_small_buffers(struct fatm_so nbufs = min(nbufs, SMALL_POOL_SIZE); nbufs -= sc->small_cnt; - nblocks = (nbufs + SMALL_SUPPLY_BLKSIZE - 1) / SMALL_SUPPLY_BLKSIZE; + nblocks = howmany(nbufs, SMALL_SUPPLY_BLKSIZE); for (cnt = 0; cnt < nblocks; cnt++) { q = GET_QUEUE(sc->s1queue, struct supqueue, sc->s1queue.head); @@ -1174,7 +1174,7 @@ fatm_supply_large_buffers(struct fatm_so nbufs = min(nbufs, LARGE_POOL_SIZE); nbufs -= sc->large_cnt; - nblocks = (nbufs + LARGE_SUPPLY_BLKSIZE - 1) / LARGE_SUPPLY_BLKSIZE; + nblocks = howmany(nbufs, LARGE_SUPPLY_BLKSIZE); for (cnt = 0; cnt < nblocks; cnt++) { q = GET_QUEUE(sc->l1queue, struct supqueue, sc->l1queue.head); Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/fb/vga.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1247,8 +1247,8 @@ set_line_length(video_adapter_t *adp, in switch (adp->va_info.vi_mem_model) { case V_INFO_MM_PLANAR: ppw = 16/(adp->va_info.vi_depth/adp->va_info.vi_planes); - count = (pixel + ppw - 1)/ppw/2; - bpl = ((pixel + ppw - 1)/ppw/2)*4; + count = howmany(pixel, ppw)/2; + bpl = (howmany(pixel, ppw)/2)*4; break; case V_INFO_MM_PACKED: count = (pixel + 7)/8; Modified: head/sys/dev/jme/if_jme.c ============================================================================== --- head/sys/dev/jme/if_jme.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/jme/if_jme.c Tue Apr 26 15:03:15 2016 (r298646) @@ -2664,7 +2664,7 @@ jme_rxintr(struct jme_softc *sc, int cou * sure whether this check is needed. */ pktlen = JME_RX_BYTES(le32toh(desc->buflen)); - if (nsegs != ((pktlen + (MCLBYTES - 1)) / MCLBYTES)) + if (nsegs != howmany(pktlen, MCLBYTES)) break; prog++; /* Received a frame. */ Modified: head/sys/dev/mcd/mcd.c ============================================================================== --- head/sys/dev/mcd/mcd.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/mcd/mcd.c Tue Apr 26 15:03:15 2016 (r298646) @@ -922,7 +922,7 @@ retry_mode: RDELAY_WAITMODE-mbx->count); modedone: /* for first block */ - mbx->nblk = (bp->bio_bcount + (mbx->sz-1)) / mbx->sz; + mbx->nblk = howmany(bp->bio_bcount, mbx->sz); mbx->skip = 0; nextblock: Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/mfi/mfi.c Tue Apr 26 15:03:15 2016 (r298646) @@ -2156,7 +2156,7 @@ mfi_build_syspdio(struct mfi_softc *sc, } /* Cheat with the sector length to avoid a non-constant division */ - blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + blkcount = howmany(bio->bio_bcount, MFI_SECTOR_LEN); /* Fill the LBA and Transfer length in CDB */ cdb_len = mfi_build_cdb(readop, 0, bio->bio_pblkno, blkcount, pass->cdb); @@ -2215,7 +2215,7 @@ mfi_build_ldio(struct mfi_softc *sc, str } /* Cheat with the sector length to avoid a non-constant division */ - blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + blkcount = howmany(bio->bio_bcount, MFI_SECTOR_LEN); io->header.target_id = (uintptr_t)bio->bio_driver1; io->header.timeout = 0; io->header.flags = 0; @@ -2622,7 +2622,7 @@ mfi_dump_blocks(struct mfi_softc *sc, in io->header.flags = 0; io->header.scsi_status = 0; io->header.sense_len = MFI_SENSE_LEN; - io->header.data_len = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + io->header.data_len = howmany(len, MFI_SECTOR_LEN); io->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; io->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); io->lba_hi = (lba & 0xffffffff00000000) >> 32; @@ -2660,7 +2660,7 @@ mfi_dump_syspd_blocks(struct mfi_softc * pass->header.cmd = MFI_CMD_PD_SCSI_IO; readop = 0; - blkcount = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + blkcount = howmany(len, MFI_SECTOR_LEN); cdb_len = mfi_build_cdb(readop, 0, lba, blkcount, pass->cdb); pass->header.target_id = id; pass->header.timeout = 0; Modified: head/sys/dev/mlx/mlx.c ============================================================================== --- head/sys/dev/mlx/mlx.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/mlx/mlx.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1868,7 +1868,7 @@ mlx_startio_cb(void *arg, bus_dma_segmen /* build a suitable I/O command (assumes 512-byte rounded transfers) */ mlxd = bp->bio_disk->d_drv1; driveno = mlxd->mlxd_drive - sc->mlx_sysdrive; - blkcount = (bp->bio_bcount + MLX_BLKSIZE - 1) / MLX_BLKSIZE; + blkcount = howmany(bp->bio_bcount, MLX_BLKSIZE); if ((bp->bio_pblkno + blkcount) > sc->mlx_sysdrive[driveno].ms_size) device_printf(sc->mlx_dev, Modified: head/sys/dev/mmc/host/dwmmc.c ============================================================================== --- head/sys/dev/mmc/host/dwmmc.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/mmc/host/dwmmc.c Tue Apr 26 15:03:15 2016 (r298646) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); #define WRITE4(_sc, _reg, _val) \ bus_write_4((_sc)->res[0], _reg, _val) -#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) +#define DIV_ROUND_UP(n, d) howmany(n, d) #define DWMMC_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) #define DWMMC_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) Modified: head/sys/dev/ncr/ncr.c ============================================================================== --- head/sys/dev/ncr/ncr.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/ncr/ncr.c Tue Apr 26 15:03:15 2016 (r298646) @@ -3468,11 +3468,11 @@ ncr_attach (device_t dev) * Btw, 'period' is in tenths of nanoseconds. */ - period = (4 * div_10M[0] + np->clock_khz - 1) / np->clock_khz; + period = howmany(4 * div_10M[0], np->clock_khz); if (period <= 250) np->minsync = 10; else if (period <= 303) np->minsync = 11; else if (period <= 500) np->minsync = 12; - else np->minsync = (period + 40 - 1) / 40; + else np->minsync = howmany(period, 40); /* * Check against chip SCSI standard support (SCSI-2,ULTRA,ULTRA2). Modified: head/sys/dev/patm/if_patm_tx.c ============================================================================== --- head/sys/dev/patm/if_patm_tx.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/patm/if_patm_tx.c Tue Apr 26 15:03:15 2016 (r298646) @@ -119,8 +119,8 @@ cbr2slots(struct patm_softc *sc, struct { /* compute the number of slots we need, make sure to get at least * the specified PCR */ - return ((u_int)(((uint64_t)(sc->mmap->tst_size - 1) * - vcc->vcc.tparam.pcr + IFP2IFATM(sc->ifp)->mib.pcr - 1) / IFP2IFATM(sc->ifp)->mib.pcr)); + return ((u_int)howmany((uint64_t)(sc->mmap->tst_size - 1) * + vcc->vcc.tparam.pcr, IFP2IFATM(sc->ifp)->mib.pcr)); } static __inline u_int Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/ral/rt2560.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1425,7 +1425,7 @@ rt2560_setup_tx_desc(struct rt2560_softc desc->plcp_length_hi = plcp_length >> 6; desc->plcp_length_lo = plcp_length & 0x3f; } else { - plcp_length = (16 * len + rate - 1) / rate; + plcp_length = howmany(16 * len, rate); if (rate == 22) { remainder = (16 * len) % 22; if (remainder != 0 && remainder < 7) Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/ral/rt2661.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1246,7 +1246,7 @@ rt2661_setup_tx_desc(struct rt2661_softc desc->plcp_length_hi = plcp_length >> 6; desc->plcp_length_lo = plcp_length & 0x3f; } else { - plcp_length = (16 * len + rate - 1) / rate; + plcp_length = howmany(16 * len, rate); if (rate == 22) { remainder = (16 * len) % 22; if (remainder != 0 && remainder < 7) Modified: head/sys/dev/sbni/if_sbni.c ============================================================================== --- head/sys/dev/sbni/if_sbni.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/sbni/if_sbni.c Tue Apr 26 15:03:15 2016 (r298646) @@ -738,7 +738,7 @@ prepare_to_send(struct sbni_softc *sc) len = SBNI_MIN_LEN; sc->pktlen = len; - sc->tx_frameno = (len + sc->maxframe - 1) / sc->maxframe; + sc->tx_frameno = howmany(len, sc->maxframe); sc->framelen = min(len, sc->maxframe); sbni_outb(sc, CSR0, sbni_inb(sc, CSR0) | TR_REQ); Modified: head/sys/dev/scd/scd.c ============================================================================== --- head/sys/dev/scd/scd.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/scd/scd.c Tue Apr 26 15:03:15 2016 (r298646) @@ -751,7 +751,7 @@ trystat: mbx->sz = sc->data.blksize; /* for first block */ - mbx->nblk = (bp->bio_bcount + (mbx->sz-1)) / mbx->sz; + mbx->nblk = howmany(bp->bio_bcount, mbx->sz); mbx->skip = 0; nextblock: Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/sfxge/sfxge_tx.c Tue Apr 26 15:03:15 2016 (r298646) @@ -906,7 +906,7 @@ static const struct tcphdr *tso_tcph(con #define TSOH_COUNT(_txq_entries) ((_txq_entries) / 2u) #define TSOH_PER_PAGE (PAGE_SIZE / TSOH_STD_SIZE) #define TSOH_PAGE_COUNT(_txq_entries) \ - ((TSOH_COUNT(_txq_entries) + TSOH_PER_PAGE - 1) / TSOH_PER_PAGE) + howmany(TSOH_COUNT(_txq_entries), TSOH_PER_PAGE) static int tso_init(struct sfxge_txq *txq) { Modified: head/sys/dev/siba/siba_core.c ============================================================================== --- head/sys/dev/siba/siba_core.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/siba/siba_core.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1058,8 +1058,8 @@ siba_cc_powerup_delay(struct siba_cc *sc min = siba_cc_clockfreq(scc, 0); scc->scc_powerup_delay = - (((SIBA_CC_READ32(scc, SIBA_CC_PLLONDELAY) + 2) * 1000000) + - (min - 1)) / min; + howmany((SIBA_CC_READ32(scc, SIBA_CC_PLLONDELAY) + 2) * 1000000, + min); } static int Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/sound/usb/uaudio.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1173,8 +1173,8 @@ uaudio_get_buffer_size(struct uaudio_cha { struct uaudio_chan_alt *chan_alt = &ch->usb_alt[alt]; /* We use 2 times 8ms of buffer */ - uint32_t buf_size = (((chan_alt->sample_rate * (UAUDIO_NFRAMES / 8)) + - 1000 - 1) / 1000) * chan_alt->sample_size; + uint32_t buf_size = chan_alt->sample_size * + howmany(chan_alt->sample_rate * (UAUDIO_NFRAMES / 8), 1000); return (buf_size); } @@ -1292,8 +1292,8 @@ uaudio_configure_msg_sub(struct uaudio_s /* bytes per frame should not be zero */ chan->bytes_per_frame[0] = ((chan_alt->sample_rate / fps) * chan_alt->sample_size); - chan->bytes_per_frame[1] = - (((chan_alt->sample_rate + fps - 1) / fps) * chan_alt->sample_size); + chan->bytes_per_frame[1] = howmany(chan_alt->sample_rate, fps) * + chan_alt->sample_size; /* setup data rate dithering, if any */ chan->frames_per_second = fps; Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/sym/sym_hipd.c Tue Apr 26 15:03:15 2016 (r298646) @@ -2526,11 +2526,11 @@ static int sym_prepare_setting(hcb_p np, * Minimum synchronous period factor supported by the chip. * Btw, 'period' is in tenths of nanoseconds. */ - period = (4 * div_10M[0] + np->clock_khz - 1) / np->clock_khz; + period = howmany(4 * div_10M[0], np->clock_khz); if (period <= 250) np->minsync = 10; else if (period <= 303) np->minsync = 11; else if (period <= 500) np->minsync = 12; - else np->minsync = (period + 40 - 1) / 40; + else np->minsync = howmany(period, 40); /* * Check against chip SCSI standard support (SCSI-2,ULTRA,ULTRA2). Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/usb/controller/ehci.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1659,8 +1659,7 @@ restart: /* update data toggle */ - if (((average + temp->max_frame_size - 1) / - temp->max_frame_size) & 1) { + if (howmany(average, temp->max_frame_size) & 1) { temp->qtd_status ^= htohc32(temp->sc, EHCI_QTD_TOGGLE_MASK); } Modified: head/sys/dev/usb/controller/ohci.c ============================================================================== --- head/sys/dev/usb/controller/ohci.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/usb/controller/ohci.c Tue Apr 26 15:03:15 2016 (r298646) @@ -2437,7 +2437,7 @@ ohci_xfer_setup(struct usb_setup_params usbd_transfer_setup_sub(parm); nitd = ((xfer->max_data_length / OHCI_PAGE_SIZE) + - ((xfer->nframes + OHCI_ITD_NOFFSET - 1) / OHCI_ITD_NOFFSET) + + howmany(xfer->nframes, OHCI_ITD_NOFFSET) + 1 /* EXTRA */ ); ntd = 0; nqh = 1; Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/usb/controller/xhci.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1830,8 +1830,8 @@ restart: } /* set up npkt */ - npkt = (len_old - npkt_off + temp->max_packet_size - 1) / - temp->max_packet_size; + npkt = howmany(len_old - npkt_off, + temp->max_packet_size); if (npkt == 0) npkt = 1; @@ -2185,10 +2185,9 @@ xhci_setup_generic_chain(struct usb_xfer temp.len = xfer->max_frame_size; /* compute TD packet count */ - tdpc = (temp.len + xfer->max_packet_size - 1) / - xfer->max_packet_size; + tdpc = howmany(temp.len, xfer->max_packet_size); - temp.tbc = ((tdpc + mult - 1) / mult) - 1; + temp.tbc = howmany(tdpc, mult) - 1; temp.tlbpc = (tdpc % mult); if (temp.tlbpc == 0) Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/usb/usb_transfer.c Tue Apr 26 15:03:15 2016 (r298646) @@ -246,7 +246,7 @@ usbd_transfer_setup_sub_malloc(struct us * Compute number of DMA chunks, rounded up * to nearest one: */ - n_dma_pc = ((count + n_obj - 1) / n_obj); + n_dma_pc = howmany(count, n_obj); n_dma_pg = 1; } Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/usb/wlan/if_rum.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1336,7 +1336,7 @@ rum_setup_tx_desc(struct rum_softc *sc, } else { if (rate == 0) rate = 2; /* avoid division by zero */ - plcp_length = (16 * len + rate - 1) / rate; + plcp_length = howmany(16 * len, rate); if (rate == 22) { remainder = (16 * len) % 22; if (remainder != 0 && remainder < 7) Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/usb/wlan/if_ural.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1002,7 +1002,7 @@ ural_setup_tx_desc(struct ural_softc *sc } else { if (rate == 0) rate = 2; /* avoid division by zero */ - plcp_length = (16 * len + rate - 1) / rate; + plcp_length = howmany(16 * len, rate); if (rate == 22) { remainder = (16 * len) % 22; if (remainder != 0 && remainder < 7) Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/vt/hw/vga/vt_vga.c Tue Apr 26 15:03:15 2016 (r298646) @@ -815,9 +815,8 @@ vga_bitblt_text_gfxmode(struct vt_device col = area->tr_end.tp_col; row = area->tr_end.tp_row; - x2 = (int)((col * vf->vf_width + vw->vw_draw_area.tr_begin.tp_col - + VT_VGA_PIXELS_BLOCK - 1) - / VT_VGA_PIXELS_BLOCK) + x2 = (int)howmany(col * vf->vf_width + vw->vw_draw_area.tr_begin.tp_col, + VT_VGA_PIXELS_BLOCK) * VT_VGA_PIXELS_BLOCK; y2 = row * vf->vf_height + vw->vw_draw_area.tr_begin.tp_row; @@ -916,8 +915,7 @@ vga_bitblt_bitmap(struct vt_device *vd, x1 = x / VT_VGA_PIXELS_BLOCK * VT_VGA_PIXELS_BLOCK; y1 = y; - x2 = (x + width + VT_VGA_PIXELS_BLOCK - 1) / - VT_VGA_PIXELS_BLOCK * VT_VGA_PIXELS_BLOCK; + x2 = roundup(x + width, VT_VGA_PIXELS_BLOCK); y2 = y + height; x2 = min(x2, vd->vd_width - 1); y2 = min(y2, vd->vd_height - 1); Modified: head/sys/dev/xen/grant_table/grant_table.c ============================================================================== --- head/sys/dev/xen/grant_table/grant_table.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/xen/grant_table/grant_table.c Tue Apr 26 15:03:15 2016 (r298646) @@ -573,8 +573,7 @@ gnttab_expand(unsigned int req_entries) unsigned int cur, extra; cur = nr_grant_frames; - extra = ((req_entries + (GREFS_PER_GRANT_FRAME-1)) / - GREFS_PER_GRANT_FRAME); + extra = howmany(req_entries, GREFS_PER_GRANT_FRAME); if (cur + extra > max_nr_grant_frames()) return (ENOSPC); Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Tue Apr 26 14:51:58 2016 (r298645) +++ head/sys/dev/xen/netback/netback.c Tue Apr 26 15:03:15 2016 (r298646) @@ -1931,7 +1931,7 @@ xnb_mbufc2pkt(const struct mbuf *mbufc, * into responses so that each response but the last uses all * PAGE_SIZE bytes. */ - pkt->list_len = (pkt->size + PAGE_SIZE - 1) / PAGE_SIZE; + pkt->list_len = howmany(pkt->size, PAGE_SIZE); if (pkt->list_len > 1) { pkt->flags |= NETRXF_more_data; From owner-svn-src-head@freebsd.org Tue Apr 26 15:33:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97512B1D267; Tue, 26 Apr 2016 15:33:55 +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 4FAC113C2; Tue, 26 Apr 2016 15:33:55 +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 u3QFXsoe046396; Tue, 26 Apr 2016 15:33:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QFXsIo046395; Tue, 26 Apr 2016 15:33:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604261533.u3QFXsIo046395@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Apr 2016 15:33:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298647 - head/sys/boot/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 15:33:55 -0000 Author: hselasky Date: Tue Apr 26 15:33:53 2016 New Revision: 298647 URL: https://svnweb.freebsd.org/changeset/base/298647 Log: Add function needed for linking USB test application. Modified: head/sys/boot/usb/bsd_usbloader_test.c Modified: head/sys/boot/usb/bsd_usbloader_test.c ============================================================================== --- head/sys/boot/usb/bsd_usbloader_test.c Tue Apr 26 15:03:15 2016 (r298646) +++ head/sys/boot/usb/bsd_usbloader_test.c Tue Apr 26 15:33:53 2016 (r298647) @@ -57,6 +57,12 @@ DELAY(unsigned int delay) usleep(delay); } +void +delay(unsigned int delay) +{ + usleep(delay); +} + int pause(const char *what, int timeout) { From owner-svn-src-head@freebsd.org Tue Apr 26 15:34:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DB58B1D28F; Tue, 26 Apr 2016 15:34:02 +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 39DBA145B; Tue, 26 Apr 2016 15:34:02 +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 u3QFY1EG046453; Tue, 26 Apr 2016 15:34:01 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QFY1H3046452; Tue, 26 Apr 2016 15:34:01 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201604261534.u3QFY1H3046452@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 26 Apr 2016 15:34:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298648 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 15:34:02 -0000 Author: bz Date: Tue Apr 26 15:34:00 2016 New Revision: 298648 URL: https://svnweb.freebsd.org/changeset/base/298648 Log: Mark the unused period argument __unused. Reviewed by: andrew MFC after: 2 weeks Sponsored by: DARPA/AFRL Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Tue Apr 26 15:33:53 2016 (r298647) +++ head/sys/arm/arm/generic_timer.c Tue Apr 26 15:34:00 2016 (r298648) @@ -221,7 +221,8 @@ arm_tmr_get_timecount(struct timecounter } static int -arm_tmr_start(struct eventtimer *et, sbintime_t first, sbintime_t period) +arm_tmr_start(struct eventtimer *et, sbintime_t first, + sbintime_t period __unused) { struct arm_tmr_softc *sc; int counts, ctrl; From owner-svn-src-head@freebsd.org Tue Apr 26 15:38:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F736B1D360; Tue, 26 Apr 2016 15:38:21 +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 07DAF18F2; Tue, 26 Apr 2016 15:38:20 +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 u3QFcJBS046664; Tue, 26 Apr 2016 15:38:19 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QFcHBO046642; Tue, 26 Apr 2016 15:38:17 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604261538.u3QFcHBO046642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 26 Apr 2016 15:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298649 - in head/sys: cam/ata cam/scsi compat/ndis fs/msdosfs geom/part geom/raid geom/uzip kern kgssapi/krb5 net netgraph X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 15:38:21 -0000 Author: pfg Date: Tue Apr 26 15:38:17 2016 New Revision: 298649 URL: https://svnweb.freebsd.org/changeset/base/298649 Log: sys: extend use of the howmany() macro when available. We have a howmany() macro in the header that is convenient to re-use as it makes things easier to read. Modified: head/sys/cam/ata/ata_da.c head/sys/cam/scsi/scsi_da.c head/sys/compat/ndis/subr_ntoskrnl.c head/sys/fs/msdosfs/msdosfs_vfsops.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_ldm.c head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_intel.c head/sys/geom/uzip/g_uzip.c head/sys/kern/kern_clock.c head/sys/kern/kern_synch.c head/sys/kern/kern_time.c head/sys/kern/kern_timeout.c head/sys/kern/subr_pctrie.c head/sys/kern/sys_pipe.c head/sys/kern/sysv_msg.c head/sys/kern/uipc_shm.c head/sys/kern/vfs_subr.c head/sys/kgssapi/krb5/kcrypto.c head/sys/net/if_arcsubr.c head/sys/netgraph/ng_pptpgre.c Modified: head/sys/cam/ata/ata_da.c ============================================================================== --- head/sys/cam/ata/ata_da.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/cam/ata/ata_da.c Tue Apr 26 15:38:17 2016 (r298649) @@ -1699,12 +1699,10 @@ ada_dsmtrim(struct ada_softc *softc, str CAM_DIR_OUT, 0, req->data, - ((ranges + ATA_DSM_BLK_RANGES - 1) / - ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE, + howmany(ranges, ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE, ada_default_timeout * 1000); ata_48bit_cmd(ataio, ATA_DATA_SET_MANAGEMENT, - ATA_DSM_TRIM, 0, (ranges + ATA_DSM_BLK_RANGES - - 1) / ATA_DSM_BLK_RANGES); + ATA_DSM_TRIM, 0, howmany(ranges, ATA_DSM_BLK_RANGES)); } static void @@ -1720,13 +1718,12 @@ ada_ncq_dsmtrim(struct ada_softc *softc, CAM_DIR_OUT, 0, req->data, - ((ranges + ATA_DSM_BLK_RANGES - 1) / - ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE, + howmany(ranges, ATA_DSM_BLK_RANGES) * ATA_DSM_BLK_SIZE, ada_default_timeout * 1000); ata_ncq_cmd(ataio, ATA_SEND_FPDMA_QUEUED, 0, - (ranges + ATA_DSM_BLK_RANGES - 1) / ATA_DSM_BLK_RANGES); + howmany(ranges, ATA_DSM_BLK_RANGES)); ataio->cmd.sector_count_exp = ATA_SFPDMA_DSM; ataio->ata_flags |= ATA_FLAG_AUX; ataio->aux = 1; Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/cam/scsi/scsi_da.c Tue Apr 26 15:38:17 2016 (r298649) @@ -2868,7 +2868,7 @@ da_delete_trim(struct cam_periph *periph } } while (1); - block_count = (ranges + ATA_DSM_BLK_RANGES - 1) / ATA_DSM_BLK_RANGES; + block_count = howmany(ranges, ATA_DSM_BLK_RANGES); scsi_ata_trim(&ccb->csio, /*retries*/da_retry_count, /*cbfcnp*/dadone, Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/compat/ndis/subr_ntoskrnl.c Tue Apr 26 15:38:17 2016 (r298649) @@ -4207,7 +4207,7 @@ KeQueryInterruptTime(void) ticks = tvtohz(&tv); - return ticks * ((10000000 + hz - 1) / hz); + return ticks * howmany(10000000, hz); } static struct thread * Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vfsops.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/fs/msdosfs/msdosfs_vfsops.c Tue Apr 26 15:38:17 2016 (r298649) @@ -606,9 +606,8 @@ mountmsdosfs(struct vnode *devvp, struct } else { pmp->pm_rootdirblk = pmp->pm_fatblk + (pmp->pm_FATs * pmp->pm_FATsecs); - pmp->pm_rootdirsize = (pmp->pm_RootDirEnts * sizeof(struct direntry) - + DEV_BSIZE - 1) - / DEV_BSIZE; /* in blocks */ + pmp->pm_rootdirsize = howmany(pmp->pm_RootDirEnts * + sizeof(struct direntry), DEV_BSIZE); /* in blocks */ pmp->pm_firstcluster = pmp->pm_rootdirblk + pmp->pm_rootdirsize; } Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/geom/part/g_part_gpt.c Tue Apr 26 15:38:17 2016 (r298649) @@ -472,8 +472,7 @@ gpt_read_hdr(struct g_part_gpt_table *ta hdr->hdr_lba_table <= hdr->hdr_lba_end) goto fail; lba = hdr->hdr_lba_table + - (hdr->hdr_entries * hdr->hdr_entsz + pp->sectorsize - 1) / - pp->sectorsize - 1; + howmany(hdr->hdr_entries * hdr->hdr_entsz, pp->sectorsize) - 1; if (lba >= last) goto fail; if (lba >= hdr->hdr_lba_start && lba <= hdr->hdr_lba_end) @@ -515,7 +514,7 @@ gpt_read_tbl(struct g_part_gpt_table *ta table->state[elt] = GPT_STATE_MISSING; tblsz = hdr->hdr_entries * hdr->hdr_entsz; - sectors = (tblsz + pp->sectorsize - 1) / pp->sectorsize; + sectors = howmany(tblsz, pp->sectorsize); buf = g_malloc(sectors * pp->sectorsize, M_WAITOK | M_ZERO); for (idx = 0; idx < sectors; idx += MAXPHYS / pp->sectorsize) { size = (sectors - idx > MAXPHYS / pp->sectorsize) ? MAXPHYS: @@ -653,8 +652,8 @@ g_part_gpt_create(struct g_part_table *b table = (struct g_part_gpt_table *)basetable; pp = gpp->gpp_provider; - tblsz = (basetable->gpt_entries * sizeof(struct gpt_ent) + - pp->sectorsize - 1) / pp->sectorsize; + tblsz = howmany(basetable->gpt_entries * sizeof(struct gpt_ent), + pp->sectorsize); if (pp->sectorsize < MBRSIZE || pp->mediasize < (3 + 2 * tblsz + basetable->gpt_entries) * pp->sectorsize) @@ -1134,8 +1133,8 @@ g_part_gpt_write(struct g_part_table *ba pp = cp->provider; table = (struct g_part_gpt_table *)basetable; - tblsz = (table->hdr->hdr_entries * table->hdr->hdr_entsz + - pp->sectorsize - 1) / pp->sectorsize; + tblsz = howmany(table->hdr->hdr_entries * table->hdr->hdr_entsz, + pp->sectorsize); /* Reconstruct the MBR from the GPT if under Boot Camp. */ if (table->bootcamp) @@ -1239,8 +1238,8 @@ g_gpt_set_defaults(struct g_part_table * table = (struct g_part_gpt_table *)basetable; last = pp->mediasize / pp->sectorsize - 1; - tblsz = (basetable->gpt_entries * sizeof(struct gpt_ent) + - pp->sectorsize - 1) / pp->sectorsize; + tblsz = howmany(basetable->gpt_entries * sizeof(struct gpt_ent), + pp->sectorsize); table->lba[GPT_ELT_PRIHDR] = 1; table->lba[GPT_ELT_PRITBL] = 2; Modified: head/sys/geom/part/g_part_ldm.c ============================================================================== --- head/sys/geom/part/g_part_ldm.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/geom/part/g_part_ldm.c Tue Apr 26 15:38:17 2016 (r298649) @@ -1013,8 +1013,7 @@ ldm_vmdb_parse(struct ldm_db *db, struct int error; pp = cp->provider; - size = (db->dh.last_seq * db->dh.size + - pp->sectorsize - 1) / pp->sectorsize; + size = howmany(db->dh.last_seq * db->dh.size, pp->sectorsize); size -= 1; /* one sector takes vmdb header */ for (n = 0; n < size; n += MAXPHYS / pp->sectorsize) { offset = db->ph.db_offset + db->th.conf_offset + n + 1; Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/geom/raid/md_ddf.c Tue Apr 26 15:38:17 2016 (r298649) @@ -593,35 +593,36 @@ ddf_meta_create(struct g_raid_disk *disk memcpy(meta->hdr, sample->hdr, sizeof(struct ddf_header)); if (ss != sample->sectorsize) { SET32(meta, hdr->WorkSpace_Length, - (GET32(sample, hdr->WorkSpace_Length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET32(sample, hdr->WorkSpace_Length) * + sample->sectorsize, ss)); SET16(meta, hdr->Configuration_Record_Length, - (GET16(sample, hdr->Configuration_Record_Length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET16(sample, + hdr->Configuration_Record_Length) * + sample->sectorsize, ss)); SET32(meta, hdr->cd_length, - (GET32(sample, hdr->cd_length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET32(sample, hdr->cd_length) * + sample->sectorsize, ss)); SET32(meta, hdr->pdr_length, - (GET32(sample, hdr->pdr_length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET32(sample, hdr->pdr_length) * + sample->sectorsize, ss)); SET32(meta, hdr->vdr_length, - (GET32(sample, hdr->vdr_length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET32(sample, hdr->vdr_length) * + sample->sectorsize, ss)); SET32(meta, hdr->cr_length, - (GET32(sample, hdr->cr_length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET32(sample, hdr->cr_length) * + sample->sectorsize, ss)); SET32(meta, hdr->pdd_length, - (GET32(sample, hdr->pdd_length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET32(sample, hdr->pdd_length) * + sample->sectorsize, ss)); SET32(meta, hdr->bbmlog_length, - (GET32(sample, hdr->bbmlog_length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET32(sample, hdr->bbmlog_length) * + sample->sectorsize, ss)); SET32(meta, hdr->Diagnostic_Space, - (GET32(sample, hdr->bbmlog_length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET32(sample, hdr->bbmlog_length) * + sample->sectorsize, ss)); SET32(meta, hdr->Vendor_Specific_Logs, - (GET32(sample, hdr->bbmlog_length) * - sample->sectorsize + ss - 1) / ss); + howmany(GET32(sample, hdr->bbmlog_length) * + sample->sectorsize, ss)); } } else { SET32(meta, hdr->Signature, DDF_HEADER_SIGNATURE); @@ -635,24 +636,23 @@ ddf_meta_create(struct g_raid_disk *disk SET16(meta, hdr->Max_Partitions, DDF_MAX_PARTITIONS); SET16(meta, hdr->Max_Primary_Element_Entries, DDF_MAX_DISKS); SET16(meta, hdr->Configuration_Record_Length, - (sizeof(struct ddf_vdc_record) + - (4 + 8) * GET16(meta, hdr->Max_Primary_Element_Entries) + - ss - 1) / ss); + howmany(sizeof(struct ddf_vdc_record) + (4 + 8) * + GET16(meta, hdr->Max_Primary_Element_Entries), ss)); SET32(meta, hdr->cd_length, - (sizeof(struct ddf_cd_record) + ss - 1) / ss); + howmany(sizeof(struct ddf_cd_record), ss)); SET32(meta, hdr->pdr_length, - (sizeof(struct ddf_pd_record) + - sizeof(struct ddf_pd_entry) * - GET16(meta, hdr->Max_PD_Entries) + ss - 1) / ss); + howmany(sizeof(struct ddf_pd_record) + + sizeof(struct ddf_pd_entry) * GET16(meta, + hdr->Max_PD_Entries), ss)); SET32(meta, hdr->vdr_length, - (sizeof(struct ddf_vd_record) + - sizeof(struct ddf_vd_entry) * - GET16(meta, hdr->Max_VD_Entries) + ss - 1) / ss); + howmany(sizeof(struct ddf_vd_record) + + sizeof(struct ddf_vd_entry) * + GET16(meta, hdr->Max_VD_Entries), ss)); SET32(meta, hdr->cr_length, GET16(meta, hdr->Configuration_Record_Length) * (GET16(meta, hdr->Max_Partitions) + 1)); SET32(meta, hdr->pdd_length, - (sizeof(struct ddf_pdd_record) + ss - 1) / ss); + howmany(sizeof(struct ddf_pdd_record), ss)); SET32(meta, hdr->bbmlog_length, 0); SET32(meta, hdr->Diagnostic_Space_Length, 0); SET32(meta, hdr->Vendor_Specific_Logs_Length, 0); Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/geom/raid/md_intel.c Tue Apr 26 15:38:17 2016 (r298649) @@ -773,7 +773,7 @@ intel_meta_write(struct g_consumer *cp, meta->checksum = checksum; /* Create and fill buffer. */ - sectors = (meta->config_size + pp->sectorsize - 1) / pp->sectorsize; + sectors = howmany(meta->config_size, pp->sectorsize); buf = malloc(sectors * pp->sectorsize, M_MD_INTEL, M_WAITOK | M_ZERO); if (sectors > 1) { memcpy(buf, ((char *)meta) + pp->sectorsize, Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/geom/uzip/g_uzip.c Tue Apr 26 15:38:17 2016 (r298649) @@ -195,9 +195,8 @@ g_uzip_cached(struct g_geom *gp, struct #define TOFF_2_BOFF(sc, pp, bi) ((sc)->toc[(bi)].offset - \ (sc)->toc[(bi)].offset % (pp)->sectorsize) -#define TLEN_2_BLEN(sc, pp, bp, ei) ((BLK_ENDS((sc), (ei)) - \ - (bp)->bio_offset + (pp)->sectorsize - 1) / \ - (pp)->sectorsize * (pp)->sectorsize) +#define TLEN_2_BLEN(sc, pp, bp, ei) roundup(BLK_ENDS((sc), (ei)) - \ + (bp)->bio_offset, (pp)->sectorsize) static int g_uzip_request(struct g_geom *gp, struct bio *bp) @@ -220,7 +219,7 @@ g_uzip_request(struct g_geom *gp, struct ofs = bp->bio_offset + bp->bio_completed; start_blk = ofs / sc->blksz; KASSERT(start_blk < sc->nblocks, ("start_blk out of range")); - end_blk = (ofs + bp->bio_resid + sc->blksz - 1) / sc->blksz; + end_blk = howmany(ofs + bp->bio_resid, sc->blksz); KASSERT(end_blk <= sc->nblocks, ("end_blk out of range")); for (; BLK_IS_NIL(sc, start_blk) && start_blk < end_blk; start_blk++) { Modified: head/sys/kern/kern_clock.c ============================================================================== --- head/sys/kern/kern_clock.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kern/kern_clock.c Tue Apr 26 15:38:17 2016 (r298649) @@ -625,11 +625,10 @@ tvtohz(tv) #endif ticks = 1; } else if (sec <= LONG_MAX / 1000000) - ticks = (sec * 1000000 + (unsigned long)usec + (tick - 1)) - / tick + 1; + ticks = howmany(sec * 1000000 + (unsigned long)usec, tick) + 1; else if (sec <= LONG_MAX / hz) ticks = sec * hz - + ((unsigned long)usec + (tick - 1)) / tick + 1; + + howmany((unsigned long)usec, tick) + 1; else ticks = LONG_MAX; if (ticks > INT_MAX) Modified: head/sys/kern/kern_synch.c ============================================================================== --- head/sys/kern/kern_synch.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kern/kern_synch.c Tue Apr 26 15:38:17 2016 (r298649) @@ -337,7 +337,7 @@ pause_sbt(const char *wmesg, sbintime_t sbt -= SBT_1S; } /* Do the delay remainder, if any */ - sbt = (sbt + SBT_1US - 1) / SBT_1US; + sbt = howmany(sbt, SBT_1US); if (sbt > 0) DELAY(sbt); return (0); Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kern/kern_time.c Tue Apr 26 15:38:17 2016 (r298649) @@ -453,7 +453,7 @@ kern_clock_getres(struct thread *td, clo case CLOCK_VIRTUAL: case CLOCK_PROF: /* Accurately round up here because we can do so cheaply. */ - ts->tv_nsec = (1000000000 + hz - 1) / hz; + ts->tv_nsec = howmany(1000000000, hz); break; case CLOCK_SECOND: ts->tv_sec = 1; Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kern/kern_timeout.c Tue Apr 26 15:38:17 2016 (r298649) @@ -1464,11 +1464,11 @@ adjust_timeout_calltodo(struct timeval * if (time_change->tv_sec < 0) return; else if (time_change->tv_sec <= LONG_MAX / 1000000) - delta_ticks = (time_change->tv_sec * 1000000 + - time_change->tv_usec + (tick - 1)) / tick + 1; + delta_ticks = howmany(time_change->tv_sec * 1000000 + + time_change->tv_usec, tick) + 1; else if (time_change->tv_sec <= LONG_MAX / hz) delta_ticks = time_change->tv_sec * hz + - (time_change->tv_usec + (tick - 1)) / tick + 1; + howmany(time_change->tv_usec, tick) + 1; else delta_ticks = LONG_MAX; Modified: head/sys/kern/subr_pctrie.c ============================================================================== --- head/sys/kern/subr_pctrie.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kern/subr_pctrie.c Tue Apr 26 15:38:17 2016 (r298649) @@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$"); #define PCTRIE_COUNT (1 << PCTRIE_WIDTH) #define PCTRIE_MASK (PCTRIE_COUNT - 1) -#define PCTRIE_LIMIT (howmany((sizeof(uint64_t) * NBBY), PCTRIE_WIDTH) - 1) +#define PCTRIE_LIMIT (howmany(sizeof(uint64_t) * NBBY, PCTRIE_WIDTH) - 1) /* Flag bits stored in node pointers. */ #define PCTRIE_ISLEAF 0x1 Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kern/sys_pipe.c Tue Apr 26 15:38:17 2016 (r298649) @@ -1542,7 +1542,7 @@ pipe_stat(fp, ub, active_cred, td) ub->st_size = pipe->pipe_map.cnt; else ub->st_size = pipe->pipe_buffer.cnt; - ub->st_blocks = (ub->st_size + ub->st_blksize - 1) / ub->st_blksize; + ub->st_blocks = howmany(ub->st_size, ub->st_blksize); ub->st_atim = pipe->pipe_atime; ub->st_mtim = pipe->pipe_mtime; ub->st_ctim = pipe->pipe_ctime; Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kern/sysv_msg.c Tue Apr 26 15:38:17 2016 (r298649) @@ -842,7 +842,7 @@ kern_msgsnd(td, msqid, msgp, msgsz, msgf } #endif - segs_needed = (msgsz + msginfo.msgssz - 1) / msginfo.msgssz; + segs_needed = howmany(msgsz, msginfo.msgssz); DPRINTF(("msgsz=%zu, msgssz=%d, segs_needed=%d\n", msgsz, msginfo.msgssz, segs_needed)); for (;;) { Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kern/uipc_shm.c Tue Apr 26 15:38:17 2016 (r298649) @@ -380,7 +380,7 @@ shm_stat(struct file *fp, struct stat *s bzero(sb, sizeof(*sb)); sb->st_blksize = PAGE_SIZE; sb->st_size = shmfd->shm_size; - sb->st_blocks = (sb->st_size + sb->st_blksize - 1) / sb->st_blksize; + sb->st_blocks = howmany(sb->st_size, sb->st_blksize); mtx_lock(&shm_timestamp_lock); sb->st_atim = shmfd->shm_atime; sb->st_ctim = shmfd->shm_ctime; Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kern/vfs_subr.c Tue Apr 26 15:38:17 2016 (r298649) @@ -1745,7 +1745,7 @@ vtruncbuf(struct vnode *vp, struct ucred /* * Round up to the *next* lbn. */ - trunclbn = (length + blksize - 1) / blksize; + trunclbn = howmany(length, blksize); ASSERT_VOP_LOCKED(vp, "vtruncbuf"); restart: Modified: head/sys/kgssapi/krb5/kcrypto.c ============================================================================== --- head/sys/kgssapi/krb5/kcrypto.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/kgssapi/krb5/kcrypto.c Tue Apr 26 15:38:17 2016 (r298649) @@ -202,8 +202,7 @@ krb5_derive_key(struct krb5_key_state *i * Generate enough bytes for keybits rounded up to a multiple * of blocklen. */ - randomlen = ((ec->ec_keybits/8 + ec->ec_blocklen - 1) / ec->ec_blocklen) - * ec->ec_blocklen; + randomlen = roundup(ec->ec_keybits / 8, ec->ec_blocklen); bytes = malloc(randomlen, M_GSSAPI, M_WAITOK); MGET(m, M_WAITOK, MT_DATA); m->m_len = ec->ec_blocklen; Modified: head/sys/net/if_arcsubr.c ============================================================================== --- head/sys/net/if_arcsubr.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/net/if_arcsubr.c Tue Apr 26 15:38:17 2016 (r298649) @@ -274,7 +274,7 @@ arc_frag_next(struct ifnet *ifp) return m; ++ac->ac_seqid; /* make the seqid unique */ - tfrags = (m->m_pkthdr.len + ARC_MAX_DATA - 1) / ARC_MAX_DATA; + tfrags = howmany(m->m_pkthdr.len, ARC_MAX_DATA); ac->fsflag = 2 * tfrags - 3; ac->sflag = 0; ac->rsflag = ac->fsflag; Modified: head/sys/netgraph/ng_pptpgre.c ============================================================================== --- head/sys/netgraph/ng_pptpgre.c Tue Apr 26 15:34:00 2016 (r298648) +++ head/sys/netgraph/ng_pptpgre.c Tue Apr 26 15:38:17 2016 (r298649) @@ -846,7 +846,7 @@ ng_pptpgre_start_recv_ack_timer(hpriv_p remain = 0; /* Be conservative: timeout can happen up to 1 tick early */ - ticks = (((remain * hz) + PPTP_TIME_SCALE - 1) / PPTP_TIME_SCALE) + 1; + ticks = howmany(remain * hz, PPTP_TIME_SCALE) + 1; ng_callout(&hpriv->rackTimer, hpriv->node, hpriv->hook, ticks, ng_pptpgre_recv_ack_timeout, hpriv, 0); } @@ -894,7 +894,7 @@ ng_pptpgre_start_send_ack_timer(hpriv_p ackTimeout = PPTP_MAX_ACK_DELAY; /* Be conservative: timeout can happen up to 1 tick early */ - ticks = (((ackTimeout * hz) + PPTP_TIME_SCALE - 1) / PPTP_TIME_SCALE); + ticks = howmany(ackTimeout * hz, PPTP_TIME_SCALE); ng_callout(&hpriv->sackTimer, hpriv->node, hpriv->hook, ticks, ng_pptpgre_send_ack_timeout, hpriv, 0); } From owner-svn-src-head@freebsd.org Tue Apr 26 15:41:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAC66B1D449; Tue, 26 Apr 2016 15:41:32 +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 B9E9A1C66; Tue, 26 Apr 2016 15:41:32 +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 u3QFfVmE048771; Tue, 26 Apr 2016 15:41:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QFfV20048770; Tue, 26 Apr 2016 15:41:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604261541.u3QFfV20048770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 26 Apr 2016 15:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298650 - head/sys/boot/kshim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 15:41:33 -0000 Author: hselasky Date: Tue Apr 26 15:41:31 2016 New Revision: 298650 URL: https://svnweb.freebsd.org/changeset/base/298650 Log: Build fix. Add howmany() and nitems() macros to bootloader kernel shim. Modified: head/sys/boot/kshim/bsd_kernel.h Modified: head/sys/boot/kshim/bsd_kernel.h ============================================================================== --- head/sys/boot/kshim/bsd_kernel.h Tue Apr 26 15:38:17 2016 (r298649) +++ head/sys/boot/kshim/bsd_kernel.h Tue Apr 26 15:41:31 2016 (r298650) @@ -35,6 +35,8 @@ #include #include +#define howmany(x, y) (((x)+((y)-1))/(y)) +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) #define isalpha(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z')) #define isdigit(x) ((x) >= '0' && (x) <= '9') #define panic(...) do { printf("USB PANIC: " __VA_ARGS__); while (1) ; } while (0) From owner-svn-src-head@freebsd.org Tue Apr 26 15:52:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B33EBB1D827 for ; Tue, 26 Apr 2016 15:52:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm42-vm10.bullet.mail.bf1.yahoo.com (nm42-vm10.bullet.mail.bf1.yahoo.com [216.109.114.155]) (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 6C1251372 for ; Tue, 26 Apr 2016 15:52:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461685533; bh=FdVSnjG4GqGMuI/fxwrKIecWKRg3XRpS9uz73oxScN8=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=n3s0G2BStZyzNcOC0emt8NeuTj3DZjvXK1UG6ge3xlvW0Zy3PZwcggzmC29ih+yb6HpNOWCBKnN1TzfTnX/0mX78shMVW+sZs1VcvOT5eQ6QaRu0gA+b9xX2if3OMNin4WkNfPuhORxbqZcfAezkubMm/J+RDrEZA1gG6P0jtwquoxapG8484yK/5xjrMCOeS3jN/ZRGHQLY0FOSvoUo0SZIsiXz+vWcmFxysYJfzySizSPHe0hSDtJB1Md2Vcl64UjqIWWgTxvLsItWz5O2fxpg4EzGDcMHnt1CDcVFAlmvmA76W+XolMJwlXqbGongM+FZZ6FfaJeqaRoh6naJFA== Received: from [98.139.215.142] by nm42.bullet.mail.bf1.yahoo.com with NNFMP; 26 Apr 2016 15:45:33 -0000 Received: from [98.139.211.194] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 26 Apr 2016 15:45:33 -0000 Received: from [127.0.0.1] by smtp203.mail.bf1.yahoo.com with NNFMP; 26 Apr 2016 15:45:33 -0000 X-Yahoo-Newman-Id: 245777.94928.bm@smtp203.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: VgTcmdUVM1lvmj3Ue_.Q7hLAKuWrvCd93rJp7.49v_EQ95j wQ7b6RvlBBtHeoCMuWxKn1vbzJ_EzF40rp49Kj3W85ctPwFesBqjJ4RH0q9g UQ2Il15R69X69WJ1kupQpFs6zxHOY1Zg9K5dCN65hOSz7Y3BPOU7raGyozYx qupv1gnAD5dJut2mkYkIGAq4Yhn3nEnr.TCfITv7JN6e_4UdXbQC32_ZCLOk RkSXUDBSOscyfS.9uXWJJq7tTKafolpBzvaNbzROOGChX8pU_R1rfe_ZmFi3 731CLYcwhwqTjtkRbi4cAsrMnWSZjQCqG_prW38OjbOW9DEq4Sf6jaEFNmDh 4hMFhWirhRJLvQd.QDHjVLXSTTUHwn2rlOUGt7bXWYHXPLv2tBKeiY6qZR3n G.nmkLJ_6k.oQ1cD1AIiJxEccDiq5.1UIIZTSaz7SCEg7fpf2GlhBhvSGziu IoGElH3k6Wn7kBG.pHOtfe8SKP9q3UBCpfgHq3tRQsoKg8GBbehKvd1AS6FM o19e0TRWFeVmGkw9yzvf1vrAsD.hk9Brv X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298650 - head/sys/boot/kshim To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604261541.u3QFfV20048770@repo.freebsd.org> From: Pedro Giffuni Message-ID: <369c6d99-ab57-f343-cd26-66b94dc6a811@FreeBSD.org> Date: Tue, 26 Apr 2016 10:44:44 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201604261541.u3QFfV20048770@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 15:52:22 -0000 Thank you, and sorry for breakage! Pedro. On 04/26/16 10:41, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Apr 26 15:41:31 2016 > New Revision: 298650 > URL: https://svnweb.freebsd.org/changeset/base/298650 > > Log: > Build fix. Add howmany() and nitems() macros to bootloader kernel shim. > > Modified: > head/sys/boot/kshim/bsd_kernel.h > > Modified: head/sys/boot/kshim/bsd_kernel.h > ============================================================================== > --- head/sys/boot/kshim/bsd_kernel.h Tue Apr 26 15:38:17 2016 (r298649) > +++ head/sys/boot/kshim/bsd_kernel.h Tue Apr 26 15:41:31 2016 (r298650) > @@ -35,6 +35,8 @@ > #include > #include > > +#define howmany(x, y) (((x)+((y)-1))/(y)) > +#define nitems(x) (sizeof((x)) / sizeof((x)[0])) > #define isalpha(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z')) > #define isdigit(x) ((x) >= '0' && (x) <= '9') > #define panic(...) do { printf("USB PANIC: " __VA_ARGS__); while (1) ; } while (0) > From owner-svn-src-head@freebsd.org Tue Apr 26 15:57:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 757EAB1D909; Tue, 26 Apr 2016 15:57:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F034177D; Tue, 26 Apr 2016 15:57:06 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D025B1FE023; Tue, 26 Apr 2016 17:57:04 +0200 (CEST) Subject: Re: svn commit: r298650 - head/sys/boot/kshim To: Pedro Giffuni , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604261541.u3QFfV20048770@repo.freebsd.org> <369c6d99-ab57-f343-cd26-66b94dc6a811@FreeBSD.org> From: Hans Petter Selasky Message-ID: <571F9095.9060107@selasky.org> Date: Tue, 26 Apr 2016 18:00:21 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <369c6d99-ab57-f343-cd26-66b94dc6a811@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 15:57:07 -0000 On 04/26/16 17:44, Pedro Giffuni wrote: > Thank you, and sorry for breakage! > No problem. Fix is trivial. --HPS From owner-svn-src-head@freebsd.org Tue Apr 26 16:02:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F4088B1DB1E; Tue, 26 Apr 2016 16:02:14 +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 ACDC71D42; Tue, 26 Apr 2016 16:02:14 +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 u3QG2DCa055308; Tue, 26 Apr 2016 16:02:13 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QG2DDg055307; Tue, 26 Apr 2016 16:02:13 GMT (envelope-from br@FreeBSD.org) Message-Id: <201604261602.u3QG2DDg055307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 26 Apr 2016 16:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298651 - head/sys/dev/spibus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 16:02:15 -0000 Author: br Date: Tue Apr 26 16:02:13 2016 New Revision: 298651 URL: https://svnweb.freebsd.org/changeset/base/298651 Log: Fix the parameter type according to method declaration. This fixes compilation on riscv with GCC 5.2.0 Modified: head/sys/dev/spibus/spibus.c Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Tue Apr 26 15:41:31 2016 (r298650) +++ head/sys/dev/spibus/spibus.c Tue Apr 26 16:02:13 2016 (r298651) @@ -139,7 +139,7 @@ spibus_child_pnpinfo_str(device_t bus, d } static int -spibus_read_ivar(device_t bus, device_t child, int which, u_int *result) +spibus_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { struct spibus_ivar *devi = SPIBUS_IVAR(child); From owner-svn-src-head@freebsd.org Tue Apr 26 16:40:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1B19B1C35B; Tue, 26 Apr 2016 16:40: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 9208A1392; Tue, 26 Apr 2016 16:40: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 u3QGe46r064941; Tue, 26 Apr 2016 16:40:04 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QGe46E064940; Tue, 26 Apr 2016 16:40:04 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604261640.u3QGe46E064940@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 26 Apr 2016 16:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298652 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 16:40:05 -0000 Author: adrian Date: Tue Apr 26 16:40:04 2016 New Revision: 298652 URL: https://svnweb.freebsd.org/changeset/base/298652 Log: [mips] correctly represent memory region allocations >> 2^^31 Without this, it'd get promoted incorrectly and fail allocation. Submitted by: Mori Hiroki Reviewed by: imp Modified: head/sys/mips/mips/nexus.c Modified: head/sys/mips/mips/nexus.c ============================================================================== --- head/sys/mips/mips/nexus.c Tue Apr 26 16:02:13 2016 (r298651) +++ head/sys/mips/mips/nexus.c Tue Apr 26 16:40:04 2016 (r298652) @@ -566,8 +566,8 @@ nexus_hinted_child(device_t bus, const c __func__, device_get_nameunit(child), (void *)(intptr_t)maddr, msize); - result = bus_set_resource(child, SYS_RES_MEMORY, 0, maddr, - msize); + result = bus_set_resource(child, SYS_RES_MEMORY, 0, + (u_long) maddr, msize); if (result != 0) { device_printf(bus, "warning: bus_set_resource() failed\n"); From owner-svn-src-head@freebsd.org Tue Apr 26 17:01:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F384FB1CD3E; Tue, 26 Apr 2016 17:01:30 +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 75B2212E3; Tue, 26 Apr 2016 17:01:30 +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 u3QH1LZx051342 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 26 Apr 2016 20:01:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u3QH1LZx051342 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u3QH1Lqq051341; Tue, 26 Apr 2016 20:01:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 26 Apr 2016 20:01:21 +0300 From: Konstantin Belousov To: Jamie Gritton Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298585 - in head: sys/kern usr.sbin/jail Message-ID: <20160426170121.GS2422@kib.kiev.ua> References: <201604251706.u3PH6okj031018@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201604251706.u3PH6okj031018@repo.freebsd.org> User-Agent: Mutt/1.6.0 (2016-04-01) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 17:01:31 -0000 On Mon, Apr 25, 2016 at 05:06:50PM +0000, Jamie Gritton wrote: > Author: jamie > Date: Mon Apr 25 17:06:50 2016 > New Revision: 298585 > URL: https://svnweb.freebsd.org/changeset/base/298585 > > Log: > Encapsulate SYSV IPC objects in jails. Define per-module parameters > sysvmsg, sysvsem, and sysvshm, with the following bahavior: I got the following: lock order reversal: (sleepable after non-sleepable) 1st 0xfffff80005635678 process lock (process lock) @ /usr/home/kostik/work/build/bsd/DEV/src/sys/kern/kern_exit.c:496 2nd 0xffffffff80aebae8 allprison (allprison) @ /usr/home/kostik/work/build/bsd/DEV/src/sys/kern/kern_jail.c:2642 stack backtrace: #0 0xffffffff803cf0c0 at witness_debugger+0x70 #1 0xffffffff803cefb4 at witness_checkorder+0xe54 #2 0xffffffff80378466 at _sx_slock+0x76 #3 0xffffffff8033dcd1 at prison_deref+0x101 #4 0xffffffff80331a68 at exit1+0xa08 #5 0xffffffff8033105d at sys_sys_exit+0xd #6 0xffffffff805c5c84 at ia32_syscall+0x324 #7 0xffffffff80586f35 at Xint0x80_syscall+0x95 lock order reversal: (sleepable after non-sleepable) 1st 0xfffff80005635678 process lock (process lock) @ /usr/home/kostik/work/build/bsd/DEV/src/sys/kern/kern_exit.c:496 2nd 0xffffffff8114d700 sysvshmsx (sysvshmsx) @ /usr/home/kostik/work/build/bsd/DEV/src/sys/modules/sysvipc/sysvshm/../../../kern/sysv_shm.c:1199 stack backtrace: #0 0xffffffff803cf0c0 at witness_debugger+0x70 #1 0xffffffff803cefb4 at witness_checkorder+0xe54 #2 0xffffffff80378755 at _sx_xlock+0x75 #3 0xffffffff8114c5fa at shm_prison_remove+0x2a #4 0xffffffff803598d1 at osd_call+0xb1 #5 0xffffffff8033dd04 at prison_deref+0x134 #6 0xffffffff80331a68 at exit1+0xa08 #7 0xffffffff8033105d at sys_sys_exit+0xd #8 0xffffffff805c5c84 at ia32_syscall+0x324 #9 0xffffffff80586f35 at Xint0x80_syscall+0x95 From owner-svn-src-head@freebsd.org Tue Apr 26 18:03:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AC50B1DA87; Tue, 26 Apr 2016 18:03:07 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) (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 DBDB617C7; Tue, 26 Apr 2016 18:03:06 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: by mail-wm0-x244.google.com with SMTP id w143so6458446wmw.3; Tue, 26 Apr 2016 11:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=3ODHgCz2is0GI/yDsHo5AbNDqqZah4LWPYTb6ay38+Q=; b=IbLiaWP0sPoWmkEcr95N2Zpe+cLnvqVxwG5kHoFxSLQ8MwQeJ/6nMBuPwSAMprR+iP CrWUGRgS3QTYhlTMmjewe/sSKxz7SiL6MtsFuWS1yRakZMX4Y1Re3s/HQrqox630B2J0 phBsaSPneI2hZJZci126c+STf2k/0U/J8zIgUtiuX7f+pFmN8ESzo3z+A/QAX1do0D1o 34phkruA6TPRIkZPPAfW6hkdpA26c0nTw4TwntfGA2XBKN1AA8ErVC4uURNDNibRxL4x HfmDc4W22uSSKqoz16i1yw620prBj2bq8hE4Vf1H025/EAJC1APao38WIvu51xn+vSti ofWQ== 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; bh=3ODHgCz2is0GI/yDsHo5AbNDqqZah4LWPYTb6ay38+Q=; b=ZOy6oXkBdDvaTcHNv0F5ItwyBOS6nfBQH19tGd2hPcdpQA4xKUZs2vuza5XzprbsuE Qnr1XPeug+Vk7wk85Mx56c7oXezNBxZxCgIDedHu9lhrbF2enku61wf63JrKK/GR59i/ N/VazegsPBOhmIrxU5J+S1mU5wFI4XlJoKYqU5H8ckLo32J/WGVShool+jEFiJZX3t8P aoN7c6GlFkyVAsglEaY2BQlhkOoA5E849EKYsl0sZd5QaqTH3vWKJl+aMv7bgUCx1lvl 1l1Z736pEymZpyMsBPucjA/KfUbYDrkjfFi1FsARQWxLT3oza8KeVRPwwIXeAMwiduMz sYng== X-Gm-Message-State: AOPr4FWGER5ssQPxvbBv4P46AVuk6rqxhxp65NRdqJEj0as9BwNnbVeZU+nwa0V1Hpycv2zZ8rrwxp/VuRVc9g== MIME-Version: 1.0 X-Received: by 10.194.21.65 with SMTP id t1mr4678659wje.12.1461693784163; Tue, 26 Apr 2016 11:03:04 -0700 (PDT) Received: by 10.194.43.231 with HTTP; Tue, 26 Apr 2016 11:03:04 -0700 (PDT) In-Reply-To: <201604251706.u3PH6okj031018@repo.freebsd.org> References: <201604251706.u3PH6okj031018@repo.freebsd.org> Date: Tue, 26 Apr 2016 11:03:04 -0700 Message-ID: Subject: Re: svn commit: r298585 - in head: sys/kern usr.sbin/jail From: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= To: Jamie Gritton Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:03:07 -0000 2016-04-25 10:06 GMT-07:00 Jamie Gritton : > Author: jamie > Date: Mon Apr 25 17:06:50 2016 > New Revision: 298585 > URL: https://svnweb.freebsd.org/changeset/base/298585 > > Log: > Encapsulate SYSV IPC objects in jails. Define per-module parameters > sysvmsg, sysvsem, and sysvshm, with the following bahavior: > > inherit: allow full access to the IPC primitives. This is the same as > the current setup with allow.sysvipc is on. Jails and the base system > can see (and moduly) each other's objects, which is generally considered > a bad thing (though may be useful in some circumstances). > > disable: all no access, same as the current setup with allow.sysvipc off. > > new: A jail may see use the IPC objects that it has created. It also > gets its own IPC key namespace, so different jails may have their own > objects using the same key value. The parent jail (or base system) can > see the jail's IPC objects, but not its keys. > > PR: 48471 > Submitted by: based on work by kikuchan98@gmail.com > MFC after: 5 days > > Modified: > head/sys/kern/sysv_msg.c > head/sys/kern/sysv_sem.c > head/sys/kern/sysv_shm.c > head/usr.sbin/jail/jail.8 Looks like some bad sbuf_deletes, see the recent Coverity report (are you folks getting these emails?) *** CID 1354974: Memory - corruptions (BAD_FREE) /sys/kern/sysv_shm.c: 1043 in sysctl_shmsegs() 1037 shmseg->u.shm_perm.key = IPC_PRIVATE; 1038 } 1039 1040 sbuf_bcat(&sb, shmseg, sizeof(*shmseg)); 1041 } 1042 error = sbuf_finish(&sb); >>> CID 1354974: Memory - corruptions (BAD_FREE) >>> "sbuf_delete" frees address of "sb". 1043 sbuf_delete(&sb); 1044 1045 done: 1046 SYSVSHM_UNLOCK(); 1047 return (error); 1048 } ** CID 1354975: Memory - corruptions (BAD_FREE) and one in sysv_msg.c From owner-svn-src-head@freebsd.org Tue Apr 26 18:08:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DC0DB1DBE0; Tue, 26 Apr 2016 18:08:53 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF8E11AA3; Tue, 26 Apr 2016 18:08:52 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3QI8plJ091686; Tue, 26 Apr 2016 18:08:51 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QI8p3a091685; Tue, 26 Apr 2016 18:08:51 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201604261808.u3QI8p3a091685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 26 Apr 2016 18:08:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298654 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:08:53 -0000 Author: bdrewery Date: Tue Apr 26 18:08:51 2016 New Revision: 298654 URL: https://svnweb.freebsd.org/changeset/base/298654 Log: WITH_META_MODE: Allow buildkernel to create .meta files with curdir==objdir. Without this the incremental build was broken since .depend.* are not generated with .MAKE.MODE=meta and .meta files were not created to track dependencies. Typically meta mode does not create .meta files when building with curdir==objdir but the kernel build is special. Reported by: Nikolai Lifanov Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Apr 26 17:39:54 2016 (r298653) +++ head/Makefile.inc1 Tue Apr 26 18:08:51 2016 (r298654) @@ -531,6 +531,11 @@ IMAKE_MTREE= MTREE_CMD="mtree ${MTREEFLA # kernel stage KMAKEENV= ${WMAKEENV} KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} +.if ${MK_META_MODE} == "yes" +# meta mode normally is disallowed when building from curdir==objdir, but we +# want to allow it for the kernel build. +KMAKE+= .MAKE.MODE="${.MAKE.MODE} curdirOk=yes" +.endif # # buildworld From owner-svn-src-head@freebsd.org Tue Apr 26 18:11:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C215B1DE8E; Tue, 26 Apr 2016 18:11:46 +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 3CE461F22; Tue, 26 Apr 2016 18:11:46 +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 u3QIBjeO092472; Tue, 26 Apr 2016 18:11:45 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QIBjrE092471; Tue, 26 Apr 2016 18:11:45 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604261811.u3QIBjrE092471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 18:11:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298655 - head/sys/kgssapi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:11:46 -0000 Author: cem Date: Tue Apr 26 18:11:45 2016 New Revision: 298655 URL: https://svnweb.freebsd.org/changeset/base/298655 Log: kgssapi: Don't leak memory in error cases Reported by: Coverity CIDs: 1007046, 1007047, 1007048 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kgssapi/gssd_prot.c Modified: head/sys/kgssapi/gssd_prot.c ============================================================================== --- head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:08:51 2016 (r298654) +++ head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:11:45 2016 (r298655) @@ -101,8 +101,10 @@ xdr_gss_OID(XDR *xdrs, gss_OID *oidp) } else { oid = mem_alloc(sizeof(gss_OID_desc)); memset(oid, 0, sizeof(*oid)); - if (!xdr_gss_OID_desc(xdrs, oid)) + if (!xdr_gss_OID_desc(xdrs, oid)) { + mem_free(oid, sizeof(gss_OID_desc)); return (FALSE); + } *oidp = oid; } break; @@ -164,8 +166,10 @@ xdr_gss_OID_set(XDR *xdrs, gss_OID_set * } else { set = mem_alloc(sizeof(gss_OID_set_desc)); memset(set, 0, sizeof(*set)); - if (!xdr_gss_OID_set_desc(xdrs, set)) + if (!xdr_gss_OID_set_desc(xdrs, set)) { + mem_free(set, sizeof(gss_OID_set_desc)); return (FALSE); + } *setp = set; } break; @@ -224,8 +228,10 @@ xdr_gss_channel_bindings_t(XDR *xdrs, gs || !xdr_gss_buffer_desc(xdrs, &ch->acceptor_address) || !xdr_gss_buffer_desc(xdrs, - &ch->application_data)) + &ch->application_data)) { + mem_free(ch, sizeof(*ch)); return (FALSE); + } *chp = ch; } break; From owner-svn-src-head@freebsd.org Tue Apr 26 18:17:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAF82B1DFF2; Tue, 26 Apr 2016 18:17:45 +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 C672A1223; Tue, 26 Apr 2016 18:17:45 +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 u3QIHibx094656; Tue, 26 Apr 2016 18:17:44 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QIHi2e094653; Tue, 26 Apr 2016 18:17:44 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604261817.u3QIHi2e094653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Tue, 26 Apr 2016 18:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298656 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:17:46 -0000 Author: jamie Date: Tue Apr 26 18:17:44 2016 New Revision: 298656 URL: https://svnweb.freebsd.org/changeset/base/298656 Log: Redo the changes to the SYSV IPC sysctl functions from r298585, so they don't (mis)use sbufs. PR: 48471 Modified: head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Tue Apr 26 18:11:45 2016 (r298655) +++ head/sys/kern/sysv_msg.c Tue Apr 26 18:17:44 2016 (r298656) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1423,38 +1422,28 @@ sys_msgrcv(td, uap) static int sysctl_msqids(SYSCTL_HANDLER_ARGS) { - struct sbuf sb; - struct msqid_kernel tmp, empty; - struct msqid_kernel *msqkptr; - struct prison *rpr; + struct msqid_kernel tmsqk; + struct prison *pr, *rpr; int error, i; - error = sysctl_wire_old_buffer(req, 0); - if (error != 0) - goto done; + pr = req->td->td_ucred->cr_prison; rpr = msg_find_prison(req->td->td_ucred); - sbuf_new_for_sysctl(&sb, NULL, sizeof(struct msqid_kernel) * - msginfo.msgmni, req); - - bzero(&empty, sizeof(empty)); + error = 0; for (i = 0; i < msginfo.msgmni; i++) { - msqkptr = &msqids[i]; - if (msqkptr->u.msg_qbytes == 0 || rpr == NULL || - msq_prison_cansee(rpr, msqkptr) != 0) { - msqkptr = ∅ - } else if (req->td->td_ucred->cr_prison != - msqkptr->cred->cr_prison) { - bcopy(msqkptr, &tmp, sizeof(tmp)); - msqkptr = &tmp; - msqkptr->u.msg_perm.key = IPC_PRIVATE; + mtx_lock(&msq_mtx); + if (msqids[i].u.msg_qbytes == 0 || rpr == NULL || + msq_prison_cansee(rpr, &msqids[i]) != 0) + bzero(&tmsqk, sizeof(tmsqk)); + else { + tmsqk = msqids[i]; + if (tmsqk.cred->cr_prison != pr) + tmsqk.u.msg_perm.key = IPC_PRIVATE; } - - sbuf_bcat(&sb, msqkptr, sizeof(*msqkptr)); + mtx_unlock(&msq_mtx); + error = SYSCTL_OUT(req, &tmsqk, sizeof(tmsqk)); + if (error != 0) + break; } - error = sbuf_finish(&sb); - sbuf_delete(&sb); - -done: return (error); } @@ -1470,7 +1459,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgssz, "Size of a message segment"); SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, CTLFLAG_RDTUN, &msginfo.msgseg, 0, "Number of message segments"); -SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLTYPE_OPAQUE | CTLFLAG_RD, +SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_msqids, "", "Message queue IDs"); static int Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Tue Apr 26 18:11:45 2016 (r298655) +++ head/sys/kern/sysv_sem.c Tue Apr 26 18:17:44 2016 (r298656) @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -220,7 +219,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, "Semaphore maximum value"); SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, CTLFLAG_RWTUN, &seminfo.semaem, 0, "Adjust on exit max value"); -SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLTYPE_OPAQUE | CTLFLAG_RD, +SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_sema, "", "Semaphore id pool"); static struct syscall_helper_data sem_syscalls[] = { @@ -1465,38 +1465,28 @@ semexit_myhook(void *arg, struct proc *p static int sysctl_sema(SYSCTL_HANDLER_ARGS) { - struct prison *rpr; - struct sbuf sb; - struct semid_kernel tmp, empty; - struct semid_kernel *semakptr; + struct prison *pr, *rpr; + struct semid_kernel tsemak; int error, i; - error = sysctl_wire_old_buffer(req, 0); - if (error != 0) - goto done; + pr = req->td->td_ucred->cr_prison; rpr = sem_find_prison(req->td->td_ucred); - sbuf_new_for_sysctl(&sb, NULL, sizeof(struct semid_kernel) * - seminfo.semmni, req); - - bzero(&empty, sizeof(empty)); + error = 0; for (i = 0; i < seminfo.semmni; i++) { - semakptr = &sema[i]; - if ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || - rpr == NULL || sem_prison_cansee(rpr, semakptr) != 0) { - semakptr = ∅ - } else if (req->td->td_ucred->cr_prison != - semakptr->cred->cr_prison) { - bcopy(semakptr, &tmp, sizeof(tmp)); - semakptr = &tmp; - semakptr->u.sem_perm.key = IPC_PRIVATE; + mtx_lock(&sema_mtx[i]); + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) == 0 || + rpr == NULL || sem_prison_cansee(rpr, &sema[i]) != 0) + bzero(&tsemak, sizeof(tsemak)); + else { + tsemak = sema[i]; + if (tsemak.cred->cr_prison != pr) + tsemak.u.sem_perm.key = IPC_PRIVATE; } - - sbuf_bcat(&sb, semakptr, sizeof(*semakptr)); + mtx_unlock(&sema_mtx[i]); + error = SYSCTL_OUT(req, &tsemak, sizeof(tsemak)); + if (error != 0) + break; } - error = sbuf_finish(&sb); - sbuf_delete(&sb); - -done: return (error); } Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Tue Apr 26 18:11:45 2016 (r298655) +++ head/sys/kern/sysv_shm.c Tue Apr 26 18:17:44 2016 (r298656) @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -1009,40 +1008,28 @@ shmunload(void) static int sysctl_shmsegs(SYSCTL_HANDLER_ARGS) { - struct prison *rpr; - struct sbuf sb; - struct shmid_kernel tmp, empty; - struct shmid_kernel *shmseg; + struct shmid_kernel tshmseg; + struct prison *pr, *rpr; int error, i; SYSVSHM_LOCK(); - - error = sysctl_wire_old_buffer(req, 0); - if (error != 0) - goto done; + pr = req->td->td_ucred->cr_prison; rpr = shm_find_prison(req->td->td_ucred); - sbuf_new_for_sysctl(&sb, NULL, shmalloced * sizeof(shmsegs[0]), req); - - bzero(&empty, sizeof(empty)); - empty.u.shm_perm.mode = SHMSEG_FREE; + error = 0; for (i = 0; i < shmalloced; i++) { - shmseg = &shmsegs[i]; - if ((shmseg->u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || + if ((shmsegs[i].u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || rpr == NULL || shm_prison_cansee(rpr, &shmsegs[i]) != 0) { - shmseg = ∅ - } else if (req->td->td_ucred->cr_prison != - shmseg->cred->cr_prison) { - bcopy(shmseg, &tmp, sizeof(tmp)); - shmseg = &tmp; - shmseg->u.shm_perm.key = IPC_PRIVATE; + bzero(&tshmseg, sizeof(tshmseg)); + tshmseg.u.shm_perm.mode = SHMSEG_FREE; + } else { + tshmseg = shmsegs[i]; + if (tshmseg.cred->cr_prison != pr) + tshmseg.u.shm_perm.key = IPC_PRIVATE; } - - sbuf_bcat(&sb, shmseg, sizeof(*shmseg)); + error = SYSCTL_OUT(req, &tshmseg, sizeof(tshmseg)); + if (error != 0) + break; } - error = sbuf_finish(&sb); - sbuf_delete(&sb); - -done: SYSVSHM_UNLOCK(); return (error); } From owner-svn-src-head@freebsd.org Tue Apr 26 18:20:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 630C9B1C10C; Tue, 26 Apr 2016 18:20:42 +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 2E5C217B9; Tue, 26 Apr 2016 18:20:42 +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 u3QIKfWj094943; Tue, 26 Apr 2016 18:20:41 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QIKf92094942; Tue, 26 Apr 2016 18:20:41 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604261820.u3QIKf92094942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 18:20:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298657 - head/sys/dev/sound/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:20:42 -0000 Author: cem Date: Tue Apr 26 18:20:41 2016 New Revision: 298657 URL: https://svnweb.freebsd.org/changeset/base/298657 Log: emu10kx: Don't iterate beyond array bounds Reported by: Coverity CID: 1354978 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/sound/pci/emu10kx.c Modified: head/sys/dev/sound/pci/emu10kx.c ============================================================================== --- head/sys/dev/sound/pci/emu10kx.c Tue Apr 26 18:17:44 2016 (r298656) +++ head/sys/dev/sound/pci/emu10kx.c Tue Apr 26 18:20:41 2016 (r298657) @@ -587,7 +587,7 @@ emu_getcard(device_t dev) } } - for (i = 0; i < nitems(emu_cards); i++) { + for (i = 0; i < nitems(emu_bad_cards); i++) { if (device == emu_bad_cards[i].device) { if (subdevice == emu_bad_cards[i].subdevice) { thiscard = 0; From owner-svn-src-head@freebsd.org Tue Apr 26 18:23:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 866B8B1C289; Tue, 26 Apr 2016 18:23:03 +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 581141BBC; Tue, 26 Apr 2016 18:23:03 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pf0-x22d.google.com with SMTP id n1so10962265pfn.2; Tue, 26 Apr 2016 11:23:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gyscpdnDskCLvJOgyP8lLOGBu9LEF+g6+/SsODOaUI4=; b=IhISIuTsixH8KycM8kS6Xx9+o4yOJpJa3FOC50ELEbtAcaoPkQEuCGAEdWUWddek8t c8yWevN6/s/wNJ2q/7Qvn3qQqpvQF2+i9Ch4oArglYmOUA2/7LGG/IW6Taf9oaVfuYZS JENDj3LFTq0rmNH9cR4RrqSXEnJVClohRjDbWnYyyF+NFwIhaCgIvoqZAg6vxfwyRzew seCFAoMz0pC+MimTe67iBx3WuslVOBxZq6W2v04y59ggCQLQ1ni++iDxwlXers6dzDB0 t4euY+I6Mzc/dn3xoFhozO1XQTH7uiZMz4+aGL6DW3rnm8z31yUzP2+rMgDdYTEkdXL5 CY9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gyscpdnDskCLvJOgyP8lLOGBu9LEF+g6+/SsODOaUI4=; b=CNV12MqrgwfadIUzGVcmGwKw/A8EDXIGyaBzhPTVv4sSQPrrObbnGu8PAVgoSpUgY6 WPgDTBm012RTQBDrRs3CfmrpuG71P0OdulNd2R8xfnV1e1KmUC6Pi8Ks4xPjb9ZwOZcy ad+SiCkZsYJ1qfa7WDYeuyF0uRV7Qc6bO9tha6ZgG/I1OveldNgv+x76jWDxpF4H5Iyd Ttxc6RAG8B9fTuwVpXunuOPbfx97cOrG+8JDWXBQKIwAwvndGNa8uBp4v6v60gg+iXhi jpN+dON6mEFE3Ia/tKzrdTnYBV4SJdC660nH2aB6bhnnTNvR/0wgJv8FzIR4iXznPh36 xCxQ== X-Gm-Message-State: AOPr4FVRlMC8TXe4ojcrjwANJDlP1fmWCRUZttm3Z7HlmMyqhxsUSS+lrLRvojkVb22LbQ== X-Received: by 10.98.66.89 with SMTP id p86mr5683194pfa.42.1461694982801; Tue, 26 Apr 2016 11:23:02 -0700 (PDT) Received: from [29.138.110.222] ([172.58.40.246]) by smtp.gmail.com with ESMTPSA id lz5sm141758pab.34.2016.04.26.11.23.00 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 26 Apr 2016 11:23:01 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r298585 - in head: sys/kern usr.sbin/jail From: NGie Cooper X-Mailer: iPhone Mail (13E238) In-Reply-To: Date: Tue, 26 Apr 2016 11:22:59 -0700 Cc: Jamie Gritton , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201604251706.u3PH6okj031018@repo.freebsd.org> To: =?utf-8?Q?Ulrich_Sp=C3=B6rlein?= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:23:03 -0000 > On Apr 26, 2016, at 11:03, Ulrich Sp=C3=B6rlein wro= te: >=20 > 2016-04-25 10:06 GMT-07:00 Jamie Gritton : >> Author: jamie >> Date: Mon Apr 25 17:06:50 2016 >> New Revision: 298585 >> URL: https://svnweb.freebsd.org/changeset/base/298585 >>=20 >> Log: >> Encapsulate SYSV IPC objects in jails. Define per-module parameters >> sysvmsg, sysvsem, and sysvshm, with the following bahavior: >>=20 >> inherit: allow full access to the IPC primitives. This is the same as >> the current setup with allow.sysvipc is on. Jails and the base system >> can see (and moduly) each other's objects, which is generally considered= >> a bad thing (though may be useful in some circumstances). >>=20 >> disable: all no access, same as the current setup with allow.sysvipc off= . >>=20 >> new: A jail may see use the IPC objects that it has created. It also >> gets its own IPC key namespace, so different jails may have their own >> objects using the same key value. The parent jail (or base system) can >> see the jail's IPC objects, but not its keys. >>=20 >> PR: 48471 >> Submitted by: based on work by kikuchan98@gmail.com >> MFC after: 5 days >>=20 >> Modified: >> head/sys/kern/sysv_msg.c >> head/sys/kern/sysv_sem.c >> head/sys/kern/sysv_shm.c >> head/usr.sbin/jail/jail.8 >=20 > Looks like some bad sbuf_deletes, see the recent Coverity report (are > you folks getting these emails?) >=20 > *** CID 1354974: Memory - corruptions (BAD_FREE) > /sys/kern/sysv_shm.c: 1043 in sysctl_shmsegs() > 1037 shmseg->u.shm_perm.key =3D IPC_PRIVATE; > 1038 } > 1039 > 1040 sbuf_bcat(&sb, shmseg, sizeof(*shmseg)); > 1041 } > 1042 error =3D sbuf_finish(&sb); >>>> CID 1354974: Memory - corruptions (BAD_FREE) >>>> "sbuf_delete" frees address of "sb". > 1043 sbuf_delete(&sb); > 1044 > 1045 done: > 1046 SYSVSHM_UNLOCK(); > 1047 return (error); > 1048 } >=20 > ** CID 1354975: Memory - corruptions (BAD_FREE) >=20 > and one in sysv_msg.c cem and I hashed this out recently with ntb on phrabricator. The issue is th= at our sbuf implementation is "clever" and has different code paths for stac= k vs heap allocation -- this pattern is ok per stack allocation, but not hea= p allocation... Coverity only knows about how to instrument the latter. Thanks, -Ngie= From owner-svn-src-head@freebsd.org Tue Apr 26 18:38:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1853B1C5ED for ; Tue, 26 Apr 2016 18:38:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm18-vm0.bullet.mail.bf1.yahoo.com (nm18-vm0.bullet.mail.bf1.yahoo.com [98.139.213.138]) (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 9AC601304 for ; Tue, 26 Apr 2016 18:38:01 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461695499; bh=1PaIPS+ojWsUlC53EZpJ8e7PTuk0JuK9iaLPU/d8Wwg=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=ouUeoN54/WU9F2OC5c4aS8uu+/RnaUVViddd2sko7pY71hIWCiKjh759qs1rrOWlSro9KNoqhN2g/1G65ylJUHqPx5plLAPS4anKTuWUIHs7u5/tlX9RLC70Mg+EeRss9abFuJ/r9ML5tgKUEXVAb/S8sjrvgnQjaoSqIcWVrBiTM1IFxTXXl7AlAhatNojgsVl+smBrVFkZBDyX+DyArn2klzTvoKtOLVxs1fsLEIBYh21tmF6qunmBm0O67c4yedFy7V0DNotn5YfDhgYOTStefPyok3wVC03EobZ24adcn4BOhHA35cGB1U2/eZ0ToKI2Jvjt6dLzkCQyfltklA== Received: from [98.139.215.140] by nm18.bullet.mail.bf1.yahoo.com with NNFMP; 26 Apr 2016 18:31:39 -0000 Received: from [68.142.230.74] by tm11.bullet.mail.bf1.yahoo.com with NNFMP; 26 Apr 2016 18:31:39 -0000 Received: from [127.0.0.1] by smtp231.mail.bf1.yahoo.com with NNFMP; 26 Apr 2016 18:31:39 -0000 X-Yahoo-Newman-Id: 800873.21409.bm@smtp231.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: wvYeUxgVM1liiScsGBMIvfS.dxqpZiQWG5LO1MqKTkkHqqt ylYNuQpNHVI2bJLjG.kV2euCiXP2F9sz7zql3eFz2kfJAv1vhryB2z2zpGil l7crSbw9krze5.xqNdfKMyfuCBImESzSRx8.aUT59cdYq97xhqHWjlhYyigw yJDc4Q4UfebPOlD_hH6t4AzjzLT3fXfNgnbua1L4BhmFMstsKWYw9QV3Ugiw wpd11LOl0_JY_YHOax7ZF8RQQIZE9eMk5wMMa.T47z8sd6GWyi4XKX97Btqd kLl8sslAGIR7Z.BJ2j.hQwhP_Gi4mUbW5Oya8asP_9hLtBjVzG5wKLAG61eE WalJbQUf9o6PWMUVr2ty0PjPpGxCAuKlgyRFAj8dpCWlwP4JYY6txXm6G34X Wa1bONQrbICsY_pb1XH6ITfaKIbTqIxyyZyR_etGLOJYwm1ercH8B7TaOEw_ HzFn52Q2Wmm_joXiQyu1NdzN_7nhXYzvgBPg0Arrt03KkUWaknBDRMEZ0TK5 3jAyFqc.tcU0E_UpCD0xVK7WtlOpIyIAc X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298657 - head/sys/dev/sound/pci To: "Conrad E. Meyer" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604261820.u3QIKf92094942@repo.freebsd.org> From: Pedro Giffuni Message-ID: <95061c6a-ac25-3c0f-a1f0-1956477b2fc3@FreeBSD.org> Date: Tue, 26 Apr 2016 13:31:54 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201604261820.u3QIKf92094942@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:38:02 -0000 On 04/26/16 13:20, Conrad E. Meyer wrote: > Author: cem > Date: Tue Apr 26 18:20:41 2016 > New Revision: 298657 > URL: https://svnweb.freebsd.org/changeset/base/298657 > > Log: > emu10kx: Don't iterate beyond array bounds > > Reported by: Coverity > CID: 1354978 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/dev/sound/pci/emu10kx.c > > Modified: head/sys/dev/sound/pci/emu10kx.c > ============================================================================== > --- head/sys/dev/sound/pci/emu10kx.c Tue Apr 26 18:17:44 2016 (r298656) > +++ head/sys/dev/sound/pci/emu10kx.c Tue Apr 26 18:20:41 2016 (r298657) > @@ -587,7 +587,7 @@ emu_getcard(device_t dev) > } > } > > - for (i = 0; i < nitems(emu_cards); i++) { > + for (i = 0; i < nitems(emu_bad_cards); i++) { > if (device == emu_bad_cards[i].device) { > if (subdevice == emu_bad_cards[i].subdevice) { > thiscard = 0; > Hmm sadly interesting. This was not a script or an old bug; it was pilot error. Pointyhat: pfg Thanks! From owner-svn-src-head@freebsd.org Tue Apr 26 18:44:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3DC3B1C808; Tue, 26 Apr 2016 18:44:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f67.google.com (mail-oi0-f67.google.com [209.85.218.67]) (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 A1A2B1A80; Tue, 26 Apr 2016 18:44:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f67.google.com with SMTP id i2so3211718oib.3; Tue, 26 Apr 2016 11:44:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=XCqDzRsHpzuv+yPaVOGjiRfjJYYXIrRHDVdhEjJMk3Q=; b=CzeewQRaOATtzXIGBJRLlY6IEuTkcO9mvtJqBFjwlha1Jaox46GX7Ey37EMPydx1un r9/wcnXPIHPjnQI65yvLROX5ca58+pHuF4Z6FF0tHDXlqj50Z3pCIoTBUxHfX0HafO1C +L9FGIQuDuLY7JUkLofBxUY6msfjXyJmF7A+OstbxQB15J8lnVAXEdLxwPnRVczBAeXP dkSQ2b0B6V7lLY48d/KxlbK/tC70rpgYzujOYygQfTPh9Q9DEosuprkl9G0Iiy99ud68 FhakJW7Zcn8ldT2KGcKZP5WNg0CqPcm1AeE9A/2826WnkWmXUr7S2BBrTjrwqt5RzW9l da5g== X-Gm-Message-State: AOPr4FUpI+e9E7TSbdltfMvy1wDzlV3yPy+3itZQgdIo9jC5+Axfm2BWHDXCmRu2yGjRUg== X-Received: by 10.202.75.82 with SMTP id y79mr1498529oia.71.1461696276980; Tue, 26 Apr 2016 11:44:36 -0700 (PDT) Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com. [209.85.218.49]) by smtp.gmail.com with ESMTPSA id u8sm90540obf.5.2016.04.26.11.44.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 11:44:36 -0700 (PDT) Received: by mail-oi0-f49.google.com with SMTP id k142so24886544oib.1; Tue, 26 Apr 2016 11:44:36 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.83.199 with SMTP id h190mr1706649oib.131.1461696276216; Tue, 26 Apr 2016 11:44:36 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 26 Apr 2016 11:44:36 -0700 (PDT) In-Reply-To: References: <201604251706.u3PH6okj031018@repo.freebsd.org> Date: Tue, 26 Apr 2016 11:44:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298585 - in head: sys/kern usr.sbin/jail From: Conrad Meyer To: NGie Cooper Cc: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= , Jamie Gritton , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:44:44 -0000 Right. False positive. Coverity doesn't grok sbuf memory management fully= . On Tue, Apr 26, 2016 at 11:22 AM, NGie Cooper wrote= : > > > On Apr 26, 2016, at 11:03, Ulrich Sp=C3=B6rlein = wrote: > > > > 2016-04-25 10:06 GMT-07:00 Jamie Gritton : > >> Author: jamie > >> Date: Mon Apr 25 17:06:50 2016 > >> New Revision: 298585 > >> URL: https://svnweb.freebsd.org/changeset/base/298585 > >> > >> Log: > >> Encapsulate SYSV IPC objects in jails. Define per-module parameters > >> sysvmsg, sysvsem, and sysvshm, with the following bahavior: > >> > >> inherit: allow full access to the IPC primitives. This is the same a= s > >> the current setup with allow.sysvipc is on. Jails and the base syste= m > >> can see (and moduly) each other's objects, which is generally > considered > >> a bad thing (though may be useful in some circumstances). > >> > >> disable: all no access, same as the current setup with allow.sysvipc > off. > >> > >> new: A jail may see use the IPC objects that it has created. It also > >> gets its own IPC key namespace, so different jails may have their own > >> objects using the same key value. The parent jail (or base system) c= an > >> see the jail's IPC objects, but not its keys. > >> > >> PR: 48471 > >> Submitted by: based on work by kikuchan98@gmail.com > >> MFC after: 5 days > >> > >> Modified: > >> head/sys/kern/sysv_msg.c > >> head/sys/kern/sysv_sem.c > >> head/sys/kern/sysv_shm.c > >> head/usr.sbin/jail/jail.8 > > > > Looks like some bad sbuf_deletes, see the recent Coverity report (are > > you folks getting these emails?) > > > > *** CID 1354974: Memory - corruptions (BAD_FREE) > > /sys/kern/sysv_shm.c: 1043 in sysctl_shmsegs() > > 1037 shmseg->u.shm_perm.key =3D IPC_PRIVATE; > > 1038 } > > 1039 > > 1040 sbuf_bcat(&sb, shmseg, sizeof(*shmseg)); > > 1041 } > > 1042 error =3D sbuf_finish(&sb); > >>>> CID 1354974: Memory - corruptions (BAD_FREE) > >>>> "sbuf_delete" frees address of "sb". > > 1043 sbuf_delete(&sb); > > 1044 > > 1045 done: > > 1046 SYSVSHM_UNLOCK(); > > 1047 return (error); > > 1048 } > > > > ** CID 1354975: Memory - corruptions (BAD_FREE) > > > > and one in sysv_msg.c > > cem and I hashed this out recently with ntb on phrabricator. The issue is > that our sbuf implementation is "clever" and has different code paths for > stack vs heap allocation -- this pattern is ok per stack allocation, but > not heap allocation... Coverity only knows about how to instrument the > latter. > > Thanks, > -Ngie > From owner-svn-src-head@freebsd.org Tue Apr 26 18:46:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FB91B1C89D; Tue, 26 Apr 2016 18:46:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f68.google.com (mail-oi0-f68.google.com [209.85.218.68]) (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 F3F261C80; Tue, 26 Apr 2016 18:46:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f68.google.com with SMTP id i2so3218090oib.3; Tue, 26 Apr 2016 11:46:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=3pLN2wbzDvDR5r3l5YHsAwn6P+7SfrhNnh+Bfc3OEJg=; b=aMX27WjbrBb9YH6NvQoE281otLUwFq21vBExBbpXkufegLwCePrlw6DjP4jPF01ef+ MrPGoWB5V1fHGwkkWnvBxSaDJd1wFbuMoyySzPTsejsfEsIhJ2N0bhJjHkPIHIdi9xxU rB6cxeuS2wkgxIz7r/JXb67Ct4Amog2qhVWTavz4+yRFs/mDRi3XM1w2KDe3dYsmCCND 67gILR+etY2fmJjsXivirNBz3JNNRfm5XCLX5/z0C+t7i2HeS4FHCeZqHlH5hq8u84e/ xqna7OkiCsuIQrHsO2EP5q8rcemDi+J6erria/ZfPsBZhuWd7hANgdlHk90P4iCrJ9Gv yOJA== X-Gm-Message-State: AOPr4FU3Dk2heA2HC3rSoKxhBCtSg4JCqXvX0baWXVrMeN7WW7iFlDXGzAdI8b8rKP034g== X-Received: by 10.157.54.54 with SMTP id w51mr1572082otb.186.1461696380346; Tue, 26 Apr 2016 11:46:20 -0700 (PDT) Received: from mail-ob0-f172.google.com (mail-ob0-f172.google.com. [209.85.214.172]) by smtp.gmail.com with ESMTPSA id s65sm68558oia.22.2016.04.26.11.46.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 11:46:20 -0700 (PDT) Received: by mail-ob0-f172.google.com with SMTP id j9so11412469obd.3; Tue, 26 Apr 2016 11:46:19 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.178.234 with SMTP id db10mr1686076oec.80.1461696379794; Tue, 26 Apr 2016 11:46:19 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 26 Apr 2016 11:46:19 -0700 (PDT) In-Reply-To: <201604261817.u3QIHi2e094653@repo.freebsd.org> References: <201604261817.u3QIHi2e094653@repo.freebsd.org> Date: Tue, 26 Apr 2016 11:46:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298656 - head/sys/kern From: Conrad Meyer To: Jamie Gritton 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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:46:27 -0000 The sbuf use here was fine before. Best, Conrad On Tue, Apr 26, 2016 at 11:17 AM, Jamie Gritton wrote: > Author: jamie > Date: Tue Apr 26 18:17:44 2016 > New Revision: 298656 > URL: https://svnweb.freebsd.org/changeset/base/298656 > > Log: > Redo the changes to the SYSV IPC sysctl functions from r298585, so they > don't (mis)use sbufs. > > PR: 48471 > > Modified: > head/sys/kern/sysv_msg.c > head/sys/kern/sysv_sem.c > head/sys/kern/sysv_shm.c > > Modified: head/sys/kern/sysv_msg.c > > ============================================================================== > --- head/sys/kern/sysv_msg.c Tue Apr 26 18:11:45 2016 (r298655) > +++ head/sys/kern/sysv_msg.c Tue Apr 26 18:17:44 2016 (r298656) > @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #include > #include > @@ -1423,38 +1422,28 @@ sys_msgrcv(td, uap) > static int > sysctl_msqids(SYSCTL_HANDLER_ARGS) > { > - struct sbuf sb; > - struct msqid_kernel tmp, empty; > - struct msqid_kernel *msqkptr; > - struct prison *rpr; > + struct msqid_kernel tmsqk; > + struct prison *pr, *rpr; > int error, i; > > - error = sysctl_wire_old_buffer(req, 0); > - if (error != 0) > - goto done; > + pr = req->td->td_ucred->cr_prison; > rpr = msg_find_prison(req->td->td_ucred); > - sbuf_new_for_sysctl(&sb, NULL, sizeof(struct msqid_kernel) * > - msginfo.msgmni, req); > - > - bzero(&empty, sizeof(empty)); > + error = 0; > for (i = 0; i < msginfo.msgmni; i++) { > - msqkptr = &msqids[i]; > - if (msqkptr->u.msg_qbytes == 0 || rpr == NULL || > - msq_prison_cansee(rpr, msqkptr) != 0) { > - msqkptr = ∅ > - } else if (req->td->td_ucred->cr_prison != > - msqkptr->cred->cr_prison) { > - bcopy(msqkptr, &tmp, sizeof(tmp)); > - msqkptr = &tmp; > - msqkptr->u.msg_perm.key = IPC_PRIVATE; > + mtx_lock(&msq_mtx); > + if (msqids[i].u.msg_qbytes == 0 || rpr == NULL || > + msq_prison_cansee(rpr, &msqids[i]) != 0) > + bzero(&tmsqk, sizeof(tmsqk)); > + else { > + tmsqk = msqids[i]; > + if (tmsqk.cred->cr_prison != pr) > + tmsqk.u.msg_perm.key = IPC_PRIVATE; > } > - > - sbuf_bcat(&sb, msqkptr, sizeof(*msqkptr)); > + mtx_unlock(&msq_mtx); > + error = SYSCTL_OUT(req, &tmsqk, sizeof(tmsqk)); > + if (error != 0) > + break; > } > - error = sbuf_finish(&sb); > - sbuf_delete(&sb); > - > -done: > return (error); > } > > @@ -1470,7 +1459,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgssz, > "Size of a message segment"); > SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, CTLFLAG_RDTUN, &msginfo.msgseg, 0, > "Number of message segments"); > -SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLTYPE_OPAQUE | CTLFLAG_RD, > +SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, > + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, > NULL, 0, sysctl_msqids, "", "Message queue IDs"); > > static int > > Modified: head/sys/kern/sysv_sem.c > > ============================================================================== > --- head/sys/kern/sysv_sem.c Tue Apr 26 18:11:45 2016 (r298655) > +++ head/sys/kern/sysv_sem.c Tue Apr 26 18:17:44 2016 (r298656) > @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #include > #include > @@ -220,7 +219,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, > "Semaphore maximum value"); > SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, CTLFLAG_RWTUN, &seminfo.semaem, 0, > "Adjust on exit max value"); > -SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLTYPE_OPAQUE | CTLFLAG_RD, > +SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, > + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, > NULL, 0, sysctl_sema, "", "Semaphore id pool"); > > static struct syscall_helper_data sem_syscalls[] = { > @@ -1465,38 +1465,28 @@ semexit_myhook(void *arg, struct proc *p > static int > sysctl_sema(SYSCTL_HANDLER_ARGS) > { > - struct prison *rpr; > - struct sbuf sb; > - struct semid_kernel tmp, empty; > - struct semid_kernel *semakptr; > + struct prison *pr, *rpr; > + struct semid_kernel tsemak; > int error, i; > > - error = sysctl_wire_old_buffer(req, 0); > - if (error != 0) > - goto done; > + pr = req->td->td_ucred->cr_prison; > rpr = sem_find_prison(req->td->td_ucred); > - sbuf_new_for_sysctl(&sb, NULL, sizeof(struct semid_kernel) * > - seminfo.semmni, req); > - > - bzero(&empty, sizeof(empty)); > + error = 0; > for (i = 0; i < seminfo.semmni; i++) { > - semakptr = &sema[i]; > - if ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || > - rpr == NULL || sem_prison_cansee(rpr, semakptr) != 0) { > - semakptr = ∅ > - } else if (req->td->td_ucred->cr_prison != > - semakptr->cred->cr_prison) { > - bcopy(semakptr, &tmp, sizeof(tmp)); > - semakptr = &tmp; > - semakptr->u.sem_perm.key = IPC_PRIVATE; > + mtx_lock(&sema_mtx[i]); > + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) == 0 || > + rpr == NULL || sem_prison_cansee(rpr, &sema[i]) != 0) > + bzero(&tsemak, sizeof(tsemak)); > + else { > + tsemak = sema[i]; > + if (tsemak.cred->cr_prison != pr) > + tsemak.u.sem_perm.key = IPC_PRIVATE; > } > - > - sbuf_bcat(&sb, semakptr, sizeof(*semakptr)); > + mtx_unlock(&sema_mtx[i]); > + error = SYSCTL_OUT(req, &tsemak, sizeof(tsemak)); > + if (error != 0) > + break; > } > - error = sbuf_finish(&sb); > - sbuf_delete(&sb); > - > -done: > return (error); > } > > > Modified: head/sys/kern/sysv_shm.c > > ============================================================================== > --- head/sys/kern/sysv_shm.c Tue Apr 26 18:11:45 2016 (r298655) > +++ head/sys/kern/sysv_shm.c Tue Apr 26 18:17:44 2016 (r298656) > @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > -#include > #include > #include > #include > @@ -1009,40 +1008,28 @@ shmunload(void) > static int > sysctl_shmsegs(SYSCTL_HANDLER_ARGS) > { > - struct prison *rpr; > - struct sbuf sb; > - struct shmid_kernel tmp, empty; > - struct shmid_kernel *shmseg; > + struct shmid_kernel tshmseg; > + struct prison *pr, *rpr; > int error, i; > > SYSVSHM_LOCK(); > - > - error = sysctl_wire_old_buffer(req, 0); > - if (error != 0) > - goto done; > + pr = req->td->td_ucred->cr_prison; > rpr = shm_find_prison(req->td->td_ucred); > - sbuf_new_for_sysctl(&sb, NULL, shmalloced * sizeof(shmsegs[0]), > req); > - > - bzero(&empty, sizeof(empty)); > - empty.u.shm_perm.mode = SHMSEG_FREE; > + error = 0; > for (i = 0; i < shmalloced; i++) { > - shmseg = &shmsegs[i]; > - if ((shmseg->u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || > + if ((shmsegs[i].u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || > rpr == NULL || shm_prison_cansee(rpr, &shmsegs[i]) != > 0) { > - shmseg = ∅ > - } else if (req->td->td_ucred->cr_prison != > - shmseg->cred->cr_prison) { > - bcopy(shmseg, &tmp, sizeof(tmp)); > - shmseg = &tmp; > - shmseg->u.shm_perm.key = IPC_PRIVATE; > + bzero(&tshmseg, sizeof(tshmseg)); > + tshmseg.u.shm_perm.mode = SHMSEG_FREE; > + } else { > + tshmseg = shmsegs[i]; > + if (tshmseg.cred->cr_prison != pr) > + tshmseg.u.shm_perm.key = IPC_PRIVATE; > } > - > - sbuf_bcat(&sb, shmseg, sizeof(*shmseg)); > + error = SYSCTL_OUT(req, &tshmseg, sizeof(tshmseg)); > + if (error != 0) > + break; > } > - error = sbuf_finish(&sb); > - sbuf_delete(&sb); > - > -done: > SYSVSHM_UNLOCK(); > return (error); > } > > From owner-svn-src-head@freebsd.org Tue Apr 26 18:49:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0E33B1C939; Tue, 26 Apr 2016 18:49:25 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [162.220.209.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "www.gritton.org", Issuer "StartCom Class 1 Primary Intermediate Server CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D64141E4A; Tue, 26 Apr 2016 18:49:25 +0000 (UTC) (envelope-from jamie@freebsd.org) Received: from gritton.org (gritton.org [162.220.209.3]) by gritton.org (8.15.2/8.15.2) with ESMTPS id u3QInNCN044745 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 26 Apr 2016 12:49:24 -0600 (MDT) (envelope-from jamie@freebsd.org) Received: (from www@localhost) by gritton.org (8.15.2/8.15.2/Submit) id u3QInNdn044744; Tue, 26 Apr 2016 12:49:23 -0600 (MDT) (envelope-from jamie@freebsd.org) X-Authentication-Warning: gritton.org: www set sender to jamie@freebsd.org using -f To: cem@freebsd.org Subject: Re: svn commit: r298656 - head/sys/kern X-PHP-Originating-Script: 0:rcube.php MIME-Version: 1.0 Date: Tue, 26 Apr 2016 12:49:23 -0600 From: James Gritton Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: References: <201604261817.u3QIHi2e094653@repo.freebsd.org> Message-ID: <156985b5d93d652823cfa5b8943f3568@gritton.org> X-Sender: jamie@freebsd.org User-Agent: Roundcube Webmail/1.1.2 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:49:26 -0000 It turns out I was just about to commit that anyway, so the only difference is I didn't need to put "(mis)" in the comment :-). ipcs(1) was prone to allocation errors that I could bypass by rewriting the sysctls without sbufs. So false positive, but for the best anyway. - Jamie On 2016-04-26 12:46, Conrad Meyer wrote: > The sbuf use here was fine before. > > Best, Conrad > > On Tue, Apr 26, 2016 at 11:17 AM, Jamie Gritton wrote: > >> Author: jamie >> Date: Tue Apr 26 18:17:44 2016 >> New Revision: 298656 >> URL: https://svnweb.freebsd.org/changeset/base/298656 [1] >> >> Log: >> Redo the changes to the SYSV IPC sysctl functions from r298585, so they >> don't (mis)use sbufs. >> >> PR: 48471 >> >> Modified: >> head/sys/kern/sysv_msg.c >> head/sys/kern/sysv_sem.c >> head/sys/kern/sysv_shm.c >> >> Modified: head/sys/kern/sysv_msg.c >> ============================================================================== >> --- head/sys/kern/sysv_msg.c Tue Apr 26 18:11:45 2016 (r298655) >> +++ head/sys/kern/sysv_msg.c Tue Apr 26 18:17:44 2016 (r298656) >> @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include >> #include >> #include >> #include >> @@ -1423,38 +1422,28 @@ sys_msgrcv(td, uap) >> static int >> sysctl_msqids(SYSCTL_HANDLER_ARGS) >> { >> - struct sbuf sb; >> - struct msqid_kernel tmp, empty; >> - struct msqid_kernel *msqkptr; >> - struct prison *rpr; >> + struct msqid_kernel tmsqk; >> + struct prison *pr, *rpr; >> int error, i; >> >> - error = sysctl_wire_old_buffer(req, 0); >> - if (error != 0) >> - goto done; >> + pr = req->td->td_ucred->cr_prison; >> rpr = msg_find_prison(req->td->td_ucred); >> - sbuf_new_for_sysctl(&sb, NULL, sizeof(struct msqid_kernel) * >> - msginfo.msgmni, req); >> - >> - bzero(&empty, sizeof(empty)); >> + error = 0; >> for (i = 0; i < msginfo.msgmni; i++) { >> - msqkptr = &msqids[i]; >> - if (msqkptr->u.msg_qbytes == 0 || rpr == NULL || >> - msq_prison_cansee(rpr, msqkptr) != 0) { >> - msqkptr = ∅ >> - } else if (req->td->td_ucred->cr_prison != >> - msqkptr->cred->cr_prison) { >> - bcopy(msqkptr, &tmp, sizeof(tmp)); >> - msqkptr = &tmp; >> - msqkptr->u.msg_perm.key = IPC_PRIVATE; >> + mtx_lock(&msq_mtx); >> + if (msqids[i].u.msg_qbytes == 0 || rpr == NULL || >> + msq_prison_cansee(rpr, &msqids[i]) != 0) >> + bzero(&tmsqk, sizeof(tmsqk)); >> + else { >> + tmsqk = msqids[i]; >> + if (tmsqk.cred->cr_prison != pr) >> + tmsqk.u.msg_perm.key = IPC_PRIVATE; >> } >> - >> - sbuf_bcat(&sb, msqkptr, sizeof(*msqkptr)); >> + mtx_unlock(&msq_mtx); >> + error = SYSCTL_OUT(req, &tmsqk, sizeof(tmsqk)); >> + if (error != 0) >> + break; >> } >> - error = sbuf_finish(&sb); >> - sbuf_delete(&sb); >> - >> -done: >> return (error); >> } >> >> @@ -1470,7 +1459,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgssz, >> "Size of a message segment"); >> SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg, CTLFLAG_RDTUN, &msginfo.msgseg, 0, >> "Number of message segments"); >> -SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLTYPE_OPAQUE | CTLFLAG_RD, >> +SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, >> + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, >> NULL, 0, sysctl_msqids, "", "Message queue IDs"); >> >> static int >> >> Modified: head/sys/kern/sysv_sem.c >> ============================================================================== >> --- head/sys/kern/sysv_sem.c Tue Apr 26 18:11:45 2016 (r298655) >> +++ head/sys/kern/sysv_sem.c Tue Apr 26 18:17:44 2016 (r298656) >> @@ -52,7 +52,6 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include >> #include >> #include >> #include >> @@ -220,7 +219,8 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, semvmx, >> "Semaphore maximum value"); >> SYSCTL_INT(_kern_ipc, OID_AUTO, semaem, CTLFLAG_RWTUN, &seminfo.semaem, 0, >> "Adjust on exit max value"); >> -SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, CTLTYPE_OPAQUE | CTLFLAG_RD, >> +SYSCTL_PROC(_kern_ipc, OID_AUTO, sema, >> + CTLTYPE_OPAQUE | CTLFLAG_RD | CTLFLAG_MPSAFE, >> NULL, 0, sysctl_sema, "", "Semaphore id pool"); >> >> static struct syscall_helper_data sem_syscalls[] = { >> @@ -1465,38 +1465,28 @@ semexit_myhook(void *arg, struct proc *p >> static int >> sysctl_sema(SYSCTL_HANDLER_ARGS) >> { >> - struct prison *rpr; >> - struct sbuf sb; >> - struct semid_kernel tmp, empty; >> - struct semid_kernel *semakptr; >> + struct prison *pr, *rpr; >> + struct semid_kernel tsemak; >> int error, i; >> >> - error = sysctl_wire_old_buffer(req, 0); >> - if (error != 0) >> - goto done; >> + pr = req->td->td_ucred->cr_prison; >> rpr = sem_find_prison(req->td->td_ucred); >> - sbuf_new_for_sysctl(&sb, NULL, sizeof(struct semid_kernel) * >> - seminfo.semmni, req); >> - >> - bzero(&empty, sizeof(empty)); >> + error = 0; >> for (i = 0; i < seminfo.semmni; i++) { >> - semakptr = &sema[i]; >> - if ((semakptr->u.sem_perm.mode & SEM_ALLOC) == 0 || >> - rpr == NULL || sem_prison_cansee(rpr, semakptr) != 0) { >> - semakptr = ∅ >> - } else if (req->td->td_ucred->cr_prison != >> - semakptr->cred->cr_prison) { >> - bcopy(semakptr, &tmp, sizeof(tmp)); >> - semakptr = &tmp; >> - semakptr->u.sem_perm.key = IPC_PRIVATE; >> + mtx_lock(&sema_mtx[i]); >> + if ((sema[i].u.sem_perm.mode & SEM_ALLOC) == 0 || >> + rpr == NULL || sem_prison_cansee(rpr, &sema[i]) != 0) >> + bzero(&tsemak, sizeof(tsemak)); >> + else { >> + tsemak = sema[i]; >> + if (tsemak.cred->cr_prison != pr) >> + tsemak.u.sem_perm.key = IPC_PRIVATE; >> } >> - >> - sbuf_bcat(&sb, semakptr, sizeof(*semakptr)); >> + mtx_unlock(&sema_mtx[i]); >> + error = SYSCTL_OUT(req, &tsemak, sizeof(tsemak)); >> + if (error != 0) >> + break; >> } >> - error = sbuf_finish(&sb); >> - sbuf_delete(&sb); >> - >> -done: >> return (error); >> } >> >> Modified: head/sys/kern/sysv_shm.c >> ============================================================================== >> --- head/sys/kern/sysv_shm.c Tue Apr 26 18:11:45 2016 (r298655) >> +++ head/sys/kern/sysv_shm.c Tue Apr 26 18:17:44 2016 (r298656) >> @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$"); >> #include >> #include >> #include >> -#include >> #include >> #include >> #include >> @@ -1009,40 +1008,28 @@ shmunload(void) >> static int >> sysctl_shmsegs(SYSCTL_HANDLER_ARGS) >> { >> - struct prison *rpr; >> - struct sbuf sb; >> - struct shmid_kernel tmp, empty; >> - struct shmid_kernel *shmseg; >> + struct shmid_kernel tshmseg; >> + struct prison *pr, *rpr; >> int error, i; >> >> SYSVSHM_LOCK(); >> - >> - error = sysctl_wire_old_buffer(req, 0); >> - if (error != 0) >> - goto done; >> + pr = req->td->td_ucred->cr_prison; >> rpr = shm_find_prison(req->td->td_ucred); >> - sbuf_new_for_sysctl(&sb, NULL, shmalloced * sizeof(shmsegs[0]), req); >> - >> - bzero(&empty, sizeof(empty)); >> - empty.u.shm_perm.mode = SHMSEG_FREE; >> + error = 0; >> for (i = 0; i < shmalloced; i++) { >> - shmseg = &shmsegs[i]; >> - if ((shmseg->u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || >> + if ((shmsegs[i].u.shm_perm.mode & SHMSEG_ALLOCATED) == 0 || >> rpr == NULL || shm_prison_cansee(rpr, &shmsegs[i]) != 0) { >> - shmseg = ∅ >> - } else if (req->td->td_ucred->cr_prison != >> - shmseg->cred->cr_prison) { >> - bcopy(shmseg, &tmp, sizeof(tmp)); >> - shmseg = &tmp; >> - shmseg->u.shm_perm.key = IPC_PRIVATE; >> + bzero(&tshmseg, sizeof(tshmseg)); >> + tshmseg.u.shm_perm.mode = SHMSEG_FREE; >> + } else { >> + tshmseg = shmsegs[i]; >> + if (tshmseg.cred->cr_prison != pr) >> + tshmseg.u.shm_perm.key = IPC_PRIVATE; >> } >> - >> - sbuf_bcat(&sb, shmseg, sizeof(*shmseg)); >> + error = SYSCTL_OUT(req, &tshmseg, sizeof(tshmseg)); >> + if (error != 0) >> + break; >> } >> - error = sbuf_finish(&sb); >> - sbuf_delete(&sb); >> - >> -done: >> SYSVSHM_UNLOCK(); >> return (error); >> } Links: ------ [1] https://svnweb.freebsd.org/changeset/base/298656 From owner-svn-src-head@freebsd.org Tue Apr 26 18:54:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A58B1CB7C; Tue, 26 Apr 2016 18:54:45 +0000 (UTC) (envelope-from bhd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45AFA1305; Tue, 26 Apr 2016 18:54:45 +0000 (UTC) (envelope-from bhd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3QIsiZX007018; Tue, 26 Apr 2016 18:54:44 GMT (envelope-from bhd@FreeBSD.org) Received: (from bhd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QIsilS007017; Tue, 26 Apr 2016 18:54:44 GMT (envelope-from bhd@FreeBSD.org) Message-Id: <201604261854.u3QIsilS007017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bhd set sender to bhd@FreeBSD.org using -f From: Bjoern Heidotting Date: Tue, 26 Apr 2016 18:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298658 - head/usr.sbin/etcupdate X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 18:54:45 -0000 Author: bhd (doc committer) Date: Tue Apr 26 18:54:44 2016 New Revision: 298658 URL: https://svnweb.freebsd.org/changeset/base/298658 Log: Remove redundant word. Reviewed by: bjk, bcr Differential Revision: https://reviews.freebsd.org/D6064 Modified: head/usr.sbin/etcupdate/etcupdate.8 Modified: head/usr.sbin/etcupdate/etcupdate.8 ============================================================================== --- head/usr.sbin/etcupdate/etcupdate.8 Tue Apr 26 18:20:41 2016 (r298657) +++ head/usr.sbin/etcupdate/etcupdate.8 Tue Apr 26 18:54:44 2016 (r298658) @@ -870,7 +870,7 @@ utility was written by Rerunning a merge does not automatically delete conflicts left over from a previous merge. Any conflicts must be resolved before the merge can be rerun. -It it is not clear if this is a feature or a bug. +It is not clear if this is a feature or a bug. .Pp There is no way to easily automate conflict resolution for specific files. For example, one can imagine a syntax along the lines of From owner-svn-src-head@freebsd.org Tue Apr 26 19:06:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0D50B1CFAE; Tue, 26 Apr 2016 19:06:29 +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 B35E31BCC; Tue, 26 Apr 2016 19:06:29 +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 u3QJ6SDX010078; Tue, 26 Apr 2016 19:06:28 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QJ6SXQ010077; Tue, 26 Apr 2016 19:06:28 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604261906.u3QJ6SXQ010077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 19:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298659 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 19:06:30 -0000 Author: cem Date: Tue Apr 26 19:06:28 2016 New Revision: 298659 URL: https://svnweb.freebsd.org/changeset/base/298659 Log: iwm(4): Don't dereference potentially NULL pointer before NULL check Introduced in r298594. There is no path before the 'vap == NULL' check where vap is not already dereferenced. Reported by: Coverity CID: 1354979 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Tue Apr 26 18:54:44 2016 (r298658) +++ head/sys/dev/iwm/if_iwm.c Tue Apr 26 19:06:28 2016 (r298659) @@ -4377,7 +4377,7 @@ iwm_intr(void *arg) device_printf(sc->sc_dev, " rx ring: cur=%d\n", sc->rxq.cur); device_printf(sc->sc_dev, - " 802.11 state %d\n", vap->iv_state); + " 802.11 state %d\n", (vap == NULL) ? -1 : vap->iv_state); /* Don't stop the device; just do a VAP restart */ IWM_UNLOCK(sc); From owner-svn-src-head@freebsd.org Tue Apr 26 19:06:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B384B1CFB6; Tue, 26 Apr 2016 19:06:30 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::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 2146F1BCD; Tue, 26 Apr 2016 19:06:30 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ob0-x230.google.com with SMTP id j9so11689322obd.3; Tue, 26 Apr 2016 12:06:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=5+3kuML4yPRPtbzhuXlzknwvTiePhq4U0mplYZVejVk=; b=XH+kFp4pzg41xqH7bfFJ4LlFWBQez6dKBWLIv342h2Fj7NJl5Wt6/9Ay53KgqJTHXI Ig7sYqSdJWbUyJDDUfezSLIIQAX11bw7XmwSbVsMP68pNCNwfYoQhtVW9PFGRpWEqMnv rV8C64zxVlxe/rs4FLaD+OyTGunW4wI/c0mFlXLJQ/bYrkmhqRWS2pGO8XtbrckFNh+s 5QTzAxfDXU/3yIDxAnrFVjXFjpQcgbYScEM5+pMkfTZXBzPKufURZaGDHoocgj5+GCWh pPqNofvnUksyShjDdXkLuYxgPOPzhdoMw/NUq68knnSuYdZ9mj4mghb/rhP42o0uI6pi irRA== 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; bh=5+3kuML4yPRPtbzhuXlzknwvTiePhq4U0mplYZVejVk=; b=DLyA1AJiC/tF4aqyAGzAizXs0CllQQVIb5k79HehkHRw2yJPXXTMgQUM0nP2Kw8RIu FB0Pg9Ffcusb/5WE4G+XO6bkpX93Ka/UN+MVBXS+A66Fjyo/urS2VD6g/ASoq1h/MUnO PWx7vy3yIYS8TU1igSoJV1rsA+5CX1/BOadYEaJQWG7+me5+J/GKjOCYkf/KOrSKTYuC l1MyygPtFxTNR2JOYioqiPzIbRv1pE0eB442V7ic49aG2H8RvscvjxjgajBg/61JJxAt Jrhg3CvBfnRqsqA+51hSJdxpQwxR1CskDr8lDYD00LvKIXwP5kdi4da5VIG0RROZ3eZd E3Lw== X-Gm-Message-State: AOPr4FWqv13CToKsAvdAjJhUWmOR+EDnZtOehkYTeg3FFLvo+cBVFpgJT4y+fMcKSzfE6sciOrjkhLSLjRvKNw== MIME-Version: 1.0 X-Received: by 10.182.232.168 with SMTP id tp8mr1735600obc.65.1461697589550; Tue, 26 Apr 2016 12:06:29 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.64.138 with HTTP; Tue, 26 Apr 2016 12:06:29 -0700 (PDT) In-Reply-To: <201604261811.u3QIBjrE092471@repo.freebsd.org> References: <201604261811.u3QIBjrE092471@repo.freebsd.org> Date: Tue, 26 Apr 2016 13:06:29 -0600 X-Google-Sender-Auth: aNLe_LUXeTjjP7L57nPZyo9U0mc Message-ID: Subject: Re: svn commit: r298655 - head/sys/kgssapi From: Alan Somers To: "Conrad E. Meyer" 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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 19:06:30 -0000 Nice catch. Will you be MFCing this to stable/10? On Tue, Apr 26, 2016 at 12:11 PM, Conrad E. Meyer wrote: > Author: cem > Date: Tue Apr 26 18:11:45 2016 > New Revision: 298655 > URL: https://svnweb.freebsd.org/changeset/base/298655 > > Log: > kgssapi: Don't leak memory in error cases > > Reported by: Coverity > CIDs: 1007046, 1007047, 1007048 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/kgssapi/gssd_prot.c > > Modified: head/sys/kgssapi/gssd_prot.c > > ============================================================================== > --- head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:08:51 2016 > (r298654) > +++ head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:11:45 2016 > (r298655) > @@ -101,8 +101,10 @@ xdr_gss_OID(XDR *xdrs, gss_OID *oidp) > } else { > oid = mem_alloc(sizeof(gss_OID_desc)); > memset(oid, 0, sizeof(*oid)); > - if (!xdr_gss_OID_desc(xdrs, oid)) > + if (!xdr_gss_OID_desc(xdrs, oid)) { > + mem_free(oid, sizeof(gss_OID_desc)); > return (FALSE); > + } > *oidp = oid; > } > break; > @@ -164,8 +166,10 @@ xdr_gss_OID_set(XDR *xdrs, gss_OID_set * > } else { > set = mem_alloc(sizeof(gss_OID_set_desc)); > memset(set, 0, sizeof(*set)); > - if (!xdr_gss_OID_set_desc(xdrs, set)) > + if (!xdr_gss_OID_set_desc(xdrs, set)) { > + mem_free(set, sizeof(gss_OID_set_desc)); > return (FALSE); > + } > *setp = set; > } > break; > @@ -224,8 +228,10 @@ xdr_gss_channel_bindings_t(XDR *xdrs, gs > || !xdr_gss_buffer_desc(xdrs, > &ch->acceptor_address) > || !xdr_gss_buffer_desc(xdrs, > - &ch->application_data)) > + &ch->application_data)) { > + mem_free(ch, sizeof(*ch)); > return (FALSE); > + } > *chp = ch; > } > break; > > From owner-svn-src-head@freebsd.org Tue Apr 26 19:21:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 243D7B195B4; Tue, 26 Apr 2016 19:21: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 E90661506; Tue, 26 Apr 2016 19:21: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 u3QJLaOx013835; Tue, 26 Apr 2016 19:21:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QJLaEN013834; Tue, 26 Apr 2016 19:21:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604261921.u3QJLaEN013834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 26 Apr 2016 19:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298660 - head/contrib/netbsd-tests/lib/libc/ssp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 19:21:37 -0000 Author: ngie Date: Tue Apr 26 19:21:35 2016 New Revision: 298660 URL: https://svnweb.freebsd.org/changeset/base/298660 Log: Fix up r298368 Remove the semicolon accidentally added after the new conditional that tests that /dev/zero is opened successfully. MFC after: 1 week X-MFC with: r298368 Pointhat to: ngie Reported by: Coverity CID: 1354980 Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_read.c Modified: head/contrib/netbsd-tests/lib/libc/ssp/h_read.c ============================================================================== --- head/contrib/netbsd-tests/lib/libc/ssp/h_read.c Tue Apr 26 19:06:28 2016 (r298659) +++ head/contrib/netbsd-tests/lib/libc/ssp/h_read.c Tue Apr 26 19:21:35 2016 (r298660) @@ -47,7 +47,7 @@ main(int argc, char *argv[]) int fd, n; size_t len = atoi(argv[1]); - if ((fd = open(_PATH_DEVZERO, O_RDONLY)) == -1); + if ((fd = open(_PATH_DEVZERO, O_RDONLY)) == -1) abort(); if ((n = read(fd, b, len)) == -1) abort(); From owner-svn-src-head@freebsd.org Tue Apr 26 19:23:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7693FB19700; Tue, 26 Apr 2016 19:23:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f66.google.com (mail-oi0-f66.google.com [209.85.218.66]) (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 40E281864; Tue, 26 Apr 2016 19:23:36 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f66.google.com with SMTP id i2so3351261oib.3; Tue, 26 Apr 2016 12:23:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=H6cBubZEYVq6I7wswBkHyZ85elhf89Kbn/aHesbhKbY=; b=h4d1XFAJZtjPvmRYNAoqB071JuoKDQ5ZDiNmioiJ3QzokemY1KmuNU9ED5ZS+nqfN8 qFut0HZ3xWO3YaNc2CUi4kUlX7MqJc828oL2wGn2KqX2qoh4bO7wyZ/B7PR0qUporp+j oERM3CG2c5d8RliYZv2aI9Fa+kikZ6YvgAObk53RlFO762L92FnPjuu7I/xJJs0xg3ho 1Uuk7ri3jja2I7AINtSVjakJX2TJWD5+vFEhRZIkjbj1H3XBHKdS2Plyy5MsgFOOcbNc EAi2/R5hQK1kkDme/zq+UMHwLedTMWmDKhOu4Iau76vVAy/KNUIDUraArDNdEkqOuuyu 9LOg== X-Gm-Message-State: AOPr4FW1GR1/+Q26ymTCP11EEXctUgq31WE+DUDw/wflZ07hIYZ4YgvaeAag9Xq23uonPw== X-Received: by 10.202.206.68 with SMTP id e65mr1064865oig.158.1461698609069; Tue, 26 Apr 2016 12:23:29 -0700 (PDT) Received: from mail-oi0-f49.google.com (mail-oi0-f49.google.com. [209.85.218.49]) by smtp.gmail.com with ESMTPSA id ke9sm134994obb.12.2016.04.26.12.23.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 12:23:28 -0700 (PDT) Received: by mail-oi0-f49.google.com with SMTP id x19so26018250oix.2; Tue, 26 Apr 2016 12:23:28 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.157.36.135 with SMTP id z7mr1691398ota.69.1461698608335; Tue, 26 Apr 2016 12:23:28 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 26 Apr 2016 12:23:28 -0700 (PDT) In-Reply-To: References: <201604261811.u3QIBjrE092471@repo.freebsd.org> Date: Tue, 26 Apr 2016 12:23:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298655 - head/sys/kgssapi From: Conrad Meyer To: Alan Somers 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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 19:23:36 -0000 Nope! I don't do stable/. On Tue, Apr 26, 2016 at 12:06 PM, Alan Somers wrote: > Nice catch. Will you be MFCing this to stable/10? > > On Tue, Apr 26, 2016 at 12:11 PM, Conrad E. Meyer wrote: > >> Author: cem >> Date: Tue Apr 26 18:11:45 2016 >> New Revision: 298655 >> URL: https://svnweb.freebsd.org/changeset/base/298655 >> >> Log: >> kgssapi: Don't leak memory in error cases >> >> Reported by: Coverity >> CIDs: 1007046, 1007047, 1007048 >> Sponsored by: EMC / Isilon Storage Division >> >> Modified: >> head/sys/kgssapi/gssd_prot.c >> >> Modified: head/sys/kgssapi/gssd_prot.c >> >> ============================================================================== >> --- head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:08:51 2016 >> (r298654) >> +++ head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:11:45 2016 >> (r298655) >> @@ -101,8 +101,10 @@ xdr_gss_OID(XDR *xdrs, gss_OID *oidp) >> } else { >> oid = mem_alloc(sizeof(gss_OID_desc)); >> memset(oid, 0, sizeof(*oid)); >> - if (!xdr_gss_OID_desc(xdrs, oid)) >> + if (!xdr_gss_OID_desc(xdrs, oid)) { >> + mem_free(oid, sizeof(gss_OID_desc)); >> return (FALSE); >> + } >> *oidp = oid; >> } >> break; >> @@ -164,8 +166,10 @@ xdr_gss_OID_set(XDR *xdrs, gss_OID_set * >> } else { >> set = mem_alloc(sizeof(gss_OID_set_desc)); >> memset(set, 0, sizeof(*set)); >> - if (!xdr_gss_OID_set_desc(xdrs, set)) >> + if (!xdr_gss_OID_set_desc(xdrs, set)) { >> + mem_free(set, sizeof(gss_OID_set_desc)); >> return (FALSE); >> + } >> *setp = set; >> } >> break; >> @@ -224,8 +228,10 @@ xdr_gss_channel_bindings_t(XDR *xdrs, gs >> || !xdr_gss_buffer_desc(xdrs, >> &ch->acceptor_address) >> || !xdr_gss_buffer_desc(xdrs, >> - &ch->application_data)) >> + &ch->application_data)) { >> + mem_free(ch, sizeof(*ch)); >> return (FALSE); >> + } >> *chp = ch; >> } >> break; >> >> > From owner-svn-src-head@freebsd.org Tue Apr 26 19:57:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2F21B19DCA; Tue, 26 Apr 2016 19:57:37 +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 A7BE61668; Tue, 26 Apr 2016 19:57:37 +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 u3QJvaEW025522; Tue, 26 Apr 2016 19:57:36 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QJvZAh025514; Tue, 26 Apr 2016 19:57:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604261957.u3QJvZAh025514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 19:57:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298661 - in head: share/man/man9 sys/compat/linux sys/kern sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 19:57:38 -0000 Author: cem Date: Tue Apr 26 19:57:35 2016 New Revision: 298661 URL: https://svnweb.freebsd.org/changeset/base/298661 Log: osd(9): Change array pointer to array pointer type from void* This is a minor follow-up to r297422, prompted by a Coverity warning. (It's not a real defect, just a code smell.) OSD slot array reservations are an array of pointers (void **) but were cast to void* and back unnecessarily. Keep the correct type from reservation to use. osd.9 is updated to match, along with a few trivial igor fixes. Reported by: Coverity CID: 1353811 Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man9/osd.9 head/sys/compat/linux/linux_mib.c head/sys/kern/kern_osd.c head/sys/kern/sysv_msg.c head/sys/kern/sysv_sem.c head/sys/kern/sysv_shm.c head/sys/sys/osd.h Modified: head/share/man/man9/osd.9 ============================================================================== --- head/share/man/man9/osd.9 Tue Apr 26 19:21:35 2016 (r298660) +++ head/share/man/man9/osd.9 Tue Apr 26 19:57:35 2016 (r298661) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 30, 2016 +.Dd April 26, 2016 .Dt OSD 9 .Os .Sh NAME @@ -65,7 +65,7 @@ .Fa "u_int slot" .Fa "void *value" .Fc -.Ft void * +.Ft void ** .Fo osd_reserve .Fa "u_int slot" .Fc @@ -74,12 +74,12 @@ .Fa "u_int type" .Fa "struct osd *osd" .Fa "u_int slot" -.Fa "void *rsv" +.Fa "void **rsv" .Fa "void *value" .Fc .Ft void .Fo osd_free_reserved -.Fa "void *rsv" +.Fa "void **rsv" .Fc .Ft void * .Fo osd_get @@ -314,8 +314,8 @@ the external data associated with a kern .Vt struct osd member. The type identifier is used as the index into the outer array, and the slot -identifier is used as the index into the inner array. To set or retrieve a data -pointer for a given type/slot identifier pair, +identifier is used as the index into the inner array. +To set or retrieve a data pointer for a given type/slot identifier pair, .Fn osd_set and .Fn osd_get @@ -341,7 +341,7 @@ is used to grow the array to the appropr can be used. To maximise the efficiency of any code which calls .Fn osd_set -sequentially on a number of different slot identifiers (e.g. during an +sequentially on a number of different slot identifiers (e.g., during an initialisation phase) one should loop through the slot identifiers in descending order from highest to lowest. This will result in only a single @@ -354,7 +354,8 @@ calls. .Pp It is possible for .Fn osd_set -to fail to allocate this array. To ensure that such allocation succeeds, +to fail to allocate this array. +To ensure that such allocation succeeds, .Fn osd_reserve may be called (in a non-blocking context), and it will pre-allocate the memory via Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Tue Apr 26 19:21:35 2016 (r298660) +++ head/sys/compat/linux/linux_mib.c Tue Apr 26 19:57:35 2016 (r298661) @@ -192,7 +192,7 @@ linux_alloc_prison(struct prison *pr, st { struct prison *ppr; struct linux_prison *lpr, *nlpr; - void *rsv; + void **rsv; /* If this prison already has Linux info, return that. */ lpr = linux_find_prison(pr, &ppr); Modified: head/sys/kern/kern_osd.c ============================================================================== --- head/sys/kern/kern_osd.c Tue Apr 26 19:21:35 2016 (r298660) +++ head/sys/kern/kern_osd.c Tue Apr 26 19:57:35 2016 (r298661) @@ -202,7 +202,7 @@ osd_set(u_int type, struct osd *osd, u_i return (osd_set_reserved(type, osd, slot, NULL, value)); } -void * +void ** osd_reserve(u_int slot) { @@ -213,7 +213,7 @@ osd_reserve(u_int slot) } int -osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv, +osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv, void *value) { struct rm_priotracker tracker; @@ -224,7 +224,7 @@ osd_set_reserved(u_int type, struct osd rm_rlock(&osdm[type].osd_object_lock, &tracker); if (slot > osd->osd_nslots) { - void *newptr; + void **newptr; if (value == NULL) { OSD_DEBUG( @@ -283,7 +283,7 @@ osd_set_reserved(u_int type, struct osd } void -osd_free_reserved(void *rsv) +osd_free_reserved(void **rsv) { OSD_DEBUG("Discarding reserved slot array."); Modified: head/sys/kern/sysv_msg.c ============================================================================== --- head/sys/kern/sysv_msg.c Tue Apr 26 19:21:35 2016 (r298660) +++ head/sys/kern/sysv_msg.c Tue Apr 26 19:57:35 2016 (r298661) @@ -206,7 +206,7 @@ static int msginit() { struct prison *pr; - void *rsv; + void **rsv; int i, error; osd_method_t methods[PR_MAXMETHOD] = { [PR_METHOD_CHECK] = msg_prison_check, Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Tue Apr 26 19:21:35 2016 (r298660) +++ head/sys/kern/sysv_sem.c Tue Apr 26 19:57:35 2016 (r298661) @@ -260,7 +260,7 @@ static int seminit(void) { struct prison *pr; - void *rsv; + void **rsv; int i, error; osd_method_t methods[PR_MAXMETHOD] = { [PR_METHOD_CHECK] = sem_prison_check, Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Tue Apr 26 19:21:35 2016 (r298660) +++ head/sys/kern/sysv_shm.c Tue Apr 26 19:57:35 2016 (r298661) @@ -900,7 +900,7 @@ static int shminit(void) { struct prison *pr; - void *rsv; + void **rsv; int i, error; osd_method_t methods[PR_MAXMETHOD] = { [PR_METHOD_CHECK] = shm_prison_check, Modified: head/sys/sys/osd.h ============================================================================== --- head/sys/sys/osd.h Tue Apr 26 19:21:35 2016 (r298660) +++ head/sys/sys/osd.h Tue Apr 26 19:57:35 2016 (r298661) @@ -59,10 +59,10 @@ int osd_register(u_int type, osd_destruc void osd_deregister(u_int type, u_int slot); int osd_set(u_int type, struct osd *osd, u_int slot, void *value); -void *osd_reserve(u_int slot); -int osd_set_reserved(u_int type, struct osd *osd, u_int slot, void *rsv, +void **osd_reserve(u_int slot); +int osd_set_reserved(u_int type, struct osd *osd, u_int slot, void **rsv, void *value); -void osd_free_reserved(void *rsv); +void osd_free_reserved(void **rsv); void *osd_get(u_int type, struct osd *osd, u_int slot); void osd_del(u_int type, struct osd *osd, u_int slot); int osd_call(u_int type, u_int method, void *obj, void *data); From owner-svn-src-head@freebsd.org Tue Apr 26 20:06:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DF46B1D16D; Tue, 26 Apr 2016 20:06:36 +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 3ECE71E52; Tue, 26 Apr 2016 20:06:36 +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 u3QK6Zju028765; Tue, 26 Apr 2016 20:06:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QK6ZEs028764; Tue, 26 Apr 2016 20:06:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262006.u3QK6ZEs028764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 20:06:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298662 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 20:06:36 -0000 Author: cem Date: Tue Apr 26 20:06:35 2016 New Revision: 298662 URL: https://svnweb.freebsd.org/changeset/base/298662 Log: PCI Enhanced Allocation: Annotate an intentional switch fallthrough This is a trivial follow-up to r296308. Annotate the intentional fallthrough to make it clear for future readers and linters. Reported by: Coverity CID: 1352716 Discussed with: jhb Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Tue Apr 26 19:57:35 2016 (r298661) +++ head/sys/dev/pci/pci.c Tue Apr 26 20:06:35 2016 (r298662) @@ -3691,6 +3691,7 @@ pci_add_resources_ea(device_t bus, devic case PCIM_EA_P_MEM_PREFETCH: case PCIM_EA_P_VF_MEM_PREFETCH: flags = RF_PREFETCHABLE; + /* FALLTHROUGH */ case PCIM_EA_P_VF_MEM: case PCIM_EA_P_MEM: type = SYS_RES_MEMORY; From owner-svn-src-head@freebsd.org Tue Apr 26 20:24:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D183B1D556; Tue, 26 Apr 2016 20:24:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x231.google.com (mail-oi0-x231.google.com [IPv6:2607:f8b0:4003:c06::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 C2A791A04; Tue, 26 Apr 2016 20:24:44 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x231.google.com with SMTP id r78so27902377oie.0; Tue, 26 Apr 2016 13:24:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=g/ad+D4untkYdQiC/Q3wMdhvdA7cHc1p7b7nE9RXdAM=; b=NdDmNiYop7OaVLzEGrC8yIwaMeMD5BFZyzeCH1nzEa28Vt01s9bn29hFwWWXdAKkYk IWF9iRZCSjtn1u1ye5du89qoi78AhjpvKYUH3Tr14fm8rnKygLQL4QP8ZfDjkOjH6pxD d5qURD0Ide1pHUUAo10mVZZzcWYieeAooj0WID50jcnHXx8Nq+VAsLr6bLyPuQXKyzSM g2tcI8hdCMb6gbp2v6hxA/h3SrUJtzQhkFDDagggvUyYh2q4UwrrDID7rGJ8HDjP8wrn YZDXRpNWFSgiWKBZysdPDkkgwzF20MW7d2R2ePCZLPTyI1VaB+S5G5x3Hyrol2iTRiTY NJPw== 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; bh=g/ad+D4untkYdQiC/Q3wMdhvdA7cHc1p7b7nE9RXdAM=; b=fummzPBzVhcyJ4ORvA7VwHMQxaBLtJrj6MyCAASdPcvmivvW7AjyokYfDy6aDKpCKe Mt1/pI5RYDcHs/BoYCSQV5ovL0kHJNbk/c0qsNALo0t9mL6NVTPLVGCmrQntaeW6qZRE d2gRdwcYWTubR4JUd4nPq3ChYXAvmV6nRGDE+7W3aM5Nh4JVP64ztGsu2ES54ONWVEQs EgQS+B/+plmBZWuY/7O0lkwgH/TobY3jJ/rrtoMl/HLjdDC0n04WN3SmAH1tWyjffMo4 9IpEIfSOpVX3Hu3OVxq6hOjrhMzezryZqsoWvjog5XoP9JPemBVb04Ooj3aJ9LpJ9gz5 lTXw== X-Gm-Message-State: AOPr4FWCqHmnZYXw4U+UJjm0IkvGaPXiR8Fz4KWwydaak0TMrM9XBfyCSEomH5jM1dYywnI3IY6lr7Q7FrOxug== MIME-Version: 1.0 X-Received: by 10.157.38.40 with SMTP id a37mr2009658otb.152.1461702284051; Tue, 26 Apr 2016 13:24:44 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.64.138 with HTTP; Tue, 26 Apr 2016 13:24:43 -0700 (PDT) In-Reply-To: References: <201604261811.u3QIBjrE092471@repo.freebsd.org> Date: Tue, 26 Apr 2016 14:24:43 -0600 X-Google-Sender-Auth: fxJbmqIsql7TRhZEaT_8TAeb4js Message-ID: Subject: Re: svn commit: r298655 - head/sys/kgssapi From: Alan Somers To: "Conrad E. Meyer" 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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 20:24:45 -0000 You really ought to. When you MFC yourself, it reduces the likelihood of errors, because you understand the change best. When someone else does it, it's more likely he'll make a mistake, because he may not know the fine details behind the change. In fact, it's hard for anybody else to even know that a given change should or shouldn't be MFCed. The MFC reminder emails only go to the committer, not to everyone. And when someone unfamiliar with kgssapi looks at a commit message like the one below, he doesn't know whether there's no MFC tag because the change isn't applicable to stable/10, or because the committer forgot it, or because the committer just "doesn't do stable". Please help maintain stable/10. It's everyone's job. -Alan On Tue, Apr 26, 2016 at 1:23 PM, Conrad Meyer wrote: > Nope! I don't do stable/. > > On Tue, Apr 26, 2016 at 12:06 PM, Alan Somers wrote: > >> Nice catch. Will you be MFCing this to stable/10? >> >> On Tue, Apr 26, 2016 at 12:11 PM, Conrad E. Meyer >> wrote: >> >>> Author: cem >>> Date: Tue Apr 26 18:11:45 2016 >>> New Revision: 298655 >>> URL: https://svnweb.freebsd.org/changeset/base/298655 >>> >>> Log: >>> kgssapi: Don't leak memory in error cases >>> >>> Reported by: Coverity >>> CIDs: 1007046, 1007047, 1007048 >>> Sponsored by: EMC / Isilon Storage Division >>> >>> Modified: >>> head/sys/kgssapi/gssd_prot.c >>> >>> Modified: head/sys/kgssapi/gssd_prot.c >>> >>> ============================================================================== >>> --- head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:08:51 2016 >>> (r298654) >>> +++ head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:11:45 2016 >>> (r298655) >>> @@ -101,8 +101,10 @@ xdr_gss_OID(XDR *xdrs, gss_OID *oidp) >>> } else { >>> oid = mem_alloc(sizeof(gss_OID_desc)); >>> memset(oid, 0, sizeof(*oid)); >>> - if (!xdr_gss_OID_desc(xdrs, oid)) >>> + if (!xdr_gss_OID_desc(xdrs, oid)) { >>> + mem_free(oid, sizeof(gss_OID_desc)); >>> return (FALSE); >>> + } >>> *oidp = oid; >>> } >>> break; >>> @@ -164,8 +166,10 @@ xdr_gss_OID_set(XDR *xdrs, gss_OID_set * >>> } else { >>> set = mem_alloc(sizeof(gss_OID_set_desc)); >>> memset(set, 0, sizeof(*set)); >>> - if (!xdr_gss_OID_set_desc(xdrs, set)) >>> + if (!xdr_gss_OID_set_desc(xdrs, set)) { >>> + mem_free(set, sizeof(gss_OID_set_desc)); >>> return (FALSE); >>> + } >>> *setp = set; >>> } >>> break; >>> @@ -224,8 +228,10 @@ xdr_gss_channel_bindings_t(XDR *xdrs, gs >>> || !xdr_gss_buffer_desc(xdrs, >>> &ch->acceptor_address) >>> || !xdr_gss_buffer_desc(xdrs, >>> - &ch->application_data)) >>> + &ch->application_data)) { >>> + mem_free(ch, sizeof(*ch)); >>> return (FALSE); >>> + } >>> *chp = ch; >>> } >>> break; >>> >>> >> > From owner-svn-src-head@freebsd.org Tue Apr 26 20:27:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83C84B1D5E8; Tue, 26 Apr 2016 20:27:18 +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 43D581CFE; Tue, 26 Apr 2016 20:27:18 +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 u3QKRHbd035266; Tue, 26 Apr 2016 20:27:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QKRHC2035265; Tue, 26 Apr 2016 20:27:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262027.u3QKRHC2035265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 20:27:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298663 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 20:27:18 -0000 Author: cem Date: Tue Apr 26 20:27:17 2016 New Revision: 298663 URL: https://svnweb.freebsd.org/changeset/base/298663 Log: radix_mpath: Don't derefence a NULL pointer in for loop iteration It seems rn_dupedkey may be NULL, because of the NULL check inside the loop. (Also, the rt gets assigned from rn_dupedkey and NULL checked at top of loop.) However, the for-loop update condition happens before the top-of-loop check and dereferences 'rt' unconditionally. Instead, NULL-check before dereferencing. If rn_dupedkey cannot in fact be NULL, or something else protects this, feel free to revert this and add an ASSERT of some kind instead. This was introduced in r191080 (2009) and moved around slightly in r293657. Reported by: Coverity CID: 1348482 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/net/radix_mpath.c Modified: head/sys/net/radix_mpath.c ============================================================================== --- head/sys/net/radix_mpath.c Tue Apr 26 20:06:35 2016 (r298662) +++ head/sys/net/radix_mpath.c Tue Apr 26 20:27:17 2016 (r298663) @@ -223,7 +223,7 @@ rt_mpath_selectrte(struct rtentry *rte, hash %= total_weight; for (weight = abs((int32_t)hash); rt != NULL && weight >= rt->rt_weight; - weight -= rt->rt_weight) { + weight -= (rt == NULL) ? 0 : rt->rt_weight) { /* stay within the multipath routes */ if (rn->rn_dupedkey && rn->rn_mask != rn->rn_dupedkey->rn_mask) From owner-svn-src-head@freebsd.org Tue Apr 26 20:36:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE851B1D94C; Tue, 26 Apr 2016 20:36:33 +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 99CCA13D9; Tue, 26 Apr 2016 20:36:33 +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 u3QKaWu2038437; Tue, 26 Apr 2016 20:36:32 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QKaWto038435; Tue, 26 Apr 2016 20:36:32 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201604262036.u3QKaWto038435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Tue, 26 Apr 2016 20:36:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298664 - head/sys/fs/msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 20:36:33 -0000 Author: kp Date: Tue Apr 26 20:36:32 2016 New Revision: 298664 URL: https://svnweb.freebsd.org/changeset/base/298664 Log: msdosfs: Prevent buffer overflow when expanding win95 names In win2unixfn() we expand Windows 95 style long names. In some cases that requires moving the data in the nbp->nb_buf buffer backwards to make room. That code failed to check for overflows, leading to a stack overflow in win2unixfn(). We now check for this event, and mark the entire conversion as failed in that case. This means we present the 8 character, dos style, name instead. PR: 204643 Differential Revision: https://reviews.freebsd.org/D6015 Modified: head/sys/fs/msdosfs/direntry.h head/sys/fs/msdosfs/msdosfs_conv.c Modified: head/sys/fs/msdosfs/direntry.h ============================================================================== --- head/sys/fs/msdosfs/direntry.h Tue Apr 26 20:27:17 2016 (r298663) +++ head/sys/fs/msdosfs/direntry.h Tue Apr 26 20:36:32 2016 (r298664) @@ -145,7 +145,7 @@ struct msdosfsmount; char *mbnambuf_flush(struct mbnambuf *nbp, struct dirent *dp); void mbnambuf_init(struct mbnambuf *nbp); -void mbnambuf_write(struct mbnambuf *nbp, char *name, int id); +int mbnambuf_write(struct mbnambuf *nbp, char *name, int id); int dos2unixfn(u_char dn[11], u_char *un, int lower, struct msdosfsmount *pmp); int unix2dosfn(const u_char *un, u_char dn[12], size_t unlen, u_int gen, Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Tue Apr 26 20:27:17 2016 (r298663) +++ head/sys/fs/msdosfs/msdosfs_conv.c Tue Apr 26 20:36:32 2016 (r298664) @@ -658,7 +658,9 @@ win2unixfn(struct mbnambuf *nbp, struct switch (code) { case 0: *np = '\0'; - mbnambuf_write(nbp, name, (wep->weCnt & WIN_CNT) - 1); + if (mbnambuf_write(nbp, name, + (wep->weCnt & WIN_CNT) - 1) != 0) + return -1; return chksum; case '/': *np = '\0'; @@ -676,7 +678,9 @@ win2unixfn(struct mbnambuf *nbp, struct switch (code) { case 0: *np = '\0'; - mbnambuf_write(nbp, name, (wep->weCnt & WIN_CNT) - 1); + if (mbnambuf_write(nbp, name, + (wep->weCnt & WIN_CNT) - 1) != 0) + return -1; return chksum; case '/': *np = '\0'; @@ -694,7 +698,9 @@ win2unixfn(struct mbnambuf *nbp, struct switch (code) { case 0: *np = '\0'; - mbnambuf_write(nbp, name, (wep->weCnt & WIN_CNT) - 1); + if (mbnambuf_write(nbp, name, + (wep->weCnt & WIN_CNT) - 1) != 0) + return -1; return chksum; case '/': *np = '\0'; @@ -708,7 +714,8 @@ win2unixfn(struct mbnambuf *nbp, struct cp += 2; } *np = '\0'; - mbnambuf_write(nbp, name, (wep->weCnt & WIN_CNT) - 1); + if (mbnambuf_write(nbp, name, (wep->weCnt & WIN_CNT) - 1) != 0) + return -1; return chksum; } @@ -1005,7 +1012,7 @@ mbnambuf_init(struct mbnambuf *nbp) * This only penalizes portions of substrings that contain more than * WIN_CHARS bytes when they are first encountered. */ -void +int mbnambuf_write(struct mbnambuf *nbp, char *name, int id) { char *slot; @@ -1016,7 +1023,7 @@ mbnambuf_write(struct mbnambuf *nbp, cha printf("msdosfs: non-decreasing id: id %d, last id %d\n", id, nbp->nb_last_id); #endif - return; + return (EINVAL); } /* Will store this substring in a WIN_CHARS-aligned slot. */ @@ -1027,17 +1034,24 @@ mbnambuf_write(struct mbnambuf *nbp, cha #ifdef MSDOSFS_DEBUG printf("msdosfs: file name length %zu too large\n", newlen); #endif - return; + return (ENAMETOOLONG); } /* Shift suffix upwards by the amount length exceeds WIN_CHARS. */ - if (count > WIN_CHARS && nbp->nb_len != 0) + if (count > WIN_CHARS && nbp->nb_len != 0) { + if ((id * WIN_CHARS + count + nbp->nb_len) > + sizeof(nbp->nb_buf)) + return (ENAMETOOLONG); + bcopy(slot + WIN_CHARS, slot + count, nbp->nb_len); + } /* Copy in the substring to its slot and update length so far. */ bcopy(name, slot, count); nbp->nb_len = newlen; nbp->nb_last_id = id; + + return (0); } /* From owner-svn-src-head@freebsd.org Tue Apr 26 20:42:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F28BBB1DBB3; Tue, 26 Apr 2016 20:42:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f67.google.com (mail-oi0-f67.google.com [209.85.218.67]) (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 BFBE81CC1; Tue, 26 Apr 2016 20:42:28 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f67.google.com with SMTP id f63so3639854oig.0; Tue, 26 Apr 2016 13:42:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=FQzofyYzSjOT+aEOnfA1akLMxc0T0fIY64gVCgAP6LI=; b=ksUdWE462A0Ml9PtbkQgIt6YIf13Zkk9GbTtwd4pcTZWmqPfLXleI7JwMud9nbgTqp jkqsEOmgbsJmzp1RNdQH/tP8s10VUXRKeR87A++k88+ciTCuxaAAJCzbpxjwibC6JnrC Mt6n1+dxdCYrDRPRg+nPEWg3xum9HMqLxq8++ljjUPtmjLiFK4aH8GKE9EUH/UGDzs1p mQmG5jnYoUYMkdr6y3HvR0GFL7W+J8mcl578+XsAsb5Xk/S2KB3GK7Epd+Wiy6TnZ7Ez L9iQTjFca7VIgVWdw2ACDgHWgkszkwYQhTTwCGCme5sPBaOhzqFBo/u8exiAnniNjJpP TWHA== X-Gm-Message-State: AOPr4FUw4yThr7EFYP8xON9kZDJd0ef/wopx0ikli4tdl73t9XIHzjDe2A2hAcniTBnWBw== X-Received: by 10.202.85.2 with SMTP id j2mr1727956oib.6.1461703347643; Tue, 26 Apr 2016 13:42:27 -0700 (PDT) Received: from mail-ob0-f169.google.com (mail-ob0-f169.google.com. [209.85.214.169]) by smtp.gmail.com with ESMTPSA id fg6sm247602obc.9.2016.04.26.13.42.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 13:42:27 -0700 (PDT) Received: by mail-ob0-f169.google.com with SMTP id n10so11542602obb.2; Tue, 26 Apr 2016 13:42:27 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.226.139 with SMTP id rs11mr2047459oec.0.1461703347045; Tue, 26 Apr 2016 13:42:27 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 26 Apr 2016 13:42:26 -0700 (PDT) In-Reply-To: References: <201604261811.u3QIBjrE092471@repo.freebsd.org> Date: Tue, 26 Apr 2016 13:42:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298655 - head/sys/kgssapi From: Conrad Meyer To: Alan Somers 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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 20:42:29 -0000 I don't do stable, and that's my choice to make (and final decision). It would be appropriate to ask, "I'd like to MFC this to stable if it makes sense to do so. Does it make sense?" But I think it is totally inappropriate to try to tell me it is my job to push petty fixes to stable/10, a branch I do not use. You don't pay me to work on stable/10 and neither does anybody else. It's not my job. I do FreeBSD for fun. Conrad On Tue, Apr 26, 2016 at 1:24 PM, Alan Somers wrote: > You really ought to. When you MFC yourself, it reduces the likelihood of > errors, because you understand the change best. When someone else does it, > it's more likely he'll make a mistake, because he may not know the fine > details behind the change. In fact, it's hard for anybody else to even > know that a given change should or shouldn't be MFCed. The MFC reminder > emails only go to the committer, not to everyone. And when someone > unfamiliar with kgssapi looks at a commit message like the one below, he > doesn't know whether there's no MFC tag because the change isn't applicable > to stable/10, or because the committer forgot it, or because the committer > just "doesn't do stable". > > Please help maintain stable/10. It's everyone's job. > -Alan > > On Tue, Apr 26, 2016 at 1:23 PM, Conrad Meyer wrote: > >> Nope! I don't do stable/. >> >> On Tue, Apr 26, 2016 at 12:06 PM, Alan Somers >> wrote: >> >>> Nice catch. Will you be MFCing this to stable/10? >>> >>> On Tue, Apr 26, 2016 at 12:11 PM, Conrad E. Meyer >>> wrote: >>> >>>> Author: cem >>>> Date: Tue Apr 26 18:11:45 2016 >>>> New Revision: 298655 >>>> URL: https://svnweb.freebsd.org/changeset/base/298655 >>>> >>>> Log: >>>> kgssapi: Don't leak memory in error cases >>>> >>>> Reported by: Coverity >>>> CIDs: 1007046, 1007047, 1007048 >>>> Sponsored by: EMC / Isilon Storage Division >>>> >>>> Modified: >>>> head/sys/kgssapi/gssd_prot.c >>>> >>>> Modified: head/sys/kgssapi/gssd_prot.c >>>> >>>> ============================================================================== >>>> --- head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:08:51 2016 >>>> (r298654) >>>> +++ head/sys/kgssapi/gssd_prot.c Tue Apr 26 18:11:45 2016 >>>> (r298655) >>>> @@ -101,8 +101,10 @@ xdr_gss_OID(XDR *xdrs, gss_OID *oidp) >>>> } else { >>>> oid = mem_alloc(sizeof(gss_OID_desc)); >>>> memset(oid, 0, sizeof(*oid)); >>>> - if (!xdr_gss_OID_desc(xdrs, oid)) >>>> + if (!xdr_gss_OID_desc(xdrs, oid)) { >>>> + mem_free(oid, sizeof(gss_OID_desc)); >>>> return (FALSE); >>>> + } >>>> *oidp = oid; >>>> } >>>> break; >>>> @@ -164,8 +166,10 @@ xdr_gss_OID_set(XDR *xdrs, gss_OID_set * >>>> } else { >>>> set = mem_alloc(sizeof(gss_OID_set_desc)); >>>> memset(set, 0, sizeof(*set)); >>>> - if (!xdr_gss_OID_set_desc(xdrs, set)) >>>> + if (!xdr_gss_OID_set_desc(xdrs, set)) { >>>> + mem_free(set, sizeof(gss_OID_set_desc)); >>>> return (FALSE); >>>> + } >>>> *setp = set; >>>> } >>>> break; >>>> @@ -224,8 +228,10 @@ xdr_gss_channel_bindings_t(XDR *xdrs, gs >>>> || !xdr_gss_buffer_desc(xdrs, >>>> &ch->acceptor_address) >>>> || !xdr_gss_buffer_desc(xdrs, >>>> - &ch->application_data)) >>>> + &ch->application_data)) { >>>> + mem_free(ch, sizeof(*ch)); >>>> return (FALSE); >>>> + } >>>> *chp = ch; >>>> } >>>> break; >>>> >>>> >>> >> > From owner-svn-src-head@freebsd.org Tue Apr 26 20:45:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8573B1DC7B; Tue, 26 Apr 2016 20:45:02 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 624671E82; Tue, 26 Apr 2016 20:45:02 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id r12so7567012wme.0; Tue, 26 Apr 2016 13:45:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=hsrWpKWEmX1HX5mHTljyuJvwuu51rEqfg1itJI0eeos=; b=UOtTWeIqLutygjpCkWc3wZsFtHGYOF6yXcgwzMEBNhqSVcjvC7IN13jIq06ZXqelMH JR8x31FxUNVrMjT7jT7c28m37WzQU/uhZ536B9G/PsL+cyAAqNb/NmUa57CjAe+7RK7Y OgZYVK2HyyZYXUYHhquGkC+8rEnrsBKbx5k60iMmRiUJQtviUcDsa/C7fr12qeka6HOh GPE/Y60TuKvOUccMPLw2ete/T32ZwfTbldq+abWZUfTP8xusv8g1Kvh3yjcfY0dzKoKa hWQxdITYWZrs1uiwJN2lHN4xcouwaA15Wr2gnUWrd9QbEBDhMDD6naEfG7GOTTrVdyv8 sxoA== 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; bh=hsrWpKWEmX1HX5mHTljyuJvwuu51rEqfg1itJI0eeos=; b=aiJqO4horf1n5JtyYJCWcm+hufjbngOZLWZDp9a7gI52cqGc2T5ZMTIQpgetxEWhCX XeZnod3UAsqGUd0btc5H3MuDqd3vh+JXcH+Sy39eD0ZEcPQHZAeVZbJbWmBFjOJVe6D2 hTAPXcuqtZg0A3cJYOGHvlbuXQ3i5hbLghAKel5WyuILj98wkbiJpc3Fu0u0QlEZwXRi 1qslvw+mYblRXKc3ePMouXTHQSdUUmLsnv2YEUwIvKcLxRcsmDZ7SSn7twJjl0012olA L8Cn8iBk2TTYTi8aHj9nJ7zb8E5igUKcKnegYax4VO4ZdaTaMSe1c02fgdawkv7uKNEo QZlQ== X-Gm-Message-State: AOPr4FXNJ4MISdxdshdQ/cRPTXD/V7X7B7SKOMjxB0uyBBIiYWWtzNYGjB5lGc83SauiktiCJK3LxUDxQF/s6w== MIME-Version: 1.0 X-Received: by 10.28.171.8 with SMTP id u8mr5615739wme.97.1461703500706; Tue, 26 Apr 2016 13:45:00 -0700 (PDT) Received: by 10.194.43.231 with HTTP; Tue, 26 Apr 2016 13:45:00 -0700 (PDT) In-Reply-To: References: <201604251706.u3PH6okj031018@repo.freebsd.org> Date: Tue, 26 Apr 2016 13:45:00 -0700 Message-ID: Subject: Re: svn commit: r298585 - in head: sys/kern usr.sbin/jail From: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= To: cem@freebsd.org Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, NGie Cooper , src-committers@freebsd.org, Jamie Gritton Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 20:45:02 -0000 On Apr 26, 2016 11:44 AM, "Conrad Meyer" wrote: > > Right. False positive. Coverity doesn't grok sbuf memory management fully. > If someone can explain it to me in very simple words, I can update the model to make these go away ... maybe. From owner-svn-src-head@freebsd.org Tue Apr 26 20:50:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BA57B1DDDF; Tue, 26 Apr 2016 20:50:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ob0-f194.google.com (mail-ob0-f194.google.com [209.85.214.194]) (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 E488F133B; Tue, 26 Apr 2016 20:50:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ob0-f194.google.com with SMTP id tz8so1709723obc.1; Tue, 26 Apr 2016 13:50:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-transfer-encoding; bh=snunI3tmyyRvYroQ2EbcYs+kymFRZxrpUBEn1gBgvDU=; b=d+ci8xjy9bmxcaRFSFpEiNi7cOAGH/cvSzQ13PAjgXB4G7O8blDZv/0cxwEjnK+qYc V/4DC9+G+LloON3+HMyDGzvz9VdO8AqkuExwlfbmtzqRwVv89FtlufRNf3QWlL7gCbjX GV31kx54jkVe1/geQvOudx3uvz/Of7/Zad0ZuIq3jLB/4258le5I6Bc8L0IAVmC24fwP icjZEGocm3rVnPwrdLLvNAW/aGWcX2cVghCK1WrgRouWK/1C4GczSaJNUQSeFwHxXsNS MIjXheerY3kwTQmFnmua54mWc1+7KjxPH6QaWUZDdPUErTRqlf2YvZv/3/FwR8D735L6 75dg== X-Gm-Message-State: AOPr4FW5C0r+6Y3h9ScYGKu9lhvZqa9Gk/MZQLNddUPSRFAA4EHeECsYlaSI2onkOsvGJQ== X-Received: by 10.60.50.194 with SMTP id e2mr1912471oeo.57.1461703840428; Tue, 26 Apr 2016 13:50:40 -0700 (PDT) Received: from mail-oi0-f48.google.com (mail-oi0-f48.google.com. [209.85.218.48]) by smtp.gmail.com with ESMTPSA id c62sm257007oig.13.2016.04.26.13.50.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 13:50:40 -0700 (PDT) Received: by mail-oi0-f48.google.com with SMTP id r78so28617753oie.0; Tue, 26 Apr 2016 13:50:39 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.215.86 with SMTP id o83mr1755572oig.55.1461703839777; Tue, 26 Apr 2016 13:50:39 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 26 Apr 2016 13:50:39 -0700 (PDT) In-Reply-To: References: <201604251706.u3PH6okj031018@repo.freebsd.org> Date: Tue, 26 Apr 2016 13:50:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298585 - in head: sys/kern usr.sbin/jail From: Conrad Meyer To: =?UTF-8?Q?Ulrich_Sp=C3=B6rlein?= Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, NGie Cooper , src-committers@freebsd.org, Jamie Gritton Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 20:50:47 -0000 I'll borrow my explanation from the NTB review: There is the sbuf itself, and there is some buffer for data. Either can be on the stack or the heap independently. This is controlled with the DYNSTRUCT and DYNAMIC flags respectively. sbuf_new() just initializes an sbuf. Depending on the inputs passed in to it, it can allocate an sbuf on the heap (setting DYNSTRUCT) or not, and allocate a buffer on the heap (setting DYNAMIC) or not. Coverity is specifically complaining about freeing the sbuf memory itself=E2=80=94not the heap buffer. Since this sbuf was initialized as *not= * DYNSTRUCT, sbuf_delete will never free the sbuf memory itself. This is purely a false positive. So, any stack sbuf will pass a non-NULL pointer to sbuf-new, making it !DYNSTRUCT. sbuf_delete on this pointer is valid because it won't try to free a !DYNSTRUCT sbuf. Coverity warns about it because it doesn't understand the 1:1 relationship between stack sbufs and DYNSTRUCT. Best, Conrad On Tue, Apr 26, 2016 at 1:45 PM, Ulrich Sp=C3=B6rlein wrote: > On Apr 26, 2016 11:44 AM, "Conrad Meyer" wrote: >> >> Right. False positive. Coverity doesn't grok sbuf memory management >> fully. >> > > If someone can explain it to me in very simple words, I can update the mo= del > to make these go away ... maybe. From owner-svn-src-head@freebsd.org Tue Apr 26 20:59:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92410B1DFAC; Tue, 26 Apr 2016 20:59:22 +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 629D71A56; Tue, 26 Apr 2016 20:59:22 +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 u3QKxL1P045060; Tue, 26 Apr 2016 20:59:21 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QKxLDl045059; Tue, 26 Apr 2016 20:59:21 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262059.u3QKxLDl045059@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 20:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298665 - head/sys/dev/aacraid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 20:59:22 -0000 Author: cem Date: Tue Apr 26 20:59:21 2016 New Revision: 298665 URL: https://svnweb.freebsd.org/changeset/base/298665 Log: aacraid(4): Fix some mostly trivial buffer overruns strcpy(3) emits a trailing nul byte, trampling fields after the intended destination. Instead, use strncpy(3), intentionally leaving these fields not nul-terminated. Reported by: Coverity CIDs: 1031024, 1305463, 1305494, 1305545 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/aacraid/aacraid_cam.c Modified: head/sys/dev/aacraid/aacraid_cam.c ============================================================================== --- head/sys/dev/aacraid/aacraid_cam.c Tue Apr 26 20:36:32 2016 (r298664) +++ head/sys/dev/aacraid/aacraid_cam.c Tue Apr 26 20:59:21 2016 (r298665) @@ -568,9 +568,11 @@ aac_container_special_command(struct cam p->additional_length = 31; p->flags = SID_WBus16|SID_Sync|SID_CmdQue; /* OEM Vendor defines */ - strcpy(p->vendor,"Adaptec "); - strcpy(p->product,"Array "); - strcpy(p->revision,"V1.0"); + strncpy(p->vendor, "Adaptec ", sizeof(p->vendor)); + strncpy(p->product, "Array ", + sizeof(p->product)); + strncpy(p->revision, "V1.0", + sizeof(p->revision)); } } else { if (inq->page_code == SVPD_SUPPORTED_PAGE_LIST) { From owner-svn-src-head@freebsd.org Tue Apr 26 21:01:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0312DB1D09C for ; Tue, 26 Apr 2016 21:01:45 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x22a.google.com (mail-qk0-x22a.google.com [IPv6:2607:f8b0:400d:c09::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 AEF091DB5 for ; Tue, 26 Apr 2016 21:01:44 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x22a.google.com with SMTP id x7so10840344qkd.3 for ; Tue, 26 Apr 2016 14:01:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=oFMCP1ML/jf8VCb03DhjUHlgBfUszdkExSbCeL08lGA=; b=oZjQNFYfm1A6qPE1WTPD2F9RsWxDKVGm8AtCVeSQumKvPvknliKBIYlRTxMc5HPz+x rH1bceyTuwh5z/XdKxp3fkfxzrH6067Gyu9yHZVcfIZPR7ZBH6g8SIJJW+cfDf5eSCe9 aDzzL2FivWPgt+UMZIxpyCNOEsKe3d6fkUeVTgiLb7mmH2acaooscl1qrjIEaGSvg3re OB+Xl9Sh6c6NnZVJeHJjQUVFYHfVvFeAv4gd+pSqTyBUOwx48vhlzhU8WNXqPNAUDyeu BkYeFmvVsipIfFy7He239lqpiqwfbfhyAVPvsG1IyOamSFuBl+DKggQlvgBHwQbkVqfw xm1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=oFMCP1ML/jf8VCb03DhjUHlgBfUszdkExSbCeL08lGA=; b=BIp07Ik0Ky3QeObBu+MM3HhPcBj+PWevbCFrGlA/9rB1Nfxlvy1TPQHq3ZulwsueyL R7KwtZmiMcF75SZy3DRXvYEZA7MEjvl44JxwCDlIw/o48YZ5RsNgRU1SLpUCRwESLC+o GWh0DEmz4hMk3xDut0n9kNGNeL3GzJrNOWl1b4K/sxEUgAI6RgCBdlbF/+GZVIxQejhD clINt6u+2fvunJeQ+1f43uOE9gk9N2Hzu/CBQXye0OPhcprwQrDRRioOyBOQkXrKypOY Qi4R9eGTJfPtKLBzsjiuwoY3QoQ/BjaXsPD0uX68Ko2OrD1Rk05gN6El/RPrWXmQ40zD W+FA== X-Gm-Message-State: AOPr4FWs6MzSs+oH1SHJpwj7Cnkiu8vGHP71iwlRU+vz5PZx246rQJnmZ55xW9X/VDKMBvfp X-Received: by 10.55.148.130 with SMTP id w124mr4850640qkd.203.1461704503917; Tue, 26 Apr 2016 14:01:43 -0700 (PDT) Received: from mutt-hardenedbsd (c-73-135-80-144.hsd1.md.comcast.net. [73.135.80.144]) by smtp.gmail.com with ESMTPSA id 23sm157175qkd.8.2016.04.26.14.01.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 14:01:42 -0700 (PDT) Date: Tue, 26 Apr 2016 17:01:38 -0400 From: Shawn Webb To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs Message-ID: <20160426210138.GA13055@mutt-hardenedbsd> References: <201604262036.u3QKaWto038435@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="tKW2IUtsqtDRztdT" Content-Disposition: inline In-Reply-To: <201604262036.u3QKaWto038435@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:01:45 -0000 --tKW2IUtsqtDRztdT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2016 at 08:36:32PM +0000, Kristof Provost wrote: > Author: kp > Date: Tue Apr 26 20:36:32 2016 > New Revision: 298664 > URL: https://svnweb.freebsd.org/changeset/base/298664 >=20 > Log: > msdosfs: Prevent buffer overflow when expanding win95 names > =20 > In win2unixfn() we expand Windows 95 style long names. In some cases th= at > requires moving the data in the nbp->nb_buf buffer backwards to make ro= om. That > code failed to check for overflows, leading to a stack overflow in win2= unixfn(). > =20 > We now check for this event, and mark the entire conversion as failed i= n that > case. This means we present the 8 character, dos style, name instead. > =20 > PR: 204643 > Differential Revision: https://reviews.freebsd.org/D6015 Will this be MFC'd? Since it's triggerable as non-root, should this have a CVE? Though the commit log shows technical comments, it doesn't show related security information. Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --tKW2IUtsqtDRztdT Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXH9cwAAoJEGqEZY9SRW7u9DwQAItTkSX4RH+ZPSeJ3MRf2W6e 3HdWTrekLkBru7U9siDhS+U8NZSfS1R9ua44nHDZbqpUBna6x8lBqnxzwAZ6HLZ1 uSEvtuexSxlMPOjqUXurHdAF+ESeOCRmBu9GuCUhcuSeHWCcaot0ZmipKPDP3qfr K6yyDqPKyF6F1lhlRx0f9ql1EfeBNEeZvopv8zi+iUqdyym1TbCp8w8T+sFebRUq J2y9xzjp4YrHVNoRvDsK2j4HTdg4zvhQaT/DBtj8Qt3kSfpPnNVJWV5D5+M58pGQ rts3htnxVKRiZYYJaSAauBm50qt+HHqkbsFKGTjfWXRLIrvwtoqdXxHGEL2hzOx5 +0rPf8icQtz6yGTjv4Q9YHku/Ga0Ki5C/BaMI1ov/WkUG1h/pF4XI67uTFuGoo9N 9oI+91UMFgDjBcgeTvOmM1OZJdALtxZmBnev6RIYIfyTzT7JhkjXQchiup+R/HXK hWoeNACSwFa5Tod4NTHwdq+XpdZNgletu7BGfvd8ysEgBK1ev4NpQv23QATLd+pG 22INiBRsIyT0aT4+I7t2gsRp2jtDc+FXxql/RLRg2iw493OBTUlyhrgicQGF9mtd ViEC8WyAbkWS5CMWNWA0jdmrXi5F2Fw+gX8npEW/d9lRRkipXbQvyAgoxxc3tZ46 J25FTASTZiiHkSiA+OA1 =cq7Y -----END PGP SIGNATURE----- --tKW2IUtsqtDRztdT-- From owner-svn-src-head@freebsd.org Tue Apr 26 21:05:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66F95B1D236; Tue, 26 Apr 2016 21:05:49 +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 1351A1020; Tue, 26 Apr 2016 21:05:49 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2a02:1811:2419:4e02:8d7d:588c:ce11:391d] (unknown [IPv6:2a02:1811:2419:4e02:8d7d:588c:ce11:391d]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 79F6A20DD3; Tue, 26 Apr 2016 23:05:45 +0200 (CEST) Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_EED010A7-EECE-42D6-8960-656834DE794B"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: <20160426210138.GA13055@mutt-hardenedbsd> Date: Tue, 26 Apr 2016 23:05:38 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> To: Shawn Webb X-Mailer: Apple Mail (2.3124) X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:05:49 -0000 --Apple-Mail=_EED010A7-EECE-42D6-8960-656834DE794B Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 26 Apr 2016, at 23:01, Shawn Webb = wrote: >=20 > On Tue, Apr 26, 2016 at 08:36:32PM +0000, Kristof Provost wrote: >> Author: kp >> Date: Tue Apr 26 20:36:32 2016 >> New Revision: 298664 >> URL: https://svnweb.freebsd.org/changeset/base/298664 >>=20 >> Log: >> msdosfs: Prevent buffer overflow when expanding win95 names >>=20 >> In win2unixfn() we expand Windows 95 style long names. In some cases = that >> requires moving the data in the nbp->nb_buf buffer backwards to make = room. That >> code failed to check for overflows, leading to a stack overflow in = win2unixfn(). >>=20 >> We now check for this event, and mark the entire conversion as = failed in that >> case. This means we present the 8 character, dos style, name = instead. >>=20 >> PR: 204643 >> Differential Revision: https://reviews.freebsd.org/D6015 >=20 > Will this be MFC'd? Since it's triggerable as non-root, should this = have > a CVE? Though the commit log shows technical comments, it doesn't show > related security information. Yes, I=E2=80=99ll put MFCing this on my todo list. I have to admit that I=E2=80=99ve not given the security implications = much thought. The bug has always been caught by the stack canary on my = test systems, without that it could potentially be quite dangerous. (Given constraints of having to be able to mount arbitrary file systems = as non-root of course.) Regards, Kristof --Apple-Mail=_EED010A7-EECE-42D6-8960-656834DE794B Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXH9goAAoJEG/E3HH7XkpG+voIAIGwautrT/grlDNfJtfFT9e5 iXH2ct42dM52pRKHO2oF8lpgcuvbYWrrGJ6IkEwi1QchfSSFrEhTONRIWagPRLSD pZyU/n515ez9jyxaetSQyr59tOd4Tx9SmOTrNvWtF2xlZBYQKXcqZoeHVtvqw5p7 /1yyrE/Sbs/IXErNpDvjbx0vJRVWvelLhhrOIzCoF65/Gu0hj/BPKMJL9xvc/oPr i92L7ZRXG+tNYIqMOUowNXYjC0OdPmyVURxh8TVcSNtl7LLdohw9iaAMGFDkldfI zN+R8UnWb691wx89XI8KB9FZbqqI12MK7HrzLnTpUjs1T3bZJhALHq2ZP+M/Y0g= =Ffbo -----END PGP SIGNATURE----- --Apple-Mail=_EED010A7-EECE-42D6-8960-656834DE794B-- From owner-svn-src-head@freebsd.org Tue Apr 26 21:09:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18C64B1D2EB; Tue, 26 Apr 2016 21:09:27 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) (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 DE12612B0; Tue, 26 Apr 2016 21:09:26 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f65.google.com with SMTP id r186so3727795oie.2; Tue, 26 Apr 2016 14:09:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=wl18meuj5OP4p7cWZdw2xtFU0fFWaL/9O+T2/hh8Dy4=; b=k36rgwpep1B3WJrjDVzMZBRFXoBgtr5SRx/31wbtHJ/iKeMIQpKrK2c5MUGvtQJy8y f63dpef1iUOdlUQ0h0tgqpUNXEijNRAVOnZwtmJLuNjntxcyEq2trM51LbBy/Wny+jEz fU+XbsN3EzUMhNYen070+oqNEJGImatNq6RrMBUjfE1VHlYdMGNoAk2sF8aqnw5qMM7E qAo/IVK0uivU8pJhKOoJWCIT4+gG76NN2AdI+Mx6bX/QSZdYDagZ5WmNVew7X8xwoj/5 MtVVVXtTLfZEbC9YAUtiCc6XbuxN1irbhTggdUl3FpGCK1OB7hIcG1lGeOD1gMvUmiNm Tegw== X-Gm-Message-State: AOPr4FV/yLcUWFi4DAZL9HXBbQpUf+158p58LvrHac8GdgO/bVMh5Xh8/PFR2Xwvgb+nhg== X-Received: by 10.157.46.82 with SMTP id c18mr1820641otd.24.1461704959839; Tue, 26 Apr 2016 14:09:19 -0700 (PDT) Received: from mail-ob0-f172.google.com (mail-ob0-f172.google.com. [209.85.214.172]) by smtp.gmail.com with ESMTPSA id li8sm266281obb.27.2016.04.26.14.09.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 14:09:19 -0700 (PDT) Received: by mail-ob0-f172.google.com with SMTP id j9so13285453obd.3; Tue, 26 Apr 2016 14:09:19 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.226.139 with SMTP id rs11mr2098378oec.0.1461704959171; Tue, 26 Apr 2016 14:09:19 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 26 Apr 2016 14:09:19 -0700 (PDT) In-Reply-To: <20160426210138.GA13055@mutt-hardenedbsd> References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> Date: Tue, 26 Apr 2016 14:09:19 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs From: Conrad Meyer To: Shawn Webb Cc: Kristof Provost , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:09:27 -0000 On Tue, Apr 26, 2016 at 2:01 PM, Shawn Webb wrote: > On Tue, Apr 26, 2016 at 08:36:32PM +0000, Kristof Provost wrote: >> Author: kp >> Date: Tue Apr 26 20:36:32 2016 >> New Revision: 298664 >> URL: https://svnweb.freebsd.org/changeset/base/298664 >> >> Log: >> msdosfs: Prevent buffer overflow when expanding win95 names >> >> ... > > Will this be MFC'd? Since it's triggerable as non-root, should this have > a CVE? Though the commit log shows technical comments, it doesn't show > related security information. Is it triggerable as non-root? Don't you need to write a malicious filesystem image and persuade FreeBSD to mount it? Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 26 21:11:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EB99B1D43D; Tue, 26 Apr 2016 21:11:03 +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 F3C2414F4; Tue, 26 Apr 2016 21:11:02 +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 u3QLB2PJ048812; Tue, 26 Apr 2016 21:11:02 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QLB2Sw048811; Tue, 26 Apr 2016 21:11:02 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604262111.u3QLB2Sw048811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 26 Apr 2016 21:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298666 - head/sys/modules/dtb/zynq X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:11:03 -0000 Author: gonzo Date: Tue Apr 26 21:11:01 2016 New Revision: 298666 URL: https://svnweb.freebsd.org/changeset/base/298666 Log: Add dtb/zynq to generate dtb files for Zynq-based boards It seems that the only way to supply dtb to loader on Zynq-based SoCs is to manually generate dtb and place it to pre-defined location on SD card or TFTP server where loader can pick it up. More modern approach is to add modules/dtb/%soc% module and let installworld target generate dtb and copy them to /boot/dtb/ where they can be loaded by ubldr Added: head/sys/modules/dtb/zynq/ head/sys/modules/dtb/zynq/Makefile (contents, props changed) Added: head/sys/modules/dtb/zynq/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/dtb/zynq/Makefile Tue Apr 26 21:11:01 2016 (r298666) @@ -0,0 +1,7 @@ +# $FreeBSD$ +# All the dts files for Zynq systems we support. +DTS= \ + zedboard.dts \ + zybo.dts + +.include From owner-svn-src-head@freebsd.org Tue Apr 26 21:11:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88232B1D497; Tue, 26 Apr 2016 21:11:53 +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 5578918E4; Tue, 26 Apr 2016 21:11:53 +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 u3QLBqFT050844; Tue, 26 Apr 2016 21:11:52 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QLBqv4050843; Tue, 26 Apr 2016 21:11:52 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604262111.u3QLBqv4050843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 26 Apr 2016 21:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298667 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:11:53 -0000 Author: gonzo Date: Tue Apr 26 21:11:52 2016 New Revision: 298667 URL: https://svnweb.freebsd.org/changeset/base/298667 Log: Add dtb/zynq to the list of extra modules required by Zedboard Modified: head/sys/arm/conf/ZEDBOARD Modified: head/sys/arm/conf/ZEDBOARD ============================================================================== --- head/sys/arm/conf/ZEDBOARD Tue Apr 26 21:11:01 2016 (r298666) +++ head/sys/arm/conf/ZEDBOARD Tue Apr 26 21:11:52 2016 (r298667) @@ -24,6 +24,8 @@ ident ZEDBOARD include "std.armv6" include "../xilinx/std.zynq7" +makeoptions MODULES_EXTRA="dtb/zynq" + options SCHED_ULE # ULE scheduler #options NFSSD # Network Filesystem Server options SMP # Enable multiple cores From owner-svn-src-head@freebsd.org Tue Apr 26 21:13:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC855B1D51E; Tue, 26 Apr 2016 21:13:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22d.google.com (mail-ig0-x22d.google.com [IPv6:2607:f8b0:4001:c05::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 778CD1AF9; Tue, 26 Apr 2016 21:13:06 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22d.google.com with SMTP id g8so27885818igr.0; Tue, 26 Apr 2016 14:13:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=v0louhwtSPnnJndNYT2gnDQmeM2c9JRtIRDpQSRQRbM=; b=dmvX7vvDEMJRIQLE66BH3bF9ORTT3AwQ+Qgy+x4eTqmKhQvIi3gJBSs0MewVMY8qRN ATo9oS/GghnyjvyqkDGcfEnnZoXYifqHLeuQ5TD//yPlXN36kuo2aFxpfwoEkHbN8uzL gm+w7ikvlFTBYP0F3qp7KuOOp6ZLvuQVfolNmPgYoy7R0wHnPLvP8T2gHxblxYnBkaBM 72dJh9pi1GxST6RUhkJ3GgWcCPiysI9g0XDqKZh2TLysVPWS1qlda2Cmwt4c8nBnWeN/ xqS5zm1oZZI2VV8xEpijm5+4gcZtpPPhflkqTbplAoDcrXCqZJPWVXwK22iAdNBvtCLm 0FBg== 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; bh=v0louhwtSPnnJndNYT2gnDQmeM2c9JRtIRDpQSRQRbM=; b=hGVogpI4288RKw6A8OuOYPAi4FF9M4pUFRm1QF4et5WZcsecM3L6E3Vf4KcYkRegZR akFoGGHthJbB43tR3LrbGeODuufZk8jhRkBQreiYzAoyF7fJ5ckG3kjBHzpKAW+ze3H2 3/DmUzG50gXl1udkkarmuS5DYb9tX/W7tLle8pirTpbwrwhaQ4X+cTNo669mhTWO33da G5Y35GYb/gEweBcWpxbRC2q92yIHy/s8Ac7SkHWMFwkLP4jOT/vA+t2Uzz3eRtdq6uaB SAaF0XvPYDhMr7xpeUq72Nznj/cYpfPLS7mG+164Ubl/TgYwdT26nuwGW34SuCK0320N Bhag== X-Gm-Message-State: AOPr4FUBd582Yw7RL8tnLtHExpsV/1x49OyPnMYr/JGg6VikasoELE48ULWwdHcI3767C61yk5EZSMs7W88Ftw== MIME-Version: 1.0 X-Received: by 10.50.57.199 with SMTP id k7mr6099392igq.61.1461705185929; Tue, 26 Apr 2016 14:13:05 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Tue, 26 Apr 2016 14:13:05 -0700 (PDT) In-Reply-To: References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> Date: Tue, 26 Apr 2016 14:13:05 -0700 Message-ID: Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs From: Adrian Chadd To: cem@freebsd.org Cc: Shawn Webb , Kristof Provost , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:13:06 -0000 You mean "hotplug mount a malicious USB disk via some installed graphical enviornment?" NOone does that... :) -a From owner-svn-src-head@freebsd.org Tue Apr 26 21:17:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91625B1D737; Tue, 26 Apr 2016 21:17:33 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) (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 4C06A1119; Tue, 26 Apr 2016 21:17:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f65.google.com with SMTP id f63so3753013oig.0; Tue, 26 Apr 2016 14:17:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=gIc7bilYO/w0gg0Fj9FCuaKuYqUh7mAv+quEWJXgN+8=; b=UqoUU6Qqy/Dp0PfvYa+v8ESVAMXKq546wExmW6TxDQV4aRjY7+6vaqaj0BF1wnzZ0R 9Q/hjKB6SvHWnct32VGOELkJ+VZMp47jzHGkoywllnd/184N0ogTe21a08xqYZGbUeG4 sItxfKvvLecjov0Du4l4pXl425i13zPfNnHuKApCY+afAYRrSJnntSiTAviXt+12/z2t 88Nhc2dnrkaOKgLkD3ir/Wx6nL89Pqz+yWwoB53IeNoemjK5u0GdVsmULUyc0AdAEeHS 9sCVUInR2gRt5KEugCWCrZkkCXumc2ObItpCTTKF4eIW02mM6l+4x9k4axhjEEM19k5O 9xag== X-Gm-Message-State: AOPr4FV4rEwR92A3vHYyr8wJWf4ZHNBbJ9RaMHGGaBPo7hGtkqk31CQa4hR+Pj7oIKgCiQ== X-Received: by 10.157.9.147 with SMTP id q19mr2117721otd.52.1461705452001; Tue, 26 Apr 2016 14:17:32 -0700 (PDT) Received: from mail-oi0-f43.google.com (mail-oi0-f43.google.com. [209.85.218.43]) by smtp.gmail.com with ESMTPSA id zi6sm293728oeb.11.2016.04.26.14.17.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 14:17:31 -0700 (PDT) Received: by mail-oi0-f43.google.com with SMTP id x19so29203977oix.2; Tue, 26 Apr 2016 14:17:31 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.215.86 with SMTP id o83mr1800381oig.55.1461705451429; Tue, 26 Apr 2016 14:17:31 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 26 Apr 2016 14:17:31 -0700 (PDT) In-Reply-To: References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> Date: Tue, 26 Apr 2016 14:17:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs From: Conrad Meyer To: Adrian Chadd Cc: Shawn Webb , Kristof Provost , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:17:33 -0000 On Tue, Apr 26, 2016 at 2:13 PM, Adrian Chadd wrote: > You mean "hotplug mount a malicious USB disk via some installed > graphical enviornment?" > > NOone does that... :) Sure, but there the vulnerability is (IMO) that users are allowed to arbitrarily mount stuff. That's a huge attack surface and this fix only scratches the surface. We do need to make filesystems more resilient to malice. AFL? Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 26 21:18:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D8B8B1D793 for ; Tue, 26 Apr 2016 21:18:08 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::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 43BD5134A for ; Tue, 26 Apr 2016 21:18:08 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qg0-x229.google.com with SMTP id c6so11494153qga.1 for ; Tue, 26 Apr 2016 14:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dHMVDB0lGQlWU88ZLRDqdqwlL7VP1hfR2fMr+ABeOZw=; b=WMz9kK0/+Bpn+UReXcFBj8+JrlUwDEH2/hJJlFSgUDH1qOhQQkDLLIa7F+XGP+cpEp 3BwoyERXs3r9KJmQrh3q/1wpt0JBZunbI64xoV2LSTrzeFRJ3Gt0mugtymwFvGMqdPzQ XX9MuZ3HZjC0cSBVkrQaTUZ0hhYQi3iGCi/tzwTBrMyW+4LBMmNkfmdN5pPQlge8lyzo rjg5ykizbxTT3vqN8MYF4j5H7WTWSeKx2Y12FFopltL4omvNhZrqS3eTDrdp3OMqpUDj oROkOncpafejeG+ouTG7VafSFIoWL897lvWwNfyn3lo3HtttDwTm1HsC1IIvv+GxggH/ qrMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dHMVDB0lGQlWU88ZLRDqdqwlL7VP1hfR2fMr+ABeOZw=; b=P5vayghqk6f9oJZdxw9qWfzRKfoJpN5TTT3pJB/ZkULRTLfNmNc0MhtFrIqlECAt5n y1f35fqB8ANU90x/vK678eZHXfnovTt9agdasHFuyIoRA0OWoWuzScJsu2RLhGPM2n/J os4kV4strw8bPMvHwsOEArG22ONCuVrbn3bd41iUgHR1PgUe44mRw6sdg8DMw1PgQDfB Rq/c8yZHDMraeURqNFkF5C+kAHCp53CZDYRBbSZCWgLZ5nfeno1oBNhPitaCs0dJtweq CQNSHEnkm77UoWqIvBEHHcIa31HyD+CD2JXyTgl/fI5YPmBZyVUKFCEW5Z/6L21JQ3GD 2bkw== X-Gm-Message-State: AOPr4FVrEpzaVOpm2UultWTZ+mgkjZYc4u9VPyZusxe3NdLyyqax2GqOfVeYcIrMJVTEde62 X-Received: by 10.140.199.8 with SMTP id u8mr4799449qha.5.1461705487402; Tue, 26 Apr 2016 14:18:07 -0700 (PDT) Received: from mutt-hardenedbsd (c-73-135-80-144.hsd1.md.comcast.net. [73.135.80.144]) by smtp.gmail.com with ESMTPSA id f19sm206053qge.16.2016.04.26.14.18.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 14:18:06 -0700 (PDT) Date: Tue, 26 Apr 2016 17:18:04 -0400 From: Shawn Webb To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs Message-ID: <20160426211804.GB13055@mutt-hardenedbsd> References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jq0ap7NbKX2Kqbes" Content-Disposition: inline In-Reply-To: <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:18:08 -0000 --jq0ap7NbKX2Kqbes Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2016 at 11:05:38PM +0200, Kristof Provost wrote: >=20 > > On 26 Apr 2016, at 23:01, Shawn Webb wrote: > >=20 > > On Tue, Apr 26, 2016 at 08:36:32PM +0000, Kristof Provost wrote: > >> Author: kp > >> Date: Tue Apr 26 20:36:32 2016 > >> New Revision: 298664 > >> URL: https://svnweb.freebsd.org/changeset/base/298664 > >>=20 > >> Log: > >> msdosfs: Prevent buffer overflow when expanding win95 names > >>=20 > >> In win2unixfn() we expand Windows 95 style long names. In some cases = that > >> requires moving the data in the nbp->nb_buf buffer backwards to make = room. That > >> code failed to check for overflows, leading to a stack overflow in wi= n2unixfn(). > >>=20 > >> We now check for this event, and mark the entire conversion as failed= in that > >> case. This means we present the 8 character, dos style, name instead. > >>=20 > >> PR: 204643 > >> Differential Revision: https://reviews.freebsd.org/D6015 > >=20 > > Will this be MFC'd? Since it's triggerable as non-root, should this have > > a CVE? Though the commit log shows technical comments, it doesn't show > > related security information. >=20 > Yes, I???ll put MFCing this on my todo list. >=20 > I have to admit that I???ve not given the security implications much thou= ght. The bug has always been caught by the stack canary on my test systems,= without that it could potentially be quite dangerous. > (Given constraints of having to be able to mount arbitrary file systems a= s non-root of course.) >=20 > Regards, > Kristof Was secteam@ even involved, then? Seems like a user-facing kernel buffer overflow ought to have involved secteam@. Also, the differential revision link you posted is incorrect. Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --jq0ap7NbKX2Kqbes Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXH9sKAAoJEGqEZY9SRW7udGIP/0Z1hLdz4aZtSuYVGckBWSO8 g+sRUt3DV37xHWnQelFwxSE3xD4umDP9aGvO4PVkTmsVIdeRb9In7NZqawXrEV7U JZM/0r7r71zstnZnek45tyYUqwQammgcshDuOb2r0PdIRb/Id7cb+QAssqC+qVql amVaj/uLCkkIbbIUqYm4jVpuG1SsZYJvzHHngI8p9kpKMbHW5wY8Bg0/4k4PIefB 8KTYypJ8r+HMFYSsYL30u4YVasmF+xyg42Z5qR1vExFtwzrdiRhpG0bkFgXPy/hs LQ+8uH2KNKeRrcAjQBkVA9QeDoVMoblwVN8W7bXRGl0yyxxVsF6PV6u1vP7vF/Oz HLPje8o/RvuCLzAajyMqfTnDqDRceS7NDiPLMr0Fum/kA8wMRXFzpgNlHOtEEAnQ vUJRc/EjmwtRW+87lsfcrn6aP3XZr9LJFHB3LnWWtkytDC3quQUG87qud9FxWQcR SdHNq5radp9x/xtU4j3jJT1MEc7h5ru9jw46OPtAqyppn3R0HmdC03jkI1AIImpS Qs5S6I0HLB1Gkhs+IeXn1zWfypBLBBv4wCf7R6qXJcg38J6OqchSifni2txrifh0 Dw8oGNwyig2g7Rv4Dm27gtGRSVx6x78ckVhipaqq63NVU42k4qyGP6UMEdmqih8C yi5EWIJdj4hvVVWkaLzA =N5v9 -----END PGP SIGNATURE----- --jq0ap7NbKX2Kqbes-- From owner-svn-src-head@freebsd.org Tue Apr 26 21:19:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9129B1D81A; Tue, 26 Apr 2016 21:19:13 +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 9A66E1648; Tue, 26 Apr 2016 21:19:13 +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 u3QLJC8q052099; Tue, 26 Apr 2016 21:19:12 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QLJCUN052098; Tue, 26 Apr 2016 21:19:12 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604262119.u3QLJCUN052098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Tue, 26 Apr 2016 21:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298668 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:19:13 -0000 Author: jamie Date: Tue Apr 26 21:19:12 2016 New Revision: 298668 URL: https://svnweb.freebsd.org/changeset/base/298668 Log: Use crcopysafe in jail_attach. Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Tue Apr 26 21:11:52 2016 (r298667) +++ head/sys/kern/kern_jail.c Tue Apr 26 21:19:12 2016 (r298668) @@ -2405,7 +2405,6 @@ sys_jail_attach(struct thread *td, struc static int do_jail_attach(struct thread *td, struct prison *pr) { - struct prison *ppr; struct proc *p; struct ucred *newcred, *oldcred; int error; @@ -2433,7 +2432,6 @@ do_jail_attach(struct thread *td, struct /* * Reparent the newly attached process to this jail. */ - ppr = td->td_ucred->cr_prison; p = td->td_proc; error = cpuset_setproc_update_set(p, pr->pr_cpuset); if (error) @@ -2452,23 +2450,23 @@ do_jail_attach(struct thread *td, struct newcred = crget(); PROC_LOCK(p); - oldcred = p->p_ucred; - setsugid(p); - crcopy(newcred, oldcred); + oldcred = crcopysafe(p, newcred); newcred->cr_prison = pr; proc_set_cred(p, newcred); + setsugid(p); PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); #endif + prison_deref(oldcred->cr_prison, PD_DEREF | PD_DEUREF); crfree(oldcred); - prison_deref(ppr, PD_DEREF | PD_DEUREF); return (0); + e_unlock: VOP_UNLOCK(pr->pr_root, 0); e_revert_osd: /* Tell modules this thread is still in its old jail after all. */ - (void)osd_jail_call(ppr, PR_METHOD_ATTACH, td); + (void)osd_jail_call(td->td_ucred->cr_prison, PR_METHOD_ATTACH, td); prison_deref(pr, PD_DEREF | PD_DEUREF); return (error); } From owner-svn-src-head@freebsd.org Tue Apr 26 21:22:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6D6DB1DA26; Tue, 26 Apr 2016 21:22:39 +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 6AC751CAB; Tue, 26 Apr 2016 21:22:39 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2a02:1811:2419:4e02:8d7d:588c:ce11:391d] (unknown [IPv6:2a02:1811:2419:4e02:8d7d:588c:ce11:391d]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 458B420EEC; Tue, 26 Apr 2016 23:22:37 +0200 (CEST) Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_6B8454BC-EB5A-492E-90A8-68865752FE4F"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: <20160426211804.GB13055@mutt-hardenedbsd> Date: Tue, 26 Apr 2016 23:22:32 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <116F3C09-CD22-42EC-80BF-4EAD6CA1C824@FreeBSD.org> References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> <20160426211804.GB13055@mutt-hardenedbsd> To: Shawn Webb X-Mailer: Apple Mail (2.3124) X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:22:39 -0000 --Apple-Mail=_6B8454BC-EB5A-492E-90A8-68865752FE4F Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 26 Apr 2016, at 23:18, Shawn Webb = wrote: > Was secteam@ even involved, then? Seems like a user-facing kernel = buffer > overflow ought to have involved secteam@. >=20 No, it wasn=E2=80=99t. This bug had been open for quite a while, and I = just happend to see the report and look at it. > Also, the differential revision link you posted is incorrect. You=E2=80=99re right, copy/paste from the wrong phab e-mail. https://reviews.freebsd.org/D5977 is = the right one. Regards, Kristof --Apple-Mail=_6B8454BC-EB5A-492E-90A8-68865752FE4F Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXH9wcAAoJEG/E3HH7XkpGuRsH/0wQbLKzkYRB5BppGZwRrj/2 0w2Hitf40QnHB/g76+02NZpUltdfS4pYQb28RH2GCTtYOvQcfaYGeNJzBktj9QLs RFV5FmREzEAb0k2Ie7WvjXQxI1noPeDxSm63Ec/fjXsfPL2eYkEDzxliXecFmwsx cAK0hPSzGFS9vrDhzcHuYhmFJxEzFdwwU3pGyuDqupQnoYytDK2C98tXIwkH5aVl GRKgypcC1eaNwusn8HtYOfauEOWf5VhuOu/y1/VentTLRUQ1VViRyWUJKm+FMpfh f5Vw961nhEpiY47QrvqHHvHGBqJc4mNqhzNm1BdzBQOoEQCge7h+70Avw+3cs3c= =fxFm -----END PGP SIGNATURE----- --Apple-Mail=_6B8454BC-EB5A-492E-90A8-68865752FE4F-- From owner-svn-src-head@freebsd.org Tue Apr 26 21:26:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47D6EB1DAE0 for ; Tue, 26 Apr 2016 21:26:52 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-x231.google.com (mail-qg0-x231.google.com [IPv6:2607:f8b0:400d:c04::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 01A3F1EA8 for ; Tue, 26 Apr 2016 21:26:52 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qg0-x231.google.com with SMTP id c6so11586437qga.1 for ; Tue, 26 Apr 2016 14:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gXbDyNBTRJkZCJ0mSr58Xv7q42BXd+GeayZQRj/MOxU=; b=I9C86fzFypXb9aZu2oGYyY4dtsftC0zxrE4ftbZ3TsQow54j8Cwc2p0CoN0Gl6zha1 Rj6OTSlGCpbhSsQSd4+hvHUNsGAQOtk4/CU2B8r2k1IiaOwlSGd0txgSkBIZRJleaF6z wSN2p86+3e2mQgIYJ1KwzZbE6jwgbsJwgTlOku/VcHAytQ0q87Qkl7y3ynWjXVR5mkvD /tNtg7Tb2/qjdTLodJkuguSM6DOgDx/HCPQz6gtBHPW8mprDOjbjLFgS3eJVk2c84ST4 1xRgzh6yW5mnlh28wVGPVJOOfbqyBms5oMZJTYktNoJwh4K2uz/6X7d5UjGwzaMtlJGo /cYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=gXbDyNBTRJkZCJ0mSr58Xv7q42BXd+GeayZQRj/MOxU=; b=cPoNMYYM1x2FRM9UlztKgO330yo88m1rnOC76SFJcjT1A8L0ywElHg07CK1wEssbK1 RJ77Oa3kpSiZBVGiHni7Qy8v48Yd6sZwKknoG9/RC0iVC3KPx/mZ66iT2qlaojyoy346 ibTfPkvmDnFKRNTmyfmrvDfl/9SRtkvK31dxQlvOl3MvPh73lAQSOvnfHkU1O0opxFJw AcOKzz3AdrapkJXCwyhp+3g0Td3ajp3uvnYA2VxQgDUlRj9GOLRHYHrWwtu9yP58GvCX NGA/DNRfXyeZP7FZnPDbztboqcUJ0Tu07H/qm96jdBOL55KBYzrOQibKZL2UF6Y9RqoL +NLQ== X-Gm-Message-State: AOPr4FUkV+GlB/Uoo9Pm7DX5bmZpaIKUtOFTCXfqKCbYa5X7Ra3MZt66t7FMG4ZgYbLBy9IZ X-Received: by 10.140.101.137 with SMTP id u9mr4599367qge.92.1461706011127; Tue, 26 Apr 2016 14:26:51 -0700 (PDT) Received: from mutt-hardenedbsd (c-73-135-80-144.hsd1.md.comcast.net. [73.135.80.144]) by smtp.gmail.com with ESMTPSA id r18sm218435qhb.35.2016.04.26.14.26.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 14:26:50 -0700 (PDT) Date: Tue, 26 Apr 2016 17:26:48 -0400 From: Shawn Webb To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, secteam@freebsd.org Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs Message-ID: <20160426212648.GC13055@mutt-hardenedbsd> References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> <20160426211804.GB13055@mutt-hardenedbsd> <116F3C09-CD22-42EC-80BF-4EAD6CA1C824@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="7qSK/uQB79J36Y4o" Content-Disposition: inline In-Reply-To: <116F3C09-CD22-42EC-80BF-4EAD6CA1C824@FreeBSD.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:26:52 -0000 --7qSK/uQB79J36Y4o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2016 at 11:22:32PM +0200, Kristof Provost wrote: >=20 > > On 26 Apr 2016, at 23:18, Shawn Webb wrote: > > Was secteam@ even involved, then? Seems like a user-facing kernel buffer > > overflow ought to have involved secteam@. > >=20 > No, it wasn???t. This bug had been open for quite a while, and I just hap= pend to see the report and look at it. Now CC'ing secteam@. I'm wondering if a CVE should be filed. Or, at the very least, a FreeBSD Security Advisory. Thanks, --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --7qSK/uQB79J36Y4o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXH90XAAoJEGqEZY9SRW7ufiMP/j/hEb6/bnYByK7pnh6cPACm SWlGU3lpkpEAmwL6YNVmv2b/USi+PbVYAD/fFvM7pdlETzB5QA9JpQsIQ0Vzrsbd xgxTVjJs6pQe9A1mgHmi7HcFs3hB2atXapzEbbl4IvSkQB9pw9bFo/YaruM07wOB GoflLRuFRvTKzZu+tSTf6bMjC4+BjtKiJRzC4r/EmzsD8WWy2febFr+Km3hfLcL2 nYjj0g5tmUY3J2AEGkbA32oBBU5x/rLouG6+9Mnox4359i6dNo9maXw2ph5LG8Jj cuD9By9mbBB4wn9/cYDTlYK8JzUt6gXPjL8PiXLbyX/le1aYzTboHQe5r0iS16q3 Mi8+VKtowyr/tOCq/n2X8mwBOcQzdp6w35e50vAW5fttKREZvvz9kB+dUdrWkvBy 8jPjIjTc60dErQVIyeDdVbAUi2WljnjYd/deDKIXCC6Z9G8Ftdsz0y+5UQRlHQs1 LghQfO5kolfMevZ/svNed14xVF1BY9DPstiNMrtunbC6hjikx8DP+9lPgPGKNJ5I vTLVdghvkltjHUOfUaeyCCZO84RDpki8rG+TCSrgN5jbP4MF7f8szPoiSWIKoeBT UrjSXGRgd2Ev0hkRh1lN1bTKoKq8Ygb+sptRNCzwBi7L2kYJGPqaTHXgQ+KU4uK2 VwEGOvpJBjEZ6sw8wKJu =KA2d -----END PGP SIGNATURE----- --7qSK/uQB79J36Y4o-- From owner-svn-src-head@freebsd.org Tue Apr 26 21:34:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39CEEB1DD5B; Tue, 26 Apr 2016 21:34:23 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x236.google.com (mail-lf0-x236.google.com [IPv6:2a00:1450:4010:c07::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 BBF651713; Tue, 26 Apr 2016 21:34:22 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lf0-x236.google.com with SMTP id c126so34457254lfb.2; Tue, 26 Apr 2016 14:34:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=XCXEzP1cQZ3tvtF8hxRAq5S7YwmGyYLKnzNVmaIKIio=; b=Vo8d9uJc1baH0v4SRB8xoDSma6Yzubr2zItvTR0a16O549y1YiZeFaKDVqmLGppVi2 NdJNeGrCgJwv2u7LViR+Y+xD7GdJQ6KDdZyu40obEcJeGBJMOrCu7b9kD5HwhTp7mUX0 3QfQoiX0zYDB0D0+eCsXd6uGD0wmFoSGKhiZAXI8xoIRuY7x9GpoxE6y4Qlo2c8YxwgS f+5lOk2khBlM4WpXrdPVVSyFSA3POujmzRWy8KABLHL8LU8QkUGxc2+8KkK7nYiyw8en u6MJdIkSLpoZAWPkHQNFrWL1DzAnla6IkAOU5W7w9uAvGBgibQTnoVR776oP22cS8Wc9 uiEA== 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; bh=XCXEzP1cQZ3tvtF8hxRAq5S7YwmGyYLKnzNVmaIKIio=; b=A0qSK+0wpUbpPGVW6p+MCreh92MKDnE9tT3P2F0miil4jXwaU810dHtzIRyFHjVdUi 3F6w0n0PwkBw43TALSqUQk6Ws5pzfrnug2pmWGlxJQrWZ5Qg9sCe/tGOMER18yecbBRr fJ3ZHh2Xup6bu5v3r3yWeDeLS9m85DV37EelFzMPnZ78spOWxcMMRW1nReclIBfTj5xA XYaVJjwd0UP98tef6693zHC1rpnW5V3b6oGNFcxConYqnvOP5dLZEPZia3lSQ/YycuzT dxR2HRGHcqWj6NahJPPShj883W25IFqyrK6euHmhD/1UV433W7edt3yDYi0CGgHoy/np 2d8A== X-Gm-Message-State: AOPr4FX0USrO8hEcWmNsZKau6qVnmXAC0fYHke7rLWcw7Id13kq68OJXGIl6aaX2MK0MY3SpNgP/aZyXzGGk8Q== MIME-Version: 1.0 X-Received: by 10.112.147.225 with SMTP id tn1mr2154572lbb.98.1461706460521; Tue, 26 Apr 2016 14:34:20 -0700 (PDT) Received: by 10.112.236.33 with HTTP; Tue, 26 Apr 2016 14:34:20 -0700 (PDT) In-Reply-To: <20160426212648.GC13055@mutt-hardenedbsd> References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> <20160426211804.GB13055@mutt-hardenedbsd> <116F3C09-CD22-42EC-80BF-4EAD6CA1C824@FreeBSD.org> <20160426212648.GC13055@mutt-hardenedbsd> Date: Tue, 26 Apr 2016 14:34:20 -0700 Message-ID: Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs From: Ngie Cooper To: Shawn Webb Cc: Kristof Provost , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , secteam@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:34:23 -0000 On Tue, Apr 26, 2016 at 2:26 PM, Shawn Webb wrote: > On Tue, Apr 26, 2016 at 11:22:32PM +0200, Kristof Provost wrote: >> >> > On 26 Apr 2016, at 23:18, Shawn Webb wrote: >> > Was secteam@ even involved, then? Seems like a user-facing kernel buffer >> > overflow ought to have involved secteam@. >> > >> No, it wasn???t. This bug had been open for quite a while, and I just happend to see the report and look at it. > > Now CC'ing secteam@. I'm wondering if a CVE should be filed. Or, at the > very least, a FreeBSD Security Advisory. I've CCed secteam on the bug and added "security" to the keywords. Thanks, -Ngie From owner-svn-src-head@freebsd.org Tue Apr 26 21:37:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D06A8B1DE00 for ; Tue, 26 Apr 2016 21:37:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89A351967 for ; Tue, 26 Apr 2016 21:37:58 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x235.google.com with SMTP id r184so11248606qkc.1 for ; Tue, 26 Apr 2016 14:37:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jSWvWVqwnGYGWFaBoRzyrWnGZFDo9MtWT4Sx1Vavd34=; b=PTQo9wL1ZLhTlaPkXDsX5HheD5Jv7G+4vf7Rl7rMtJRUaL2BfYR8iq7kaI2+nLJ3CZ Put9D6jdu3cIFhWaeYUyYoU9wdIEQRqxurBewBziE2Psxrtj3cYjh8054ZxmfSHOH8wQ JonZc+f60Y5sBcOjdc/GLy3vILE0TO5tY9jt0UFijor+oon6mNnUIuBt7+Y07mff+P0c zlvBlDkXlgp4PNSZ649dImlA0sVbmyecvWjhrmNttv2eKA9Ur4BVfhlaOl47RLsyF2WU n6SFrFoONHC1vPQmXz+FOA2Ya/HLmU0mHgtQOslHUtzc0wpFqDoq/mdO8SVN1KPRn0cH 6VSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jSWvWVqwnGYGWFaBoRzyrWnGZFDo9MtWT4Sx1Vavd34=; b=QZiW+6Ul0lBgIX8CqhcJB/nODh1ZY8XDtCmY4W8p9ktbcshN8ExAhnTvk8TM3M5bSS 8VwEeO3egp89Epl/IxrAXuFfLTRtG+OIz0VYcBydw2DwcIcnkoYUqbTTUryzBEO0fg0C R9UNx8wzPSiPZHPdEjgVl+aNrA0X7J7hZ1SfpEupDrEJ1bW/bcjwkdf1s7jjaORITiTz 8CfY99mpDhTrknpZUPR8G2lq6k/Z5S0HSGAenOltCdj+D0zdjHQErA7R3xhOJKKbqqI7 gRLGZBjkYCy830AKedMxHOeKcWKwuykp6X518llSI1Q4SA4gzAgnfFL2rKszRmkVrdh3 x+IA== X-Gm-Message-State: AOPr4FWYTV1ta9KgQfprGw7Kx4jMwJ6aJzOqIImyCBMpooGf/L/y2tMx21NCTWCAuqvMCT8z X-Received: by 10.55.42.145 with SMTP id q17mr4953463qkq.159.1461706677612; Tue, 26 Apr 2016 14:37:57 -0700 (PDT) Received: from mutt-hardenedbsd (c-73-135-80-144.hsd1.md.comcast.net. [73.135.80.144]) by smtp.gmail.com with ESMTPSA id y85sm232558qha.32.2016.04.26.14.37.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 14:37:56 -0700 (PDT) Date: Tue, 26 Apr 2016 17:37:54 -0400 From: Shawn Webb To: Kristof Provost Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs Message-ID: <20160426213754.GD13055@mutt-hardenedbsd> References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6Nae48J/T25AfBN4" Content-Disposition: inline In-Reply-To: <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:37:58 -0000 --6Nae48J/T25AfBN4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 26, 2016 at 11:05:38PM +0200, Kristof Provost wrote: >=20 > > On 26 Apr 2016, at 23:01, Shawn Webb wrote: > >=20 > > On Tue, Apr 26, 2016 at 08:36:32PM +0000, Kristof Provost wrote: > >> Author: kp > >> Date: Tue Apr 26 20:36:32 2016 > >> New Revision: 298664 > >> URL: https://svnweb.freebsd.org/changeset/base/298664 > >>=20 > >> Log: > >> msdosfs: Prevent buffer overflow when expanding win95 names > >>=20 > >> In win2unixfn() we expand Windows 95 style long names. In some cases = that > >> requires moving the data in the nbp->nb_buf buffer backwards to make = room. That > >> code failed to check for overflows, leading to a stack overflow in wi= n2unixfn(). > >>=20 > >> We now check for this event, and mark the entire conversion as failed= in that > >> case. This means we present the 8 character, dos style, name instead. > >>=20 > >> PR: 204643 > >> Differential Revision: https://reviews.freebsd.org/D6015 > >=20 > > Will this be MFC'd? Since it's triggerable as non-root, should this have > > a CVE? Though the commit log shows technical comments, it doesn't show > > related security information. >=20 > Yes, I???ll put MFCing this on my todo list. When do you plan to MFC? --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --6Nae48J/T25AfBN4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXH9+wAAoJEGqEZY9SRW7uMIoP/1nsAPZZxMOh9AGsY2XxDK30 rK6TTSunMueANUVY8P25xrHlt6pIkneUDZbiFglhQt+S0LVvbisXuPxQrMnomYvw Nrn+HhaWtCL0YjYSF9wIeX6aO4qJwpABFMrgs5rpnczFVAMU2gBTW2G1GdoF6CPm l0i+0gumvgI37Mqz1gowjFN/eIQLFr/qiugqG9ubBn3UwD5Shx5VCxeMGyGXzsuK PA05Q65ScG6Mv675R4Mig9saChvBLUOrXPblu+WN+62JlvaHfyxx1Y5q8CLmGUdE 0xqQpqvmRxzP41uQyMQYjDnoOilyMiAPiXc4DMZMY4XXaNls3oP9PRltCmYxw9Pz aV+in6PfdJ5bJeHsuUk/00VnkaS97SfLN5w+c/1EE+uVeGDexyulT2wJPuzho724 bo3hVWILpPc9vylAn+T1uTDh5XhHJyf/Su9Bb6J9YPitI5MYhI5qS+w3w7PFToqC D6o5cYznfq6M4PASGXD4T1YBuGeOHzTr8IPdxskKJiMAGgGCPcYTyuJKj2dxtffw TxhaEfg+YxIrRiK8iv+WUu0uxscQAPqxzoLatjBujGqko3RfB3UCkhQ4TdmVYmXL bRtaWwayxHh5q7zv0djOcVu9QbqtIQ7lNCGYm+el3Vu0jDfQoe0vCRkjF0SIntzP /tt0VGkq3YkapavIHxzp =i2Th -----END PGP SIGNATURE----- --6Nae48J/T25AfBN4-- From owner-svn-src-head@freebsd.org Tue Apr 26 21:42:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3729B1C151; Tue, 26 Apr 2016 21:42:31 +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 9BF421E2C; Tue, 26 Apr 2016 21:42:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [IPv6:2a02:1811:2419:4e02:8d7d:588c:ce11:391d] (unknown [IPv6:2a02:1811:2419:4e02:8d7d:588c:ce11:391d]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id E5C3220F65; Tue, 26 Apr 2016 23:42:28 +0200 (CEST) Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_AB1A2737-AD2D-42B6-8E09-15E342E6AD44"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: Kristof Provost X-Checked-By-Nsa: Probably In-Reply-To: <20160426213754.GD13055@mutt-hardenedbsd> Date: Tue, 26 Apr 2016 23:42:22 +0200 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> <20160426213754.GD13055@mutt-hardenedbsd> To: Shawn Webb X-Mailer: Apple Mail (2.3124) X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:42:32 -0000 --Apple-Mail=_AB1A2737-AD2D-42B6-8E09-15E342E6AD44 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 26 Apr 2016, at 23:37, Shawn Webb = wrote: >=20 > On Tue, Apr 26, 2016 at 11:05:38PM +0200, Kristof Provost wrote: >>=20 >>> On 26 Apr 2016, at 23:01, Shawn Webb = wrote: >>>=20 >>> On Tue, Apr 26, 2016 at 08:36:32PM +0000, Kristof Provost wrote: >>>> Author: kp >>>> Date: Tue Apr 26 20:36:32 2016 >>>> New Revision: 298664 >>>> URL: https://svnweb.freebsd.org/changeset/base/298664 >>>>=20 >>>> Log: >>>> msdosfs: Prevent buffer overflow when expanding win95 names >>>>=20 >>>> In win2unixfn() we expand Windows 95 style long names. In some = cases that >>>> requires moving the data in the nbp->nb_buf buffer backwards to = make room. That >>>> code failed to check for overflows, leading to a stack overflow in = win2unixfn(). >>>>=20 >>>> We now check for this event, and mark the entire conversion as = failed in that >>>> case. This means we present the 8 character, dos style, name = instead. >>>>=20 >>>> PR: 204643 >>>> Differential Revision: https://reviews.freebsd.org/D6015 >>>=20 >>> Will this be MFC'd? Since it's triggerable as non-root, should this = have >>> a CVE? Though the commit log shows technical comments, it doesn't = show >>> related security information. >>=20 >> Yes, I???ll put MFCing this on my todo list. >=20 > When do you plan to MFC? I=E2=80=99d originally planned to do so around Monday, but I can try to = do it earlier. Iirc. the usual minimal period is 3 days, so that=E2=80=99d be Friday = evening (for me). I=E2=80=99m travelling Friday/Saturday/Sunday, so it=E2=80=99s hard to = give solid promises. (Unless secteam judges this to be more urgent of course, in which case = I=E2=80=99d be happy to do it earlier.) Regards, Kristof --Apple-Mail=_AB1A2737-AD2D-42B6-8E09-15E342E6AD44 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJXH+DEAAoJEG/E3HH7XkpG5r0H/3/rEzYbLqoPzgGuDWO4xalB spdecmAbjWoKm4evCGIeXzSxhbWLyv5lC6WN9fD3o7jao0nSOUz/XuuQYBwfE8yo vF/0VDFokwXSzYdgMgnPU6B0dWAeKALbW2PL8JcmJ7/Uwy6KdAwYco40Z4nhnLBk zpDG9yFMRBJRq4Kdr4evgcq0XWan9CyFYdtrTzJV0mMpNZ0S0runJY1QNfyE71Rb qr7RsOpN4i6H385hT9UlKpVN9oaLp/vHVw3x9JiVwJgXCR4H81eRQnKafbLcGT2Z QbaqtfN8SYXWLMPgRfQytkAHpHBKY6KqdA2apHWHQ98m4Sv4UJahxr7iK/Q1dgg= =nQsC -----END PGP SIGNATURE----- --Apple-Mail=_AB1A2737-AD2D-42B6-8E09-15E342E6AD44-- From owner-svn-src-head@freebsd.org Tue Apr 26 21:44:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3332AB1C216; Tue, 26 Apr 2016 21:44:10 +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 0483A1038; Tue, 26 Apr 2016 21:44:09 +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 u3QLi9mv061167; Tue, 26 Apr 2016 21:44:09 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QLi9ZX061166; Tue, 26 Apr 2016 21:44:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262144.u3QLi9ZX061166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 21:44:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298669 - head/sys/dev/iscsi_initiator X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:44:10 -0000 Author: cem Date: Tue Apr 26 21:44:08 2016 New Revision: 298669 URL: https://svnweb.freebsd.org/changeset/base/298669 Log: iscsi_initiator(4): Fix use-after-free, double-free ism_stop() already destroys and frees 'sp', including a call to ic_destroy(). Don't dereference 'sp' after ism_stop() and don't invoke ic_destroy() on the freed memory either. Reported by: Coverity CIDs: 1006109, 1304861 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/iscsi_initiator/iscsi.c Modified: head/sys/dev/iscsi_initiator/iscsi.c ============================================================================== --- head/sys/dev/iscsi_initiator/iscsi.c Tue Apr 26 21:19:12 2016 (r298668) +++ head/sys/dev/iscsi_initiator/iscsi.c Tue Apr 26 21:44:08 2016 (r298669) @@ -804,8 +804,6 @@ iscsi_stop(void) TAILQ_FOREACH_SAFE(sp, &isc->isc_sess, sp_link, sp_tmp) { //XXX: check for activity ... ism_stop(sp); - if(sp->cam_sim != NULL) - ic_destroy(sp); } mtx_destroy(&isc->isc_mtx); sx_destroy(&isc->unit_sx); From owner-svn-src-head@freebsd.org Tue Apr 26 21:45:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B26F7B1C2E6 for ; Tue, 26 Apr 2016 21:45:52 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x230.google.com (mail-wm0-x230.google.com [IPv6:2a00:1450:400c:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4C6F411D4 for ; Tue, 26 Apr 2016 21:45:52 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x230.google.com with SMTP id v200so24233533wmv.1 for ; Tue, 26 Apr 2016 14:45:52 -0700 (PDT) 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-transfer-encoding; bh=upqfK76HLgOwzkGzO7pXkjho9NqELkf/SSOdSdDPDN8=; b=mftnqb5oZ06oCbHy/YPCUcO8jAWKwHGSGOZidhLEpgzRSW74qMy5q07xUDxtJSkEGT DDsao0O4V8Aj8buPpR3iKJHRb2pqJnufgkyWCvVylQ4PM3K2KqJuZdPpaBVe7So4mSrZ Ttx8o+yjs7U/SW7FSDqvFzUVtrZYqJbr0aqB/Q45UTIMR+S5/Jod2ZPsPzwkha7mijsO X5UR2GSI3otiKTY//PvqexdCgQvoq+864bBW55Bvmwe4L4hs7qB2A5GHTBO3U7/LgSV8 GZ3IUmj5HVYIianJsdwdeYaTIL9WDIUxB69p5T/mOftN/yerbMbUzskyRDL/OEmgjwx2 xOfA== 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-transfer-encoding; bh=upqfK76HLgOwzkGzO7pXkjho9NqELkf/SSOdSdDPDN8=; b=BhJJjarBUmcQH4SdzyYhbIwHl1F9NIC5jUAkDjkMUU4kCV4bmTi5k7VxcTJZFTtiIO 6jeFq9qdAnflgUC3qnvyWwuDdE2aIEsv8HBJlBVKGRaNsjDdBE21gfImzzs4xKUKlQSc 1BuXBQIKrBVVMTojSGxWVV1rae+V1Q0jcL+8n3W8Ovoi3EjBjLDsc2PgRuX1cXUz33vV KMJV0kUuztrWZN4R1oKZYYn929snUv5wbIdmMN4zFXXBL7jGPolR48qBTIhgtQl2RfAT w0RqI+ojpm1xIB5MeoYGqmJePiCvkBTF3F8Ut1PBP4dgUY9GNyV3eWdvZ9cPylzulUvP oNyw== X-Gm-Message-State: AOPr4FWfzt29Dmpp+aWPjOfkjFKqB4lTt7enNwlmrPBQRGlzBvGDC5VbIpPAzCxbJaWpDq6MC5yxUX4LKF1r849K MIME-Version: 1.0 X-Received: by 10.28.211.136 with SMTP id k130mr5829342wmg.81.1461707150715; Tue, 26 Apr 2016 14:45:50 -0700 (PDT) Received: by 10.194.107.74 with HTTP; Tue, 26 Apr 2016 14:45:50 -0700 (PDT) In-Reply-To: References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> <2190C480-1B7A-47F8-BFB4-D7C8E6F25385@FreeBSD.org> <20160426213754.GD13055@mutt-hardenedbsd> Date: Tue, 26 Apr 2016 23:45:50 +0200 Message-ID: Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs From: Oliver Pinter To: Kristof Provost Cc: Shawn Webb , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:45:52 -0000 On 4/26/16, Kristof Provost wrote: > >> On 26 Apr 2016, at 23:37, Shawn Webb wrote: >> >> On Tue, Apr 26, 2016 at 11:05:38PM +0200, Kristof Provost wrote: >>> >>>> On 26 Apr 2016, at 23:01, Shawn Webb >>>> wrote: >>>> >>>> On Tue, Apr 26, 2016 at 08:36:32PM +0000, Kristof Provost wrote: >>>>> Author: kp >>>>> Date: Tue Apr 26 20:36:32 2016 >>>>> New Revision: 298664 >>>>> URL: https://svnweb.freebsd.org/changeset/base/298664 >>>>> >>>>> Log: >>>>> msdosfs: Prevent buffer overflow when expanding win95 names >>>>> >>>>> In win2unixfn() we expand Windows 95 style long names. In some cases >>>>> that >>>>> requires moving the data in the nbp->nb_buf buffer backwards to make >>>>> room. That >>>>> code failed to check for overflows, leading to a stack overflow in >>>>> win2unixfn(). >>>>> >>>>> We now check for this event, and mark the entire conversion as failed >>>>> in that >>>>> case. This means we present the 8 character, dos style, name instead. >>>>> >>>>> PR: 204643 >>>>> Differential Revision: https://reviews.freebsd.org/D6015 >>>> >>>> Will this be MFC'd? Since it's triggerable as non-root, should this >>>> have >>>> a CVE? Though the commit log shows technical comments, it doesn't show >>>> related security information. >>> >>> Yes, I???ll put MFCing this on my todo list. >> >> When do you plan to MFC? > > I=E2=80=99d originally planned to do so around Monday, but I can try to d= o it > earlier. > Iirc. the usual minimal period is 3 days, so that=E2=80=99d be Friday eve= ning (for > me). > > I=E2=80=99m travelling Friday/Saturday/Sunday, so it=E2=80=99s hard to gi= ve solid promises. > > (Unless secteam judges this to be more urgent of course, in which case I= =E2=80=99d > be happy to do it earlier.) Cool! Thank you Kristof. We test them now in HardenedBSD with more updates from 11-CURRENT. https://github.com/HardenedBSD/hardenedBSD/commits/hardened/10-stable/maste= r > > Regards, > Kristof > > From owner-svn-src-head@freebsd.org Tue Apr 26 21:59:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A8C3B1C616 for ; Tue, 26 Apr 2016 21:59:23 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::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 BA7AC1985 for ; Tue, 26 Apr 2016 21:59:22 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22e.google.com with SMTP id e201so13625661wme.0 for ; Tue, 26 Apr 2016 14:59:22 -0700 (PDT) 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; bh=sXP2r+1iJLkubX1ss2nps58USw92G46U09r7ttfr0mA=; b=T331t3cgJ6zVMjxY/UZyIo+Zp0XBohm1rO0lnLeLHZW9qSzYh21EPl8wmb9ayxy0CC INE98DnPX0coXYLuwA5pCP3G5/cVY6MIrM/77tKTG1Yr5hUfmrWXfX096Jv0sK18HMV2 aKI2DMiS2/bEl3OnFaJ5CHHgWZaOKK/PDa+4yXTI3qyaMI9tsU+rYMr8JxyTkHQGqxlP eRDhJ+Ys7YtbQf4UsgWX2+IMfwqmoBaTX0KofdCp5RETUjZM4NXMRtSjqs8iqCHYrVA1 4sMgMSZ4C+Xs0TvnFI+Mij5+RmCBJ9y10oGZqdywZQvw85CtcXXWUF99B4RvBBQDlBb8 aOaA== 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; bh=sXP2r+1iJLkubX1ss2nps58USw92G46U09r7ttfr0mA=; b=hH4rzonvTH9tHf2ZXqZGU9ajD6yHzwGnAi8+YIXixd2CkA6NcG13YgcS78JQ9qFHfI SEmWWQFPeTd11YQP+1bAkTnJ1d4qwLoWIGFqWdc8uGW2XjHEUsOpOhrJnzVqx8hM23Fg IBejv/CH60k3P1XhQ08w8NgNJlZDURGgOHOL5dM9xVcrj2QDOogZ/M8dnDbZgjDHBRE7 2xNwRciFQ4hvknpRPSUo7j0uYuPIrz9XXoLfiSLcnyiJCo+Y4zx+q2pbu+96EQwojQCg ug+qRBPL4bgCj7MlH3rzQqiZUd0azXl5EK1Ga/eUQUocCEXLlMFhij+V456/YE1Z8nhn pBog== X-Gm-Message-State: AOPr4FW0aD33c6z6p1q6grzR489ywYDXrXs0T2s223I5qJIFGu6Hf8/AMvDINX9+Ncn5J4oePG0seCCVP9403Ic1 MIME-Version: 1.0 X-Received: by 10.28.0.78 with SMTP id 75mr5924392wma.20.1461707961344; Tue, 26 Apr 2016 14:59:21 -0700 (PDT) Received: by 10.194.107.74 with HTTP; Tue, 26 Apr 2016 14:59:21 -0700 (PDT) In-Reply-To: <201604262144.u3QLi9ZX061166@repo.freebsd.org> References: <201604262144.u3QLi9ZX061166@repo.freebsd.org> Date: Tue, 26 Apr 2016 23:59:21 +0200 Message-ID: Subject: Re: svn commit: r298669 - head/sys/dev/iscsi_initiator From: Oliver Pinter To: "Conrad E. Meyer" , mav@freebsd.org Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 21:59:23 -0000 On Tue, Apr 26, 2016 at 11:44 PM, Conrad E. Meyer wrote: > Author: cem > Date: Tue Apr 26 21:44:08 2016 > New Revision: 298669 > URL: https://svnweb.freebsd.org/changeset/base/298669 > > Log: > iscsi_initiator(4): Fix use-after-free, double-free > > ism_stop() already destroys and frees 'sp', including a call to ic_destroy(). > Don't dereference 'sp' after ism_stop() and don't invoke ic_destroy() on the > freed memory either. > > Reported by: Coverity > CIDs: 1006109, 1304861 > Sponsored by: EMC / Isilon Storage Division MFC of this commit? > > Modified: > head/sys/dev/iscsi_initiator/iscsi.c > > Modified: head/sys/dev/iscsi_initiator/iscsi.c > ============================================================================== > --- head/sys/dev/iscsi_initiator/iscsi.c Tue Apr 26 21:19:12 2016 (r298668) > +++ head/sys/dev/iscsi_initiator/iscsi.c Tue Apr 26 21:44:08 2016 (r298669) > @@ -804,8 +804,6 @@ iscsi_stop(void) > TAILQ_FOREACH_SAFE(sp, &isc->isc_sess, sp_link, sp_tmp) { > //XXX: check for activity ... > ism_stop(sp); > - if(sp->cam_sim != NULL) > - ic_destroy(sp); > } > mtx_destroy(&isc->isc_mtx); > sx_destroy(&isc->unit_sx); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-head@freebsd.org Tue Apr 26 22:01:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3BD9B1C6AB; Tue, 26 Apr 2016 22:01:08 +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 7C6141C88; Tue, 26 Apr 2016 22:01:08 +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 u3QM17oS066415; Tue, 26 Apr 2016 22:01:07 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QM17UX066414; Tue, 26 Apr 2016 22:01:07 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262201.u3QM17UX066414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 22:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298670 - head/sys/dev/ciss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 22:01:08 -0000 Author: cem Date: Tue Apr 26 22:01:07 2016 New Revision: 298670 URL: https://svnweb.freebsd.org/changeset/base/298670 Log: ciss(4): Fix overrun of array The softc member 'ciss_logical' is an array of 'ciss_max_logical_bus' members. Most of the time it is iterated correctly. This patch fixes the two instances where the driver iterated off the end of the array. Reported by: Coverity CID: 1305492 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ciss/ciss.c Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Tue Apr 26 21:44:08 2016 (r298669) +++ head/sys/dev/ciss/ciss.c Tue Apr 26 22:01:07 2016 (r298670) @@ -1431,7 +1431,7 @@ ciss_init_logical(struct ciss_softc *sc) goto out; } - for (i = 0; i <= sc->ciss_max_logical_bus; i++) { + for (i = 0; i < sc->ciss_max_logical_bus; i++) { sc->ciss_logical[i] = malloc(sc->ciss_cfg->max_logical_supported * sizeof(struct ciss_ldrive), @@ -2030,7 +2030,7 @@ ciss_free(struct ciss_softc *sc) if (sc->ciss_parent_dmat) bus_dma_tag_destroy(sc->ciss_parent_dmat); if (sc->ciss_logical) { - for (i = 0; i <= sc->ciss_max_logical_bus; i++) { + for (i = 0; i < sc->ciss_max_logical_bus; i++) { for (j = 0; j < sc->ciss_cfg->max_logical_supported; j++) { if (sc->ciss_logical[i][j].cl_ldrive) free(sc->ciss_logical[i][j].cl_ldrive, CISS_MALLOC_CLASS); From owner-svn-src-head@freebsd.org Tue Apr 26 22:04:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7B83B1C80D; Tue, 26 Apr 2016 22:04:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) (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 A7CBF1F36; Tue, 26 Apr 2016 22:04:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f65.google.com with SMTP id r186so3895345oie.2; Tue, 26 Apr 2016 15:04:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=N0+JwcGFsljoERNJwaZau2gUD2o/oAKctvBuywA+qfE=; b=AxKS7OHaGaYuD+a+JIPP648XeC2m9Lf+l6O10SNpkpZpUjnT5bX8wyMvfRyT8FAYRl sIriWInc/n41ggKzo3avtnn9+hAr08oKJTfscrpWuc6sAT7jzfwJGr+wporhdpUmRU74 nVksDcIRR+n8+HS/2XBVY8nhiiXcq6vs0r9h9xAmW8aS2DY0ynwGWybMyoJt7Jt6Mgd4 XiX3iG6TGOaxJmz2E/o3fvQeJQ4pm6NOmOU5nQn2ole9Vjnrk0Mpgh0m6roqwFIzjhUq 15OaxTk/o48Ln+PCfWPnEhD2Hi2T04lOp2fc4PRL03b/+NKR4Pz6c0EsA0hwyOjt7s1A bJrw== X-Gm-Message-State: AOPr4FX+cFb3TTu7xOF2OC0OBothdFpuRUqLA4CNeX+MjsQykxpxZTw6708zWOFEMLoeXw== X-Received: by 10.157.54.203 with SMTP id s11mr2302293otd.102.1461708279364; Tue, 26 Apr 2016 15:04:39 -0700 (PDT) Received: from mail-oi0-f45.google.com (mail-oi0-f45.google.com. [209.85.218.45]) by smtp.gmail.com with ESMTPSA id g6sm353234oic.17.2016.04.26.15.04.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Apr 2016 15:04:39 -0700 (PDT) Received: by mail-oi0-f45.google.com with SMTP id k142so30370064oib.1; Tue, 26 Apr 2016 15:04:38 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.202.215.86 with SMTP id o83mr1869598oig.55.1461708278764; Tue, 26 Apr 2016 15:04:38 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Tue, 26 Apr 2016 15:04:38 -0700 (PDT) In-Reply-To: References: <201604262144.u3QLi9ZX061166@repo.freebsd.org> Date: Tue, 26 Apr 2016 15:04:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298669 - head/sys/dev/iscsi_initiator From: Conrad Meyer To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 22:04:41 -0000 On Tue, Apr 26, 2016 at 2:59 PM, Oliver Pinter wrote: > On Tue, Apr 26, 2016 at 11:44 PM, Conrad E. Meyer wrote: >> Author: cem >> Date: Tue Apr 26 21:44:08 2016 >> New Revision: 298669 >> URL: https://svnweb.freebsd.org/changeset/base/298669 >> ... > > MFC of this commit? You can do it whenever you want. Best, Conrad From owner-svn-src-head@freebsd.org Tue Apr 26 22:30:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBA62B1D0CB for ; Tue, 26 Apr 2016 22:30:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm39-vm5.bullet.mail.bf1.yahoo.com (nm39-vm5.bullet.mail.bf1.yahoo.com [72.30.239.149]) (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 7135B1E31 for ; Tue, 26 Apr 2016 22:30:27 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461706579; bh=o1UzjtBkbc8yH4WyYzbnQpO/chly96bUyjAnJhh/tOM=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=lPrHTlosCcgsH+jHHsbbwcBG8rNSxf0VADJi9hmT+nFZQRAIt6UJyQOxio9fdRcuRqMnFu8hP6UNycmwGqhW5y2whJ0TGfcTWrS8VaQtIR+GdG5iXwqKHNU8PsvAfehZ1VFKZbZjG7HlMyZhDtY9tZ8YqKjHAMqdKBFH7jl4kVawfcmce49SLzfgAUgpPCwMJTGNiAdYiab7GixXZDE1j5x7xkwaJcBiM8L//Guw1X3peSRr5x62nQjEOVk4JTkfj5VTNUxTknsObJEIKzK9rF/9dFEoea9yXeGAp1boOCHkgY04CFfTNRxz6aHwmOfBwyXNQMOqGv6w9X2TK4ab+Q== Received: from [98.139.215.142] by nm39.bullet.mail.bf1.yahoo.com with NNFMP; 26 Apr 2016 21:36:19 -0000 Received: from [98.139.211.205] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 26 Apr 2016 21:36:19 -0000 Received: from [127.0.0.1] by smtp214.mail.bf1.yahoo.com with NNFMP; 26 Apr 2016 21:36:19 -0000 X-Yahoo-Newman-Id: 595955.71016.bm@smtp214.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Cpkjoc8VM1mFV4UNhJwVTSKl782LGqM5CUNmvBbZV33zNqo v11CvsOl0pPwxw7O1N34aw2Hy28xM0yzZ1SqB66ntmrynfYyuo.H3_qHGhzB KbcvrEWXmEho9ReKyqz7ei5b.7bH6pstWYlpbPNaCl6UudFs1VT6vvO6ke3O jfMvw365VUyBdHX8FFoMaESmTL5g_jKecfk6SG9GtTpjhq8mSmoDnMa8JjPG 5zsUtep8yXgIR7JJKzVgbh1YKlWAqbdnOyzq_EGfaghk5U6iQZMwun2s9sPO JFA4CZn9Q4opZ9gGxu.AjNILIEpj93PDWBbLpKyBHZyDpz9t8jo6HcNCu.ln dp2S3tDwUWpFwJP8DhdYhVWxJezgYT98C7rWQGZX92p8oAbcqiJ5C8IhEFh6 LA71MWN1ctAcWGO.8dptw0NKL8wPXQDGZhOJENKR8Nxjn2aiBTFO9Fy._IQd 4WjYy3.31MqFqFWhPBNPLlSY3fvNV3r7B3q2xcp0MHYOwuaccwvgcNfuUyNd tlSCUu1lC81_XfmP2lC0HXodOFxtOLZh_ X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298664 - head/sys/fs/msdosfs To: cem@FreeBSD.org References: <201604262036.u3QKaWto038435@repo.freebsd.org> <20160426210138.GA13055@mutt-hardenedbsd> Cc: Kristof Provost , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Pedro Giffuni Message-ID: <36e8fe15-2b0f-6d50-92ca-84f29d70df20@FreeBSD.org> Date: Tue, 26 Apr 2016 16:36:32 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 22:30:27 -0000 On 04/26/16 16:17, Conrad Meyer wrote: > On Tue, Apr 26, 2016 at 2:13 PM, Adrian Chadd wrote: >> You mean "hotplug mount a malicious USB disk via some installed >> graphical enviornment?" >> >> NOone does that... :) > > Sure, but there the vulnerability is (IMO) that users are allowed to > arbitrarily mount stuff. That's a huge attack surface and this fix > only scratches the surface. > This is a plain bug, it may be nasty but not really a security vulnerability. If you give physical access to your system to an attacker you probably have bigger problems than this. > We do need to make filesystems more resilient to malice. AFL? > That is a good idea. For reference: https://lwn.net/Articles/637151/ Cheers, Pedro. From owner-svn-src-head@freebsd.org Tue Apr 26 22:30:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DBA8B1D1E6; Tue, 26 Apr 2016 22:30:55 +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 5E7851FEA; Tue, 26 Apr 2016 22:30:55 +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 u3QMUspV073469; Tue, 26 Apr 2016 22:30:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QMUs7W073468; Tue, 26 Apr 2016 22:30:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262230.u3QMUs7W073468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 22:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298671 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 22:30:55 -0000 Author: cem Date: Tue Apr 26 22:30:54 2016 New Revision: 298671 URL: https://svnweb.freebsd.org/changeset/base/298671 Log: g_part_bsd64: Check for valid on-disk npartitions value This value is u32 on disk, but assigned to an int in memory. After we do the implicit conversion via assignment, check that the result is at least one[1] (non-negative[2]). 1. The subsequent for-loop iterates from gpt_entries minus one, down, until reaching zero. A negative or zero initial index results in undefined signed integer overflow. 2. It is also used to index into arrays later. In practice, we expected non-malicious disks to contain small positive values. Reported by: Coverity CID: 1223202 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/geom/part/g_part_bsd64.c Modified: head/sys/geom/part/g_part_bsd64.c ============================================================================== --- head/sys/geom/part/g_part_bsd64.c Tue Apr 26 22:01:07 2016 (r298670) +++ head/sys/geom/part/g_part_bsd64.c Tue Apr 26 22:30:54 2016 (r298671) @@ -509,7 +509,8 @@ g_part_bsd64_read(struct g_part_table *b dlp = (struct disklabel64 *)buf; basetable->gpt_entries = le32toh(dlp->d_npartitions); - if (basetable->gpt_entries > MAXPARTITIONS64) + if (basetable->gpt_entries > MAXPARTITIONS64 || + basetable->gpt_entries < 1) goto invalid_label; v32 = le32toh(dlp->d_crc); dlp->d_crc = 0; From owner-svn-src-head@freebsd.org Tue Apr 26 22:32:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 977B6B1D30F; Tue, 26 Apr 2016 22:32:34 +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 68D931453; Tue, 26 Apr 2016 22:32:34 +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 u3QMWXPo076243; Tue, 26 Apr 2016 22:32:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QMWX1c076242; Tue, 26 Apr 2016 22:32:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262232.u3QMWX1c076242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 22:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298672 - head/sys/geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 22:32:34 -0000 Author: cem Date: Tue Apr 26 22:32:33 2016 New Revision: 298672 URL: https://svnweb.freebsd.org/changeset/base/298672 Log: g_part_bsd64: Delete duplicate/dead code RAW_PART is handled earlier in the loop. Reported by: Coverity CID: 1223201 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/geom/part/g_part_bsd64.c Modified: head/sys/geom/part/g_part_bsd64.c ============================================================================== --- head/sys/geom/part/g_part_bsd64.c Tue Apr 26 22:30:54 2016 (r298671) +++ head/sys/geom/part/g_part_bsd64.c Tue Apr 26 22:32:33 2016 (r298672) @@ -563,8 +563,6 @@ g_part_bsd64_read(struct g_part_table *b le_uuid_dec(&dlp->d_partitions[index].p_stor_uuid, &entry->stor_uuid); entry->fstype = dlp->d_partitions[index].p_fstype; - if (index == RAW_PART) - baseentry->gpe_internal = 1; } bcopy(dlp->d_reserved0, table->d_reserved0, sizeof(table->d_reserved0)); From owner-svn-src-head@freebsd.org Tue Apr 26 23:02:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1B94B1D7A3; Tue, 26 Apr 2016 23:02:19 +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 87FC610FF; Tue, 26 Apr 2016 23:02:19 +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 u3QN2Ixs085307; Tue, 26 Apr 2016 23:02:18 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QN2IqC085306; Tue, 26 Apr 2016 23:02:18 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262302.u3QN2IqC085306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 23:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298673 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 23:02:20 -0000 Author: cem Date: Tue Apr 26 23:02:18 2016 New Revision: 298673 URL: https://svnweb.freebsd.org/changeset/base/298673 Log: tcp_usrreq: Free allocated buffer in relock case The disgusting macro INP_WLOCK_RECHECK may early-return. In tcp_default_ctloutput() the TCP_CCALGOOPT case allocates memory before invoking this macro, which may leak memory. Add a _CLEANUP variant that takes a code argument to perform variable cleanup in the early return path. Use it to free the 'pbuf' allocated in tcp_default_ctloutput(). I am not especially happy with this macro, but I reckon it's not any worse than INP_WLOCK_RECHECK already was. Reported by: Coverity CID: 1350286 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Tue Apr 26 22:32:33 2016 (r298672) +++ head/sys/netinet/tcp_usrreq.c Tue Apr 26 23:02:18 2016 (r298673) @@ -1361,14 +1361,16 @@ tcp_fill_info(struct tcpcb *tp, struct t * has to revalidate that the connection is still valid for the socket * option. */ -#define INP_WLOCK_RECHECK(inp) do { \ +#define INP_WLOCK_RECHECK_CLEANUP(inp, cleanup) do { \ INP_WLOCK(inp); \ if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { \ INP_WUNLOCK(inp); \ + cleanup; \ return (ECONNRESET); \ } \ tp = intotcpcb(inp); \ } while(0) +#define INP_WLOCK_RECHECK(inp) INP_WLOCK_RECHECK_CLEANUP((inp), /* noop */) int tcp_ctloutput(struct socket *so, struct sockopt *sopt) @@ -1497,7 +1499,7 @@ tcp_default_ctloutput(struct socket *so, free(pbuf, M_TEMP); return (error); } - INP_WLOCK_RECHECK(inp); + INP_WLOCK_RECHECK_CLEANUP(inp, free(pbuf, M_TEMP)); if (CC_ALGO(tp)->ctl_output != NULL) error = CC_ALGO(tp)->ctl_output(tp->ccv, sopt, pbuf); else @@ -1838,6 +1840,7 @@ unlock_and_done: return (error); } #undef INP_WLOCK_RECHECK +#undef INP_WLOCK_RECHECK_CLEANUP /* * Attach TCP protocol to socket, allocating From owner-svn-src-head@freebsd.org Tue Apr 26 23:09:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F18B3B1D952; Tue, 26 Apr 2016 23:09:48 +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 B42C91334; Tue, 26 Apr 2016 23:09:48 +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 u3QN9mPM085572; Tue, 26 Apr 2016 23:09:48 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QN9lC4085568; Tue, 26 Apr 2016 23:09:47 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604262309.u3QN9lC4085568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Tue, 26 Apr 2016 23:09:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298674 - in head/sys: boot/fdt/dts/arm dev/cadence X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 23:09:49 -0000 Author: gonzo Date: Tue Apr 26 23:09:47 2016 New Revision: 298674 URL: https://svnweb.freebsd.org/changeset/base/298674 Log: Refactor DTS files for Zynq-based SoCs - Factor out common part to zynq-7000.dtsi - Fix problem with Zynq interrupts by using interrupt "triples" in .dtsi file to differentiate between edge-triggered and level-triggered interrupts - cgem driver now recognizes "status" property Submitted by: Thomas Skibo Differential Revision: https://reviews.freebsd.org/D6095 Added: head/sys/boot/fdt/dts/arm/zynq-7000.dtsi (contents, props changed) Modified: head/sys/boot/fdt/dts/arm/zedboard.dts head/sys/boot/fdt/dts/arm/zybo.dts head/sys/dev/cadence/if_cgem.c Modified: head/sys/boot/fdt/dts/arm/zedboard.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/zedboard.dts Tue Apr 26 23:02:18 2016 (r298673) +++ head/sys/boot/fdt/dts/arm/zedboard.dts Tue Apr 26 23:09:47 2016 (r298674) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2012 The FreeBSD Foundation + * Copyright (c) 2016 The FreeBSD Foundation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -25,24 +25,12 @@ * * $FreeBSD$ */ - /dts-v1/; +/include/ "zynq-7000.dtsi" / { model = "zedboard"; compatible = "digilent,zedboard"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&GIC>; - - // cpus { - // #address-cells = <1>; - // #size-cells = <0>; - // cpu@0 { - // device-type = "cpu"; - // model = "ARM Cortex-A9"; - // }; - // }; memory { // First megabyte isn't accessible by all interconnect masters. @@ -50,168 +38,34 @@ reg = <0x100000 0x1ff00000>; /* 511MB RAM at 0x100000 */ }; - // Zynq PS System registers. - // - ps7sys@f8000000 { - device_type = "soc"; - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xf8000000 0xf10000>; - - // SLCR block - slcr: slcr@7000 { - compatible = "xlnx,zy7_slcr"; - reg = <0x0 0x1000>; - clock-frequency = <33333333>; // 33Mhz PS_CLK - }; - - // Interrupt controller - GIC: gic { - compatible = "arm,gic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0xf01000 0x1000>, // distributer registers - <0xf00100 0x0100>; // CPU if registers - }; - - // L2 cache controller - pl310@f02000 { - compatible = "arm,pl310"; - reg = <0xf02000 0x1000>; - interrupts = <34>; - interrupt-parent = <&GIC>; - }; - - // Device Config - devcfg: devcfg@7000 { - compatible = "xlnx,zy7_devcfg"; - reg = <0x7000 0x1000>; - interrupts = <40>; - interrupt-parent = <&GIC>; - }; - - // triple timer counters0,1 - ttc0: ttc@1000 { - compatible = "xlnx,ttc"; - reg = <0x1000 0x1000>; - }; - ttc1: ttc@2000 { - compatible = "xlnx,ttc"; - reg = <0x2000 0x1000>; - }; - - // ARM Cortex A9 TWD Timer - timer@f00600 { - compatible = "arm,mpcore-timers"; - clock-frequency = <333333333>; // 333Mhz - #address-cells = <1>; - #size-cells = <0>; - reg = <0xf00200 0x100>, // Global Timer Regs - <0xf00600 0x20>; // Private Timer Regs - interrupts = < 27 29 >; - interrupt-parent = <&GIC>; - }; - - // system watch-dog timer - swdt@5000 { - device_type = "watchdog"; - compatible = "xlnx,zy7_wdt"; - reg = <0x5000 0x1000>; - interrupts = <41>; - interrupt-parent = <&GIC>; - }; - - scuwdt@f00620 { - device_type = "watchdog"; - compatible = "arm,mpcore_wdt"; - reg = <0xf00620 0x20>; - interrupts = <30>; - interrupt-parent = <&GIC>; - reset = <1>; - }; - }; // pssys@f8000000 - - // Zynq PS I/O Peripheral registers. - // - ps7io@e0000000 { - device_type = "soc"; - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xe0000000 0x300000>; - - // uart0: uart@0000 { - // device_type = "serial"; - // compatible = "cadence,uart"; - // reg = <0x0000 0x1000>; - // interrupts = <59>; - // interrupt-parent = <&GIC>; - // clock-frequency = <50000000>; - // }; - - uart1: uart@1000 { - device_type = "serial"; - compatible = "cadence,uart"; - reg = <0x1000 0x1000>; - interrupts = <82>; - interrupt-parent = <&GIC>; - clock-frequency = <50000000>; - current-speed = <115200>; - }; - - gpio: gpio@a000 { - compatible = "xlnx,zy7_gpio"; - reg = <0xa000 0x1000>; - interrupts = <52>; - interrupt-parent = <&GIC>; - }; - - // GigE - eth0: eth@b000 { - // device_type = "network"; - - compatible = "cadence,gem"; - reg = <0xb000 0x1000>; - interrupts = <54 55>; - interrupt-parent = <&GIC>; - ref-clock-num = <0>; - }; - - // SDIO - sdhci0: sdhci@100000 { - compatible = "xlnx,zy7_sdhci"; - reg = <0x100000 0x1000>; - interrupts = <56>; - interrupt-parent = <&GIC>; - max-frequency = <50000000>; - }; - - // QSPI - qspi0: qspi@d000 { - compatible = "xlnx,zy7_qspi"; - reg = <0xd000 0x1000>; - interrupts = <51>; - interrupt-parent = <&GIC>; - spi-clock = <50000000>; - ref-clock = <190476000>; - }; - - // USB - ehci0: ehci@2000 { - compatible = "xlnx,zy7_ehci"; - reg = <0x2000 0x1000>; - interrupts = <53>; - interrupt-parent = <&GIC>; - phy_vbus_ext; - }; - - }; // ps7io@e0000000 - chosen { stdin = &uart1; stdout = &uart1; }; }; +&slcr { + clock-frequency = <33333333>; // 33Mhz PS_CLK +}; + +&global_timer { + clock-frequency = <333333333>; // 333Mhz +}; + +&uart1 { + status = "okay"; +}; + +ð0 { + status = "okay"; +}; + +&sdhci0 { + status = "okay"; +}; + +&ehci0 { + status = "okay"; + phy_vbus_ext; +}; + Modified: head/sys/boot/fdt/dts/arm/zybo.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/zybo.dts Tue Apr 26 23:02:18 2016 (r298673) +++ head/sys/boot/fdt/dts/arm/zybo.dts Tue Apr 26 23:09:47 2016 (r298674) @@ -1,216 +1,69 @@ -/*- - * Copyright (c) 2015 The FreeBSD Foundation - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * $FreeBSD$ - */ - -/dts-v1/; - -/ { - model = "zybo"; - compatible = "digilent,zybo"; - #address-cells = <1>; - #size-cells = <1>; - interrupt-parent = <&GIC>; - - // cpus { - // #address-cells = <1>; - // #size-cells = <0>; - // cpu@0 { - // device-type = "cpu"; - // model = "ARM Cortex-A9"; - // }; - // }; - - memory { - // First megabyte isn't accessible by all interconnect masters. - device_type = "memory"; - reg = <0x100000 0x1ff00000>; /* 511MB RAM at 0x100000 */ - }; - - // Zynq PS System registers. - // - ps7sys@f8000000 { - device_type = "soc"; - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xf8000000 0xf10000>; - - // SLCR block - slcr: slcr@7000 { - compatible = "xlnx,zy7_slcr"; - reg = <0x0 0x1000>; - clock-frequency = <50000000>; // 50Mhz PS_CLK - }; - - // Interrupt controller - GIC: gic { - compatible = "arm,gic"; - interrupt-controller; - #address-cells = <0>; - #interrupt-cells = <1>; - reg = <0xf01000 0x1000>, // distributer registers - <0xf00100 0x0100>; // CPU if registers - }; - - // L2 cache controller - pl310@f02000 { - compatible = "arm,pl310"; - reg = <0xf02000 0x1000>; - interrupts = <34>; - interrupt-parent = <&GIC>; - }; - - // Device Config - devcfg: devcfg@7000 { - compatible = "xlnx,zy7_devcfg"; - reg = <0x7000 0x1000>; - interrupts = <40>; - interrupt-parent = <&GIC>; - }; - - // triple timer counters0,1 - ttc0: ttc@1000 { - compatible = "xlnx,ttc"; - reg = <0x1000 0x1000>; - }; - ttc1: ttc@2000 { - compatible = "xlnx,ttc"; - reg = <0x2000 0x1000>; - }; - - // ARM Cortex A9 TWD Timer - timer@f00600 { - compatible = "arm,mpcore-timers"; - clock-frequency = <325000000>; // 325Mhz - #address-cells = <1>; - #size-cells = <0>; - reg = <0xf00200 0x100>, // Global Timer Regs - <0xf00600 0x20>; // Private Timer Regs - interrupts = < 27 29 >; - interrupt-parent = <&GIC>; - }; - - // system watch-dog timer - swdt@5000 { - device_type = "watchdog"; - compatible = "xlnx,zy7_wdt"; - reg = <0x5000 0x1000>; - interrupts = <41>; - interrupt-parent = <&GIC>; - }; - - scuwdt@f00620 { - device_type = "watchdog"; - compatible = "arm,mpcore_wdt"; - reg = <0xf00620 0x20>; - interrupts = <30>; - interrupt-parent = <&GIC>; - reset = <1>; - }; - }; // pssys@f8000000 - - // Zynq PS I/O Peripheral registers. - // - ps7io@e0000000 { - device_type = "soc"; - compatible = "simple-bus"; - #address-cells = <1>; - #size-cells = <1>; - ranges = <0x0 0xe0000000 0x300000>; - - // uart0: uart@0000 { - // device_type = "serial"; - // compatible = "cadence,uart"; - // reg = <0x0000 0x1000>; - // interrupts = <59>; - // interrupt-parent = <&GIC>; - // clock-frequency = <50000000>; - // }; - - uart1: uart@1000 { - device_type = "serial"; - compatible = "cadence,uart"; - reg = <0x1000 0x1000>; - interrupts = <82>; - interrupt-parent = <&GIC>; - clock-frequency = <50000000>; - current-speed = <115200>; - }; - - gpio: gpio@a000 { - compatible = "xlnx,zy7_gpio"; - reg = <0xa000 0x1000>; - interrupts = <52>; - interrupt-parent = <&GIC>; - }; - - // GigE - eth0: eth@b000 { - // device_type = "network"; - - compatible = "cadence,gem"; - reg = <0xb000 0x1000>; - interrupts = <54 55>; - interrupt-parent = <&GIC>; - ref-clock-num = <0>; - }; - - // SDIO - sdhci0: sdhci@100000 { - compatible = "xlnx,zy7_sdhci"; - reg = <0x100000 0x1000>; - interrupts = <56>; - interrupt-parent = <&GIC>; - max-frequency = <50000000>; - }; - - // QSPI - qspi0: qspi@d000 { - compatible = "xlnx,zy7_qspi"; - reg = <0xd000 0x1000>; - interrupts = <51>; - interrupt-parent = <&GIC>; - spi-clock = <50000000>; - ref-clock = <200000000>; - }; - - // USB - ehci0: ehci@2000 { - compatible = "xlnx,zy7_ehci"; - reg = <0x2000 0x1000>; - interrupts = <53>; - interrupt-parent = <&GIC>; - }; - - }; // ps7io@e0000000 - - chosen { - stdin = &uart1; - stdout = &uart1; - }; -}; - +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +/dts-v1/; +/include/ "zynq-7000.dtsi" + +/ { + model = "zybo"; + compatible = "digilent,zybo"; + + memory { + // First megabyte isn't accessible by all interconnect masters. + device_type = "memory"; + reg = <0x100000 0x1ff00000>; /* 511MB RAM at 0x100000 */ + }; + + chosen { + stdin = &uart1; + stdout = &uart1; + }; +}; + +&slcr { + clock-frequency = <50000000>; // 50Mhz PS_CLK +}; + +&global_timer { + clock-frequency = <325000000>; // 325Mhz +}; + +&uart1 { + status = "okay"; +}; + +ð0 { + status = "okay"; +}; + +&sdhci0 { + status = "okay"; +}; + +&ehci0 { + status = "okay"; +}; Added: head/sys/boot/fdt/dts/arm/zynq-7000.dtsi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/dts/arm/zynq-7000.dtsi Tue Apr 26 23:09:47 2016 (r298674) @@ -0,0 +1,225 @@ +/*- + * Copyright (c) 2016 The FreeBSD Foundation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +/ { + compatible = "xlnx,zynq-7000"; + #address-cells = <1>; + #size-cells = <1>; + interrupt-parent = <&GIC>; + + // Zynq PS System registers. + // + ps7sys@f8000000 { + device_type = "soc"; + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0xf8000000 0xf10000>; + + // SLCR block + slcr: slcr@7000 { + compatible = "xlnx,zy7_slcr"; + reg = <0x0 0x1000>; + }; + + // Interrupt controller + GIC: gic { + compatible = "arm,gic"; + interrupt-controller; + #address-cells = <0>; + #interrupt-cells = <3>; + reg = <0xf01000 0x1000>, // distributer registers + <0xf00100 0x0100>; // CPU if registers + }; + + // L2 cache controller + pl310@f02000 { + compatible = "arm,pl310"; + reg = <0xf02000 0x1000>; + interrupts = <0 2 4>; + interrupt-parent = <&GIC>; + }; + + // Device Config + devcfg: devcfg@7000 { + compatible = "xlnx,zy7_devcfg"; + reg = <0x7000 0x1000>; + interrupts = <0 8 4>; + interrupt-parent = <&GIC>; + }; + + // triple timer counters0,1 + ttc0: ttc@1000 { + compatible = "xlnx,ttc"; + reg = <0x1000 0x1000>; + }; + + ttc1: ttc@2000 { + compatible = "xlnx,ttc"; + reg = <0x2000 0x1000>; + }; + + // ARM Cortex A9 TWD Timer + global_timer: timer@f00600 { + compatible = "arm,mpcore-timers"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0xf00200 0x100>, // Global Timer Regs + <0xf00600 0x20>; // Private Timer Regs + interrupts = <1 11 1>, <1 13 1>; + interrupt-parent = <&GIC>; + }; + + // system watch-dog timer + swdt@5000 { + device_type = "watchdog"; + compatible = "xlnx,zy7_wdt"; + reg = <0x5000 0x1000>; + interrupts = <0 9 1>; + interrupt-parent = <&GIC>; + }; + + scuwdt@f00620 { + device_type = "watchdog"; + compatible = "arm,mpcore_wdt"; + reg = <0xf00620 0x20>; + interrupts = <1 14 1>; + interrupt-parent = <&GIC>; + reset = <1>; + }; + + }; // pssys@f8000000 + + // Zynq PS I/O Peripheral registers. + // + ps7io@e0000000 { + device_type = "soc"; + compatible = "simple-bus"; + #address-cells = <1>; + #size-cells = <1>; + ranges = <0x0 0xe0000000 0x300000>; + + // UART controllers + uart0: uart@0000 { + device_type = "serial"; + compatible = "cadence,uart"; + status = "disabled"; + reg = <0x0000 0x1000>; + interrupts = <0 27 4>; + interrupt-parent = <&GIC>; + clock-frequency = <50000000>; + }; + + uart1: uart@1000 { + device_type = "serial"; + compatible = "cadence,uart"; + status = "disabled"; + reg = <0x1000 0x1000>; + interrupts = <0 50 4>; + interrupt-parent = <&GIC>; + clock-frequency = <50000000>; + }; + + // USB controllers + ehci0: ehci@2000 { + compatible = "xlnx,zy7_ehci"; + status = "disabled"; + reg = <0x2000 0x1000>; + interrupts = <0 21 4>; + interrupt-parent = <&GIC>; + }; + + ehci1: ehci@3000 { + compatible = "xlnx,zy7_ehci"; + status = "disabled"; + reg = <0x3000 0x1000>; + interrupts = <0 44 4>; + interrupt-parent = <&GIC>; + }; + + // GPIO controller + gpio: gpio@a000 { + compatible = "xlnx,zy7_gpio"; + reg = <0xa000 0x1000>; + interrupts = <0 20 4>; + interrupt-parent = <&GIC>; + }; + + // Gigabit Ethernet controllers + eth0: eth@b000 { + device_type = "network"; + compatible = "cadence,gem"; + status = "disabled"; + reg = <0xb000 0x1000>; + interrupts = <0 22 4>; + interrupt-parent = <&GIC>; + ref-clock-num = <0>; + }; + + eth1: eth@c000 { + device_type = "network"; + compatible = "cadence,gem"; + status = "disabled"; + reg = <0xc000 0x1000>; + interrupts = <0 45 4>; + interrupt-parent = <&GIC>; + ref-clock-num = <1>; + }; + + // Quad-SPI controller + qspi0: qspi@d000 { + compatible = "xlnx,zy7_qspi"; + status = "disabled"; + reg = <0xd000 0x1000>; + interrupts = <0 19 4>; + interrupt-parent = <&GIC>; + spi-clock = <50000000>; + }; + + // SDIO controllers + sdhci0: sdhci@100000 { + compatible = "xlnx,zy7_sdhci"; + status = "disabled"; + reg = <0x100000 0x1000>; + interrupts = <0 24 4>; + interrupt-parent = <&GIC>; + max-frequency = <50000000>; + }; + + sdhci1: sdhci@101000 { + compatible = "xlnx,zy7_sdhci"; + status = "disabled"; + reg = <0x101000 0x1000>; + interrupts = <0 47 4>; + interrupt-parent = <&GIC>; + max-frequency = <50000000>; + }; + + }; // ps7io@e0000000 +}; + Modified: head/sys/dev/cadence/if_cgem.c ============================================================================== --- head/sys/dev/cadence/if_cgem.c Tue Apr 26 23:02:18 2016 (r298673) +++ head/sys/dev/cadence/if_cgem.c Tue Apr 26 23:09:47 2016 (r298674) @@ -1630,6 +1630,9 @@ static int cgem_probe(device_t dev) { + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (!ofw_bus_is_compatible(dev, "cadence,gem")) return (ENXIO); From owner-svn-src-head@freebsd.org Tue Apr 26 23:13:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43E60B1DAD1; Tue, 26 Apr 2016 23:13:50 +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 05E331888; Tue, 26 Apr 2016 23:13:49 +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 u3QNDnTm088351; Tue, 26 Apr 2016 23:13:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QNDnpF088349; Tue, 26 Apr 2016 23:13:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262313.u3QNDnpF088349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 23:13:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298675 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 23:13:50 -0000 Author: cem Date: Tue Apr 26 23:13:48 2016 New Revision: 298675 URL: https://svnweb.freebsd.org/changeset/base/298675 Log: in_lltable_alloc and in6 copy: Don't leak LLE in error path Fix a memory leak in error conditions introduced in r292978. Reported by: Coverity CIDs: 1347009, 1347010 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/netinet/in.c head/sys/netinet6/in6.c Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Apr 26 23:09:47 2016 (r298674) +++ head/sys/netinet/in.c Tue Apr 26 23:13:48 2016 (r298675) @@ -1004,6 +1004,17 @@ struct in_llentry { /* * Do actual deallocation of @lle. + */ +static void +in_lltable_destroy_lle_unlocked(struct llentry *lle) +{ + + LLE_LOCK_DESTROY(lle); + LLE_REQ_DESTROY(lle); + free(lle, M_LLTABLE); +} + +/* * Called by LLE_FREE_LOCKED when number of references * drops to zero. */ @@ -1012,9 +1023,7 @@ in_lltable_destroy_lle(struct llentry *l { LLE_WUNLOCK(lle); - LLE_LOCK_DESTROY(lle); - LLE_REQ_DESTROY(lle); - free(lle, M_LLTABLE); + in_lltable_destroy_lle_unlocked(lle); } static struct llentry * @@ -1277,8 +1286,10 @@ in_lltable_alloc(struct lltable *llt, u_ if ((flags & LLE_IFADDR) == LLE_IFADDR) { linkhdrsize = LLE_MAX_LINKHDR; if (lltable_calc_llheader(ifp, AF_INET, IF_LLADDR(ifp), - linkhdr, &linkhdrsize, &lladdr_off) != 0) + linkhdr, &linkhdrsize, &lladdr_off) != 0) { + in_lltable_destroy_lle_unlocked(lle); return (NULL); + } lltable_set_entry_addr(ifp, lle, linkhdr, linkhdrsize, lladdr_off); lle->la_flags |= LLE_STATIC; Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Apr 26 23:09:47 2016 (r298674) +++ head/sys/netinet6/in6.c Tue Apr 26 23:13:48 2016 (r298675) @@ -2056,6 +2056,17 @@ struct in6_llentry { /* * Do actual deallocation of @lle. + */ +static void +in6_lltable_destroy_lle_unlocked(struct llentry *lle) +{ + + LLE_LOCK_DESTROY(lle); + LLE_REQ_DESTROY(lle); + free(lle, M_LLTABLE); +} + +/* * Called by LLE_FREE_LOCKED when number of references * drops to zero. */ @@ -2064,9 +2075,7 @@ in6_lltable_destroy_lle(struct llentry * { LLE_WUNLOCK(lle); - LLE_LOCK_DESTROY(lle); - LLE_REQ_DESTROY(lle); - free(lle, M_LLTABLE); + in6_lltable_destroy_lle_unlocked(lle); } static struct llentry * @@ -2270,8 +2279,10 @@ in6_lltable_alloc(struct lltable *llt, u if ((flags & LLE_IFADDR) == LLE_IFADDR) { linkhdrsize = LLE_MAX_LINKHDR; if (lltable_calc_llheader(ifp, AF_INET6, IF_LLADDR(ifp), - linkhdr, &linkhdrsize, &lladdr_off) != 0) + linkhdr, &linkhdrsize, &lladdr_off) != 0) { + in6_lltable_destroy_lle_unlocked(lle); return (NULL); + } lltable_set_entry_addr(ifp, lle, linkhdr, linkhdrsize, lladdr_off); lle->la_flags |= LLE_STATIC; From owner-svn-src-head@freebsd.org Tue Apr 26 23:23:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2464B1DCD2; Tue, 26 Apr 2016 23:23:45 +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 C30F11EEF; Tue, 26 Apr 2016 23:23:45 +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 u3QNNi9h091296; Tue, 26 Apr 2016 23:23:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QNNi2d091295; Tue, 26 Apr 2016 23:23:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262323.u3QNNi2d091295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 23:23:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298676 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 23:23:46 -0000 Author: cem Date: Tue Apr 26 23:23:44 2016 New Revision: 298676 URL: https://svnweb.freebsd.org/changeset/base/298676 Log: netipsec: Don't leak memory when deep copy fails Reported by: Coverity CID: 1331693 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/netipsec/ipsec.c Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Tue Apr 26 23:13:48 2016 (r298675) +++ head/sys/netipsec/ipsec.c Tue Apr 26 23:23:44 2016 (r298676) @@ -977,6 +977,7 @@ fail: ipsec_delisr(p); p = NULL; } + KEY_FREESP(&dst); return (NULL); } From owner-svn-src-head@freebsd.org Tue Apr 26 23:58:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D8FB1D5AD; Tue, 26 Apr 2016 23:58:56 +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 232A81D1D; Tue, 26 Apr 2016 23:58:56 +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 u3QNwtYR000332; Tue, 26 Apr 2016 23:58:55 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3QNwtUO000331; Tue, 26 Apr 2016 23:58:55 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604262358.u3QNwtUO000331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Tue, 26 Apr 2016 23:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298677 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2016 23:58:56 -0000 Author: cem Date: Tue Apr 26 23:58:55 2016 New Revision: 298677 URL: https://svnweb.freebsd.org/changeset/base/298677 Log: subr_mbpool: Don't free bogus pointer in error paths An mbpool is allocated with a contiguous array of mbpages. Freeing an individual mbpage has never been valid. Don't do it. This bug has been present since this code was introduced in r117624 (2003). Reported by: Coverity CID: 1009687 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/subr_mbpool.c Modified: head/sys/kern/subr_mbpool.c ============================================================================== --- head/sys/kern/subr_mbpool.c Tue Apr 26 23:23:44 2016 (r298676) +++ head/sys/kern/subr_mbpool.c Tue Apr 26 23:58:55 2016 (r298677) @@ -210,16 +210,13 @@ mbp_alloc_page(struct mbpool *p) pg = &p->pages[p->npages]; error = bus_dmamem_alloc(p->dmat, &pg->va, BUS_DMA_NOWAIT, &pg->map); - if (error != 0) { - free(pg, M_MBPOOL); + if (error != 0) return; - } error = bus_dmamap_load(p->dmat, pg->map, pg->va, p->page_size, mbp_callback, &pg->phy, 0); if (error != 0) { bus_dmamem_free(p->dmat, pg->va, pg->map); - free(pg, M_MBPOOL); return; } From owner-svn-src-head@freebsd.org Wed Apr 27 00:10:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07CD8B1D7E5; Wed, 27 Apr 2016 00:10:34 +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 CCF981211; Wed, 27 Apr 2016 00:10:33 +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 u3R0AXm7003653; Wed, 27 Apr 2016 00:10:33 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R0AX4G003652; Wed, 27 Apr 2016 00:10:33 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604270010.u3R0AX4G003652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 27 Apr 2016 00:10:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298678 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 00:10:34 -0000 Author: cem Date: Wed Apr 27 00:10:32 2016 New Revision: 298678 URL: https://svnweb.freebsd.org/changeset/base/298678 Log: posix4_mib: Don't overrun facility_initialized array The facility_initialized and facility arrays are the same size and were intended to be indexed the same. I believe this mismatch was just a typo/braino in r208731. Reported by: Coverity CID: 1017430 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/posix4_mib.c Modified: head/sys/kern/posix4_mib.c ============================================================================== --- head/sys/kern/posix4_mib.c Tue Apr 26 23:58:55 2016 (r298677) +++ head/sys/kern/posix4_mib.c Wed Apr 27 00:10:32 2016 (r298678) @@ -113,9 +113,9 @@ p31b_sysctl_proc(SYSCTL_HANDLER_ARGS) num = arg2; if (!P31B_VALID(num)) return (EINVAL); - val = facility_initialized[num] ? facility[num - 1] : 0; + val = facility_initialized[num - 1] ? facility[num - 1] : 0; error = sysctl_handle_int(oidp, &val, 0, req); - if (error == 0 && req->newptr != NULL && facility_initialized[num]) + if (error == 0 && req->newptr != NULL && facility_initialized[num - 1]) facility[num - 1] = val; return (error); } @@ -137,7 +137,7 @@ p31b_unsetcfg(int num) { facility[num - 1] = 0; - facility_initialized[num -1] = 0; + facility_initialized[num - 1] = 0; } int From owner-svn-src-head@freebsd.org Wed Apr 27 01:32:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43A81B1D611; Wed, 27 Apr 2016 01:32:13 +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 06FBE127D; Wed, 27 Apr 2016 01:32:12 +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 u3R1WCPT030212; Wed, 27 Apr 2016 01:32:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R1WCd9030211; Wed, 27 Apr 2016 01:32:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604270132.u3R1WCd9030211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Apr 2016 01:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298679 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 01:32:13 -0000 Author: pfg Date: Wed Apr 27 01:32:11 2016 New Revision: 298679 URL: https://svnweb.freebsd.org/changeset/base/298679 Log: fsck_ffs: Revert partially the unsigned changes. Any value of uint16_t will be internally promoted to int so changing them to an unsigned value doesn't help. Make clear we want to use uint32_t for closedisk() X-MFC with: r298551 Modified: head/sbin/fsck_ffs/suj.c Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Wed Apr 27 00:10:32 2016 (r298678) +++ head/sbin/fsck_ffs/suj.c Wed Apr 27 01:32:11 2016 (r298679) @@ -217,7 +217,7 @@ static void closedisk(const char *devnam) { struct csum *cgsum; - u_int i; + uint32_t i; /* * Recompute the fs summary info from correct cs summaries. @@ -2252,7 +2252,7 @@ suj_build(void) struct suj_seg *seg; union jrec *rec; int off; - u_int i; + int i; TAILQ_FOREACH(seg, &allsegs, ss_next) { if (debug) @@ -2540,7 +2540,7 @@ suj_read(void) struct jsegrec *rec; ufs2_daddr_t blk; int readsize; - u_int blocks; + int blocks; int recsize; int size; u_int i; From owner-svn-src-head@freebsd.org Wed Apr 27 01:36:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42986B1D6AB; Wed, 27 Apr 2016 01:36: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 0936514AE; Wed, 27 Apr 2016 01:36:26 +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 u3R1aQpj030409; Wed, 27 Apr 2016 01:36:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R1aQGF030408; Wed, 27 Apr 2016 01:36:26 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604270136.u3R1aQGF030408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Apr 2016 01:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298680 - head/sbin/fsck_ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 01:36:27 -0000 Author: pfg Date: Wed Apr 27 01:36:25 2016 New Revision: 298680 URL: https://svnweb.freebsd.org/changeset/base/298680 Log: fsck_ffs: Revert partially the unsigned changes. Any value of uint16_t will be internally promoted to int so changing them to an unsigned value doesn't help. Missing revert value in suj_read(). X-MFC with: r298551 Modified: head/sbin/fsck_ffs/suj.c Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Wed Apr 27 01:32:11 2016 (r298679) +++ head/sbin/fsck_ffs/suj.c Wed Apr 27 01:36:25 2016 (r298680) @@ -2543,7 +2543,7 @@ suj_read(void) int blocks; int recsize; int size; - u_int i; + int i; /* * Read records until we exhaust the journal space. If we find From owner-svn-src-head@freebsd.org Wed Apr 27 02:02:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23CF0B1DB8E; Wed, 27 Apr 2016 02:02:46 +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 EA7261113; Wed, 27 Apr 2016 02:02:45 +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 u3R22jVQ039369; Wed, 27 Apr 2016 02:02:45 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R22jZ5039368; Wed, 27 Apr 2016 02:02:45 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604270202.u3R22jZ5039368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 27 Apr 2016 02:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298681 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 02:02:46 -0000 Author: araujo Date: Wed Apr 27 02:02:44 2016 New Revision: 298681 URL: https://svnweb.freebsd.org/changeset/base/298681 Log: Use macro MIN() from sys/param.h. MFC after: 2 weeks. Modified: head/sbin/ifconfig/sfp.c Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Wed Apr 27 01:36:25 2016 (r298680) +++ head/sbin/ifconfig/sfp.c Wed Apr 27 02:02:44 2016 (r298681) @@ -738,7 +738,7 @@ read_i2c(struct i2c_info *ii, uint8_t ad req.len = len; while (len > 0) { - l = (len > sizeof(req.data)) ? sizeof(req.data) : len; + l = MIN(sizeof(req.data), len); req.len = l; if (ioctl(ii->fd, SIOCGI2C, ii->ifr) != 0) { ii->error = errno; @@ -762,7 +762,7 @@ dump_i2c_data(struct i2c_info *ii, uint8 while (len > 0) { memset(buf, 0, sizeof(buf)); - read = (len > sizeof(buf)) ? sizeof(buf) : len; + read = MIN(sizeof(buf), len); read_i2c(ii, addr, off, read, buf); if (ii->error != 0) { fprintf(stderr, "Error reading i2c info\n"); From owner-svn-src-head@freebsd.org Wed Apr 27 02:13:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D0F4B1DE92; Wed, 27 Apr 2016 02:13:58 +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 505D918BF; Wed, 27 Apr 2016 02:13:58 +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 u3R2DvRt042407; Wed, 27 Apr 2016 02:13:57 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R2DvH8042406; Wed, 27 Apr 2016 02:13:57 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604270213.u3R2DvH8042406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 27 Apr 2016 02:13:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298682 - head/usr.bin/quota X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 02:13:58 -0000 Author: araujo Date: Wed Apr 27 02:13:57 2016 New Revision: 298682 URL: https://svnweb.freebsd.org/changeset/base/298682 Log: Use MIN() macro from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/quota/quota.c Modified: head/usr.bin/quota/quota.c ============================================================================== --- head/usr.bin/quota/quota.c Wed Apr 27 02:02:44 2016 (r298681) +++ head/usr.bin/quota/quota.c Wed Apr 27 02:13:57 2016 (r298682) @@ -266,8 +266,8 @@ prthumanval(int len, u_int64_t bytes) /* * Limit the width to 5 bytes as that is what users expect. */ - humanize_number(buf, sizeof(buf) < 5 ? sizeof(buf) : 5, bytes, "", - HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); + humanize_number(buf, MIN(sizeof(buf), 5), bytes, "", + HN_AUTOSCALE, HN_B | HN_NOSPACE | HN_DECIMAL); (void)printf(" %*s", len, buf); } From owner-svn-src-head@freebsd.org Wed Apr 27 02:25:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B31CB1D10B; Wed, 27 Apr 2016 02:25:22 +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 77CF51D7C; Wed, 27 Apr 2016 02:25:22 +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 u3R2PLI5045460; Wed, 27 Apr 2016 02:25:21 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R2PLG9045458; Wed, 27 Apr 2016 02:25:21 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604270225.u3R2PLG9045458@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Wed, 27 Apr 2016 02:25:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298683 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 02:25:22 -0000 Author: jamie Date: Wed Apr 27 02:25:21 2016 New Revision: 298683 URL: https://svnweb.freebsd.org/changeset/base/298683 Log: Delay revmoing the last jail reference in prison_proc_free, and instead put it off into the pr_task. This is similar to prison_free, and in fact uses the same task even though they do something slightly different. This resolves a LOR between the process lock and allprison_lock, which came about in r298565. PR: 48471 Modified: head/sys/kern/kern_jail.c head/sys/sys/jail.h Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Wed Apr 27 02:13:57 2016 (r298682) +++ head/sys/kern/kern_jail.c Wed Apr 27 02:25:21 2016 (r298683) @@ -1328,6 +1328,7 @@ kern_jail_set(struct thread *td, struct LIST_INIT(&pr->pr_children); mtx_init(&pr->pr_mtx, "jail mutex", NULL, MTX_DEF | MTX_DUPOK); + TASK_INIT(&pr->pr_task, 0, prison_complete, pr); #ifdef VIMAGE /* Allocate a new vnet if specified. */ @@ -2575,16 +2576,13 @@ prison_allow(struct ucred *cred, unsigne void prison_free_locked(struct prison *pr) { + int ref; mtx_assert(&pr->pr_mtx, MA_OWNED); - pr->pr_ref--; - if (pr->pr_ref == 0) { - mtx_unlock(&pr->pr_mtx); - TASK_INIT(&pr->pr_task, 0, prison_complete, pr); - taskqueue_enqueue(taskqueue_thread, &pr->pr_task); - return; - } + ref = --pr->pr_ref; mtx_unlock(&pr->pr_mtx); + if (ref == 0) + taskqueue_enqueue(taskqueue_thread, &pr->pr_task); } void @@ -2595,11 +2593,17 @@ prison_free(struct prison *pr) prison_free_locked(pr); } +/* + * Complete a call to either prison_free or prison_proc_free. + */ static void prison_complete(void *context, int pending) { + struct prison *pr = context; - prison_deref((struct prison *)context, 0); + mtx_lock(&pr->pr_mtx); + prison_deref(pr, pr->pr_uref + ? PD_DEREF | PD_DEUREF | PD_LOCKED : PD_LOCKED); } /* @@ -2618,6 +2622,9 @@ prison_deref(struct prison *pr, int flag mtx_lock(&pr->pr_mtx); for (;;) { if (flags & PD_DEUREF) { + KASSERT(pr->pr_uref > 0, + ("prison_deref PD_DEUREF on a dead prison (jid=%d)", + pr->pr_id)); pr->pr_uref--; lasturef = pr->pr_uref == 0; if (lasturef) @@ -2625,8 +2632,12 @@ prison_deref(struct prison *pr, int flag KASSERT(prison0.pr_uref != 0, ("prison0 pr_uref=0")); } else lasturef = 0; - if (flags & PD_DEREF) + if (flags & PD_DEREF) { + KASSERT(pr->pr_ref > 0, + ("prison_deref PD_DEREF on a dead prison (jid=%d)", + pr->pr_id)); pr->pr_ref--; + } ref = pr->pr_ref; mtx_unlock(&pr->pr_mtx); @@ -2740,7 +2751,20 @@ prison_proc_free(struct prison *pr) mtx_lock(&pr->pr_mtx); KASSERT(pr->pr_uref > 0, ("Trying to kill a process in a dead prison (jid=%d)", pr->pr_id)); - prison_deref(pr, PD_DEUREF | PD_LOCKED); + if (pr->pr_uref > 1) + pr->pr_uref--; + else { + /* + * Don't remove the last user reference in this context, which + * is expected to be a process that is not only locked, but + * also half dead. + */ + pr->pr_ref++; + mtx_unlock(&pr->pr_mtx); + taskqueue_enqueue(taskqueue_thread, &pr->pr_task); + return; + } + mtx_unlock(&pr->pr_mtx); } Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Wed Apr 27 02:13:57 2016 (r298682) +++ head/sys/sys/jail.h Wed Apr 27 02:25:21 2016 (r298683) @@ -149,7 +149,6 @@ struct prison_racct; * (p) locked by pr_mtx * (c) set only during creation before the structure is shared, no mutex * required to read - * (d) set only during destruction of jail, no mutex needed */ struct prison { TAILQ_ENTRY(prison) pr_list; /* (a) all prisons */ @@ -161,7 +160,7 @@ struct prison { LIST_ENTRY(prison) pr_sibling; /* (a) next in parent's list */ struct prison *pr_parent; /* (c) containing jail */ struct mtx pr_mtx; - struct task pr_task; /* (d) destroy task */ + struct task pr_task; /* (c) destroy task */ struct osd pr_osd; /* (p) additional data */ struct cpuset *pr_cpuset; /* (p) cpuset */ struct vnet *pr_vnet; /* (c) network stack */ From owner-svn-src-head@freebsd.org Wed Apr 27 02:26:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 825CCB1D197; Wed, 27 Apr 2016 02:26:32 +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 4FE361F04; Wed, 27 Apr 2016 02:26:32 +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 u3R2QVH3045560; Wed, 27 Apr 2016 02:26:31 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R2QVjU045559; Wed, 27 Apr 2016 02:26:31 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604270226.u3R2QVjU045559@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 27 Apr 2016 02:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298684 - head/usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 02:26:32 -0000 Author: araujo Date: Wed Apr 27 02:26:31 2016 New Revision: 298684 URL: https://svnweb.freebsd.org/changeset/base/298684 Log: Use macro MIN() from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/systat/main.c Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Wed Apr 27 02:25:21 2016 (r298683) +++ head/usr.bin/systat/main.c Wed Apr 27 02:26:31 2016 (r298684) @@ -276,7 +276,7 @@ display(void) c = '|'; dellave = avenrun[0]; wmove(wload, 0, 0); wclrtoeol(wload); - for (i = (j > 50) ? 50 : j; i > 0; i--) + for (i = MIN(j, 50); i > 0; i--) waddch(wload, c); if (j > 50) wprintw(wload, " %4.1f", avenrun[0]); From owner-svn-src-head@freebsd.org Wed Apr 27 02:34:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 554ECB1D3BB; Wed, 27 Apr 2016 02:34:26 +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 26D2A12D6; Wed, 27 Apr 2016 02:34:26 +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 u3R2YPTp048500; Wed, 27 Apr 2016 02:34:25 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R2YPKi048499; Wed, 27 Apr 2016 02:34:25 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604270234.u3R2YPKi048499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 27 Apr 2016 02:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298685 - head/usr.bin/tftp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 02:34:26 -0000 Author: araujo Date: Wed Apr 27 02:34:25 2016 New Revision: 298685 URL: https://svnweb.freebsd.org/changeset/base/298685 Log: Use MIN() macro from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/tftp/main.c Modified: head/usr.bin/tftp/main.c ============================================================================== --- head/usr.bin/tftp/main.c Wed Apr 27 02:26:31 2016 (r298684) +++ head/usr.bin/tftp/main.c Wed Apr 27 02:34:25 2016 (r298685) @@ -727,7 +727,7 @@ command(void) if (vrbose) { if ((bp = el_gets(el, &num)) == NULL || num == 0) exit(0); - len = (num > MAXLINE) ? MAXLINE : num; + len = MIN(MAXLINE, num); memcpy(line, bp, len); line[len] = '\0'; history(hist, &he, H_ENTER, bp); From owner-svn-src-head@freebsd.org Wed Apr 27 02:44:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03B1DB1D60A; Wed, 27 Apr 2016 02:44:12 +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 C9FEC18BD; Wed, 27 Apr 2016 02:44:11 +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 u3R2iBJ2051694; Wed, 27 Apr 2016 02:44:11 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R2iBRn051693; Wed, 27 Apr 2016 02:44:11 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604270244.u3R2iBRn051693@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 27 Apr 2016 02:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298686 - head/usr.bin/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 02:44:12 -0000 Author: araujo Date: Wed Apr 27 02:44:10 2016 New Revision: 298686 URL: https://svnweb.freebsd.org/changeset/base/298686 Log: Use MIN() macro from sys/param.h. MFC after: 2 weeks. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Wed Apr 27 02:34:25 2016 (r298685) +++ head/usr.bin/top/machine.c Wed Apr 27 02:44:10 2016 (r298686) @@ -1023,7 +1023,7 @@ format_next_process(caddr_t handle, char continue; len = (argbuflen - (dst - argbuf) - 1) / 4; strvisx(dst, src, - strlen(src) < len ? strlen(src) : len, + MIN(strlen(src), len), VIS_NL | VIS_CSTYLE); while (*dst != '\0') dst++; From owner-svn-src-head@freebsd.org Wed Apr 27 03:06:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8718CB1D9CC; Wed, 27 Apr 2016 03:06:54 +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 423691485; Wed, 27 Apr 2016 03:06:54 +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 u3R36rrT058242; Wed, 27 Apr 2016 03:06:53 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R36rcM058240; Wed, 27 Apr 2016 03:06:53 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201604270306.u3R36rcM058240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Wed, 27 Apr 2016 03:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298687 - head/usr.sbin/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 03:06:54 -0000 Author: araujo Date: Wed Apr 27 03:06:53 2016 New Revision: 298687 URL: https://svnweb.freebsd.org/changeset/base/298687 Log: For pointers use NULL instead of 0. Reviewed by: rpaulo MFC after: 2 weeks. Differential Revision: https://reviews.freebsd.org/D5946 Modified: head/usr.sbin/config/mkmakefile.c head/usr.sbin/config/mkoptions.c Modified: head/usr.sbin/config/mkmakefile.c ============================================================================== --- head/usr.sbin/config/mkmakefile.c Wed Apr 27 02:44:10 2016 (r298686) +++ head/usr.sbin/config/mkmakefile.c Wed Apr 27 03:06:53 2016 (r298687) @@ -111,11 +111,11 @@ open_makefile_template(void) snprintf(line, sizeof(line), "../../conf/Makefile.%s", machinename); ifp = fopen(line, "r"); - if (ifp == 0) { + if (ifp == NULL) { snprintf(line, sizeof(line), "Makefile.%s", machinename); ifp = fopen(line, "r"); } - if (ifp == 0) + if (ifp == NULL) err(1, "%s", line); return (ifp); } @@ -133,7 +133,7 @@ makefile(void) read_files(); ifp = open_makefile_template(); ofp = fopen(path("Makefile.new"), "w"); - if (ofp == 0) + if (ofp == NULL) err(1, "%s", path("Makefile.new")); fprintf(ofp, "KERN_IDENT=%s\n", ident); fprintf(ofp, "MACHINE=%s\n", machinename); @@ -313,7 +313,7 @@ read_file(char *fname) imp_rule, no_obj, before_depend, nowerror; fp = fopen(fname, "r"); - if (fp == 0) + if (fp == NULL) err(1, "%s", fname); next: /* @@ -330,7 +330,7 @@ next: (void) fclose(fp); return; } - if (wd == 0) + if (wd == NULL) goto next; if (wd[0] == '#') { @@ -340,7 +340,7 @@ next: } if (eq(wd, "include")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) + if (wd == (char *)EOF || wd == NULL) errout("%s: missing include filename.\n", fname); (void) snprintf(ifname, sizeof(ifname), "../../%s", wd); read_file(ifname); @@ -352,7 +352,7 @@ next: wd = get_word(fp); if (wd == (char *)EOF) return; - if (wd == 0) + if (wd == NULL) errout("%s: No type for %s.\n", fname, this); tp = fl_lookup(this); compile = 0; @@ -396,7 +396,7 @@ next: continue; } if (eq(wd, "no-implicit-rule")) { - if (compilewith == 0) + if (compilewith == NULL) errout("%s: alternate rule required when " "\"no-implicit-rule\" is specified for" " %s.\n", @@ -410,7 +410,7 @@ next: } if (eq(wd, "dependency")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) + if (wd == (char *)EOF || wd == NULL) errout("%s: %s missing dependency string.\n", fname, this); depends = ns(wd); @@ -418,7 +418,7 @@ next: } if (eq(wd, "clean")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) + if (wd == (char *)EOF || wd == NULL) errout("%s: %s missing clean file list.\n", fname, this); clean = ns(wd); @@ -426,7 +426,7 @@ next: } if (eq(wd, "compile-with")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) + if (wd == (char *)EOF || wd == NULL) errout("%s: %s missing compile command string.\n", fname, this); compilewith = ns(wd); @@ -434,7 +434,7 @@ next: } if (eq(wd, "warning")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) + if (wd == (char *)EOF || wd == NULL) errout("%s: %s missing warning text string.\n", fname, this); warning = ns(wd); @@ -442,7 +442,7 @@ next: } if (eq(wd, "obj-prefix")) { wd = get_quoted_word(fp); - if (wd == (char *)EOF || wd == 0) + if (wd == (char *)EOF || wd == NULL) errout("%s: %s missing object prefix string.\n", fname, this); objprefix = ns(wd); @@ -653,7 +653,7 @@ tail(char *fn) char *cp; cp = strrchr(fn, '/'); - if (cp == 0) + if (cp == NULL) return (fn); return (cp+1); } @@ -707,7 +707,7 @@ do_rules(FILE *f) } } compilewith = ftp->f_compilewith; - if (compilewith == 0) { + if (compilewith == NULL) { const char *ftype = NULL; switch (ftp->f_type) { Modified: head/usr.sbin/config/mkoptions.c ============================================================================== --- head/usr.sbin/config/mkoptions.c Wed Apr 27 02:44:10 2016 (r298686) +++ head/usr.sbin/config/mkoptions.c Wed Apr 27 03:06:53 2016 (r298687) @@ -172,9 +172,9 @@ do_option(char *name) remember(file); inf = fopen(file, "r"); - if (inf == 0) { + if (inf == NULL) { outf = fopen(file, "w"); - if (outf == 0) + if (outf == NULL) err(1, "%s", file); /* was the option in the config file? */ @@ -200,14 +200,14 @@ do_option(char *name) char *invalue; /* get the #define */ - if ((inw = get_word(inf)) == 0 || inw == (char *)EOF) + if ((inw = get_word(inf)) == NULL || inw == (char *)EOF) break; /* get the option name */ - if ((inw = get_word(inf)) == 0 || inw == (char *)EOF) + if ((inw = get_word(inf)) == NULL || inw == (char *)EOF) break; inw = ns(inw); /* get the option value */ - if ((cp = get_word(inf)) == 0 || cp == (char *)EOF) + if ((cp = get_word(inf)) == NULL || cp == (char *)EOF) break; /* option value */ invalue = ns(cp); /* malloced */ @@ -267,7 +267,7 @@ do_option(char *name) } outf = fopen(file, "w"); - if (outf == 0) + if (outf == NULL) err(1, "%s", file); while (!SLIST_EMPTY(&op_head)) { op = SLIST_FIRST(&op_head); @@ -366,10 +366,10 @@ read_option_file(const char *fname, int char genopt[MAXPATHLEN]; fp = fopen(fname, "r"); - if (fp == 0) + if (fp == NULL) return (0); while ((wd = get_word(fp)) != (char *)EOF) { - if (wd == 0) + if (wd == NULL) continue; if (wd[0] == '#') { while (((wd = get_word(fp)) != (char *)EOF) && wd) @@ -380,7 +380,7 @@ read_option_file(const char *fname, int val = get_word(fp); if (val == (char *)EOF) return (1); - if (val == 0) { + if (val == NULL) { if (flags) { fprintf(stderr, "%s: compat file requires two" " words per line at %s\n", fname, this); From owner-svn-src-head@freebsd.org Wed Apr 27 04:51:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 061DAB1CD77; Wed, 27 Apr 2016 04:51:30 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2F161C83; Wed, 27 Apr 2016 04:51:29 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3R4pSfQ090962; Wed, 27 Apr 2016 04:51:28 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R4pSa4090960; Wed, 27 Apr 2016 04:51:28 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604270451.u3R4pSa4090960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Apr 2016 04:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298688 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 04:51:30 -0000 Author: sephe Date: Wed Apr 27 04:51:28 2016 New Revision: 298688 URL: https://svnweb.freebsd.org/changeset/base/298688 Log: hyperv/hn: Restart sending earlier once we gathered some free TX descs This greatly reduces the oqdrops under heavy workload. For TCP send/recv test (10K concurrent connections): oqdrops is reduced by 17% on sending side, and 57% on receiving side. For nginx-1.8/wrk-4 1KB object test (10K concurrent connections, 4 requests/connection): oqdrops is reduced by 44% on nginx side, and 10% on wrk side. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Apr 27 03:06:53 2016 (r298687) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Apr 27 04:51:28 2016 (r298688) @@ -1185,7 +1185,8 @@ struct hn_tx_ring { #endif int hn_txdesc_cnt; int hn_txdesc_avail; - int hn_has_txeof; + u_short hn_has_txeof; + u_short hn_txdone_cnt; int hn_sched_tx; void (*hn_txeof)(struct hn_tx_ring *); Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Apr 27 03:06:53 2016 (r298687) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Apr 27 04:51:28 2016 (r298688) @@ -155,6 +155,8 @@ __FBSDID("$FreeBSD$"); #define HN_DIRECT_TX_SIZE_DEF 128 +#define HN_EARLY_TXEOF_THRESH 8 + struct hn_txdesc { #ifndef HN_USE_TXDESC_BUFRING SLIST_ENTRY(hn_txdesc) link; @@ -793,6 +795,13 @@ hn_txdesc_hold(struct hn_txdesc *txd) atomic_add_int(&txd->refs, 1); } +static __inline void +hn_txeof(struct hn_tx_ring *txr) +{ + txr->hn_has_txeof = 0; + txr->hn_txeof(txr); +} + static void hn_tx_done(struct hv_vmbus_channel *chan, void *xpkt) { @@ -811,6 +820,13 @@ hn_tx_done(struct hv_vmbus_channel *chan txr->hn_has_txeof = 1; hn_txdesc_put(txr, txd); + + ++txr->hn_txdone_cnt; + if (txr->hn_txdone_cnt >= HN_EARLY_TXEOF_THRESH) { + txr->hn_txdone_cnt = 0; + if (txr->hn_oactive) + hn_txeof(txr); + } } void @@ -831,8 +847,8 @@ netvsc_channel_rollup(struct hv_vmbus_ch if (txr == NULL || !txr->hn_has_txeof) return; - txr->hn_has_txeof = 0; - txr->hn_txeof(txr); + txr->hn_txdone_cnt = 0; + hn_txeof(txr); } /* From owner-svn-src-head@freebsd.org Wed Apr 27 05:05:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9DACB1CFE9; Wed, 27 Apr 2016 05:05:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A0FD12EA; Wed, 27 Apr 2016 05:05:55 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3R55sxb094291; Wed, 27 Apr 2016 05:05:54 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R55s2e094290; Wed, 27 Apr 2016 05:05:54 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604270505.u3R55s2e094290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Apr 2016 05:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298689 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 05:05:55 -0000 Author: sephe Date: Wed Apr 27 05:05:54 2016 New Revision: 298689 URL: https://svnweb.freebsd.org/changeset/base/298689 Log: hyperv/hn: Remove unapplied comment. Chimney sending buffers are shared across channels. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Apr 27 04:51:28 2016 (r298688) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Apr 27 05:05:54 2016 (r298689) @@ -998,8 +998,6 @@ hn_encap(struct hn_tx_ring *txr, struct /* * Chimney send, if the packet could fit into one chimney buffer. - * - * TODO: vRSS, chimney buffer should be per-channel. */ if (packet->tot_data_buf_len < txr->hn_tx_chimney_size) { netvsc_dev *net_dev = txr->hn_sc->net_dev; From owner-svn-src-head@freebsd.org Wed Apr 27 05:18:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E130B1D1E7; Wed, 27 Apr 2016 05:18:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 540871885; Wed, 27 Apr 2016 05:18:05 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3R5I4sL097311; Wed, 27 Apr 2016 05:18:04 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R5I49q097310; Wed, 27 Apr 2016 05:18:04 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604270518.u3R5I49q097310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Apr 2016 05:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298690 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 05:18:05 -0000 Author: sephe Date: Wed Apr 27 05:18:04 2016 New Revision: 298690 URL: https://svnweb.freebsd.org/changeset/base/298690 Log: hyperv/hn: Mark sysctls MPSAFE MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Apr 27 05:05:54 2016 (r298689) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Apr 27 05:18:04 2016 (r298690) @@ -214,7 +214,8 @@ struct hn_txdesc { int hv_promisc_mode = 0; /* normal mode by default */ -SYSCTL_NODE(_hw, OID_AUTO, hn, CTLFLAG_RD, NULL, "Hyper-V network interface"); +SYSCTL_NODE(_hw, OID_AUTO, hn, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, + "Hyper-V network interface"); /* Trust tcp segements verification on host side. */ static int hn_trust_hosttcp = 1; @@ -2170,7 +2171,7 @@ hn_create_rx_data(struct hn_softc *sc, i /* Create dev.hn.UNIT.rx sysctl tree */ sc->hn_rx_sysctl_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "rx", - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { struct hn_rx_ring *rxr = &sc->hn_rx_ring[i]; @@ -2210,7 +2211,7 @@ hn_create_rx_data(struct hn_softc *sc, i snprintf(name, sizeof(name), "%d", i); rxr->hn_rx_sysctl_tree = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(sc->hn_rx_sysctl_tree), - OID_AUTO, name, CTLFLAG_RD, 0, ""); + OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (rxr->hn_rx_sysctl_tree != NULL) { SYSCTL_ADD_ULONG(ctx, @@ -2222,59 +2223,61 @@ hn_create_rx_data(struct hn_softc *sc, i } SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_queued", - CTLTYPE_U64 | CTLFLAG_RW, sc, + CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_queued), hn_rx_stat_u64_sysctl, "LU", "LRO queued"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_flushed", - CTLTYPE_U64 | CTLFLAG_RW, sc, + CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_flushed), hn_rx_stat_u64_sysctl, "LU", "LRO flushed"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_tried", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_lro_tried), hn_rx_stat_ulong_sysctl, "LU", "# of LRO tries"); #if __FreeBSD_version >= 1100099 SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_length_lim", - CTLTYPE_UINT | CTLFLAG_RW, sc, 0, hn_lro_lenlim_sysctl, "IU", + CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, + hn_lro_lenlim_sysctl, "IU", "Max # of data bytes to be aggregated by LRO"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_ackcnt_lim", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_lro_ackcnt_sysctl, "I", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, + hn_lro_ackcnt_sysctl, "I", "Max # of ACKs to be aggregated by LRO"); #endif SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hosttcp", - CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_TCP, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, HN_TRUST_HCSUM_TCP, hn_trust_hcsum_sysctl, "I", "Trust tcp segement verification on host side, " "when csum info is missing"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostudp", - CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_UDP, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, HN_TRUST_HCSUM_UDP, hn_trust_hcsum_sysctl, "I", "Trust udp datagram verification on host side, " "when csum info is missing"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "trust_hostip", - CTLTYPE_INT | CTLFLAG_RW, sc, HN_TRUST_HCSUM_IP, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, HN_TRUST_HCSUM_IP, hn_trust_hcsum_sysctl, "I", "Trust ip packet verification on host side, " "when csum info is missing"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_ip", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_csum_ip), hn_rx_stat_ulong_sysctl, "LU", "RXCSUM IP"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_tcp", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_csum_tcp), hn_rx_stat_ulong_sysctl, "LU", "RXCSUM TCP"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_udp", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_csum_udp), hn_rx_stat_ulong_sysctl, "LU", "RXCSUM UDP"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "csum_trusted", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_csum_trusted), hn_rx_stat_ulong_sysctl, "LU", "# of packets that we trust host's csum verification"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "small_pkts", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_rx_ring, hn_small_pkts), hn_rx_stat_ulong_sysctl, "LU", "# of small packets received"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "rx_ring_cnt", @@ -2467,7 +2470,7 @@ hn_create_tx_ring(struct hn_softc *sc, i snprintf(name, sizeof(name), "%d", id); txr->hn_tx_sysctl_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, - name, CTLFLAG_RD, 0, ""); + name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (txr->hn_tx_sysctl_tree != NULL) { child = SYSCTL_CHILDREN(txr->hn_tx_sysctl_tree); @@ -2562,7 +2565,7 @@ hn_create_tx_data(struct hn_softc *sc, i /* Create dev.hn.UNIT.tx sysctl tree */ sc->hn_tx_sysctl_tree = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "tx", - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); for (i = 0; i < sc->hn_tx_ring_cnt; ++i) { int error; @@ -2573,23 +2576,23 @@ hn_create_tx_data(struct hn_softc *sc, i } SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "no_txdescs", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_no_txdescs), hn_tx_stat_ulong_sysctl, "LU", "# of times short of TX descs"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "send_failed", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_send_failed), hn_tx_stat_ulong_sysctl, "LU", "# of hyper-v sending failure"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "txdma_failed", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_txdma_failed), hn_tx_stat_ulong_sysctl, "LU", "# of TX DMA failure"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_collapsed", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_tx_collapsed), hn_tx_stat_ulong_sysctl, "LU", "# of TX mbuf collapsed"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney", - CTLTYPE_ULONG | CTLFLAG_RW, sc, + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_tx_chimney), hn_tx_stat_ulong_sysctl, "LU", "# of chimney send"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_cnt", @@ -2599,15 +2602,16 @@ hn_create_tx_data(struct hn_softc *sc, i CTLFLAG_RD, &sc->hn_tx_chimney_max, 0, "Chimney send packet size upper boundary"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_size", - CTLTYPE_INT | CTLFLAG_RW, sc, 0, hn_tx_chimney_size_sysctl, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, 0, + hn_tx_chimney_size_sysctl, "I", "Chimney send packet size limit"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "direct_tx_size", - CTLTYPE_INT | CTLFLAG_RW, sc, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_direct_tx_size), hn_tx_conf_int_sysctl, "I", "Size of the packet for direct transmission"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "sched_tx", - CTLTYPE_INT | CTLFLAG_RW, sc, + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_sched_tx), hn_tx_conf_int_sysctl, "I", "Always schedule transmission " From owner-svn-src-head@freebsd.org Wed Apr 27 05:45:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F74AB1D905; Wed, 27 Apr 2016 05:45:16 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D87DF183A; Wed, 27 Apr 2016 05:45:15 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3R5jFjV006553; Wed, 27 Apr 2016 05:45:15 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R5jExF006551; Wed, 27 Apr 2016 05:45:14 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604270545.u3R5jExF006551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Apr 2016 05:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298693 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 05:45:16 -0000 Author: sephe Date: Wed Apr 27 05:45:14 2016 New Revision: 298693 URL: https://svnweb.freebsd.org/changeset/base/298693 Log: hyperv/vmbus: Mark sysctls MPSAFE MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_channel.c head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Modified: head/sys/dev/hyperv/vmbus/hv_channel.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel.c Wed Apr 27 05:38:47 2016 (r298692) +++ head/sys/dev/hyperv/vmbus/hv_channel.c Wed Apr 27 05:45:14 2016 (r298693) @@ -118,21 +118,21 @@ vmbus_channel_sysctl_create(hv_vmbus_cha /* This creates dev.DEVNAME.DEVUNIT.channel tree */ devch_sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "channel", CTLFLAG_RD, 0, ""); + OID_AUTO, "channel", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); /* This creates dev.DEVNAME.DEVUNIT.channel.CHANID tree */ snprintf(name, sizeof(name), "%d", ch_id); devch_id_sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(devch_sysctl), - OID_AUTO, name, CTLFLAG_RD, 0, ""); + OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); if (primary_ch != NULL) { devch_sub_sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(devch_id_sysctl), - OID_AUTO, "sub", CTLFLAG_RD, 0, ""); + OID_AUTO, "sub", CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); snprintf(name, sizeof(name), "%d", sub_ch_id); devch_id_sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(devch_sub_sysctl), - OID_AUTO, name, CTLFLAG_RD, 0, ""); + OID_AUTO, name, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(devch_id_sysctl), OID_AUTO, "chanid", CTLFLAG_RD, @@ -141,20 +141,20 @@ vmbus_channel_sysctl_create(hv_vmbus_cha SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(devch_id_sysctl), OID_AUTO, "cpu", CTLFLAG_RD, &channel->target_cpu, 0, "owner CPU id"); SYSCTL_ADD_PROC(ctx, SYSCTL_CHILDREN(devch_id_sysctl), OID_AUTO, - "monitor_allocated", CTLTYPE_INT | CTLFLAG_RD, channel, 0, - vmbus_channel_sysctl_monalloc, "I", + "monitor_allocated", CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + channel, 0, vmbus_channel_sysctl_monalloc, "I", "is monitor allocated to this channel"); devch_id_in_sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(devch_id_sysctl), OID_AUTO, "in", - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); devch_id_out_sysctl = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(devch_id_sysctl), OID_AUTO, "out", - CTLFLAG_RD, 0, ""); + CTLFLAG_RD | CTLFLAG_MPSAFE, 0, ""); hv_ring_buffer_stat(ctx, SYSCTL_CHILDREN(devch_id_in_sysctl), &(channel->inbound), Modified: head/sys/dev/hyperv/vmbus/hv_ring_buffer.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Apr 27 05:38:47 2016 (r298692) +++ head/sys/dev/hyperv/vmbus/hv_ring_buffer.c Wed Apr 27 05:45:14 2016 (r298693) @@ -76,7 +76,7 @@ hv_ring_buffer_stat( { SYSCTL_ADD_PROC(ctx, tree_node, OID_AUTO, "ring_buffer_stats", - CTLTYPE_STRING|CTLFLAG_RD, rbi, 0, + CTLTYPE_STRING|CTLFLAG_RD|CTLFLAG_MPSAFE, rbi, 0, hv_rbi_sysctl_stats, "A", desc); } /** From owner-svn-src-head@freebsd.org Wed Apr 27 06:49:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 302B3B1E5D9; Wed, 27 Apr 2016 06:49:18 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9EC31190; Wed, 27 Apr 2016 06:49:17 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3R6nHKD024681; Wed, 27 Apr 2016 06:49:17 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R6nGt6024679; Wed, 27 Apr 2016 06:49:16 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604270649.u3R6nGt6024679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Apr 2016 06:49:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298694 - head/sys/dev/hyperv/netvsc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 06:49:18 -0000 Author: sephe Date: Wed Apr 27 06:49:16 2016 New Revision: 298694 URL: https://svnweb.freebsd.org/changeset/base/298694 Log: hyperv/hn: Add stat for # of chimney sending tries MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: head/sys/dev/hyperv/netvsc/hv_net_vsc.h ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Apr 27 05:45:14 2016 (r298693) +++ head/sys/dev/hyperv/netvsc/hv_net_vsc.h Wed Apr 27 06:49:16 2016 (r298694) @@ -1211,6 +1211,7 @@ struct hn_tx_ring { u_long hn_send_failed; u_long hn_txdma_failed; u_long hn_tx_collapsed; + u_long hn_tx_chimney_tried; u_long hn_tx_chimney; u_long hn_pkts; Modified: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c ============================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Apr 27 05:45:14 2016 (r298693) +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Apr 27 06:49:16 2016 (r298694) @@ -1004,6 +1004,7 @@ hn_encap(struct hn_tx_ring *txr, struct netvsc_dev *net_dev = txr->hn_sc->net_dev; uint32_t send_buf_section_idx; + txr->hn_tx_chimney_tried++; send_buf_section_idx = hv_nv_get_next_send_section(net_dev); if (send_buf_section_idx != @@ -2595,6 +2596,10 @@ hn_create_tx_data(struct hn_softc *sc, i CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, __offsetof(struct hn_tx_ring, hn_tx_chimney), hn_tx_stat_ulong_sysctl, "LU", "# of chimney send"); + SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "tx_chimney_tried", + CTLTYPE_ULONG | CTLFLAG_RW | CTLFLAG_MPSAFE, sc, + __offsetof(struct hn_tx_ring, hn_tx_chimney_tried), + hn_tx_stat_ulong_sysctl, "LU", "# of chimney send tries"); SYSCTL_ADD_INT(ctx, child, OID_AUTO, "txdesc_cnt", CTLFLAG_RD, &sc->hn_tx_ring[0].hn_txdesc_cnt, 0, "# of total TX descs"); From owner-svn-src-head@freebsd.org Wed Apr 27 07:46:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61CE7B1D774; Wed, 27 Apr 2016 07:46:40 +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 0C4251FAB; Wed, 27 Apr 2016 07:46:39 +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 u3R7kdca042599; Wed, 27 Apr 2016 07:46:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R7kdaY042596; Wed, 27 Apr 2016 07:46:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201604270746.u3R7kdaY042596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 27 Apr 2016 07:46:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298695 - in head: contrib/ntp contrib/ntp/html contrib/ntp/include contrib/ntp/lib/isc contrib/ntp/lib/isc/include/isc contrib/ntp/libntp contrib/ntp/ntpd contrib/ntp/ntpdate contrib/n... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 07:46:40 -0000 Author: delphij Date: Wed Apr 27 07:46:38 2016 New Revision: 298695 URL: https://svnweb.freebsd.org/changeset/base/298695 Log: MFV r298691: ntp 4.2.8p7. Security: CVE-2016-1547, CVE-2016-1548, CVE-2016-1549, CVE-2016-1550 Security: CVE-2016-1551, CVE-2016-2516, CVE-2016-2517, CVE-2016-2518 Security: CVE-2016-2519 Security: FreeBSD-SA-16:16.ntp With hat: so Added: head/contrib/ntp/README.pullrequests - copied unchanged from r298691, vendor/ntp/dist/README.pullrequests head/contrib/ntp/lib/isc/tsmemcmp.c - copied unchanged from r298691, vendor/ntp/dist/lib/isc/tsmemcmp.c head/contrib/ntp/tests/libntp/run-tsafememcmp.c - copied unchanged from r298691, vendor/ntp/dist/tests/libntp/run-tsafememcmp.c head/contrib/ntp/tests/libntp/tsafememcmp.c - copied unchanged from r298691, vendor/ntp/dist/tests/libntp/tsafememcmp.c Modified: head/contrib/ntp/ChangeLog head/contrib/ntp/CommitLog head/contrib/ntp/Makefile.am head/contrib/ntp/Makefile.in head/contrib/ntp/NEWS head/contrib/ntp/config.h.in head/contrib/ntp/configure head/contrib/ntp/configure.ac head/contrib/ntp/html/authentic.html head/contrib/ntp/html/monopt.html head/contrib/ntp/html/xleave.html head/contrib/ntp/include/ntp.h head/contrib/ntp/include/ntp_keyacc.h head/contrib/ntp/include/ntp_refclock.h head/contrib/ntp/include/ntp_stdlib.h head/contrib/ntp/include/ntp_types.h head/contrib/ntp/include/ntp_worker.h head/contrib/ntp/include/recvbuff.h head/contrib/ntp/lib/isc/hmacmd5.c head/contrib/ntp/lib/isc/hmacsha.c head/contrib/ntp/lib/isc/include/isc/string.h head/contrib/ntp/libntp/Makefile.am head/contrib/ntp/libntp/Makefile.in head/contrib/ntp/libntp/a_md5encrypt.c head/contrib/ntp/libntp/authkeys.c head/contrib/ntp/libntp/authreadkeys.c head/contrib/ntp/libntp/is_ip_address.c head/contrib/ntp/libntp/ntp_intres.c head/contrib/ntp/libntp/ntp_worker.c head/contrib/ntp/libntp/recvbuff.c head/contrib/ntp/libntp/work_fork.c head/contrib/ntp/libntp/work_thread.c head/contrib/ntp/ntpd/invoke-ntp.conf.texi head/contrib/ntp/ntpd/invoke-ntp.keys.texi head/contrib/ntp/ntpd/invoke-ntpd.texi head/contrib/ntp/ntpd/ntp.conf.5man head/contrib/ntp/ntpd/ntp.conf.5mdoc head/contrib/ntp/ntpd/ntp.conf.def head/contrib/ntp/ntpd/ntp.conf.html head/contrib/ntp/ntpd/ntp.conf.man.in head/contrib/ntp/ntpd/ntp.conf.mdoc.in head/contrib/ntp/ntpd/ntp.keys.5man head/contrib/ntp/ntpd/ntp.keys.5mdoc head/contrib/ntp/ntpd/ntp.keys.html head/contrib/ntp/ntpd/ntp.keys.man.in head/contrib/ntp/ntpd/ntp.keys.mdoc.in head/contrib/ntp/ntpd/ntp_control.c head/contrib/ntp/ntpd/ntp_io.c head/contrib/ntp/ntpd/ntp_proto.c head/contrib/ntp/ntpd/ntp_request.c head/contrib/ntp/ntpd/ntp_timer.c head/contrib/ntp/ntpd/ntpd-opts.c head/contrib/ntp/ntpd/ntpd-opts.h head/contrib/ntp/ntpd/ntpd.1ntpdman head/contrib/ntp/ntpd/ntpd.1ntpdmdoc head/contrib/ntp/ntpd/ntpd.c head/contrib/ntp/ntpd/ntpd.html head/contrib/ntp/ntpd/ntpd.man.in head/contrib/ntp/ntpd/ntpd.mdoc.in head/contrib/ntp/ntpdate/ntpdate.c head/contrib/ntp/ntpdc/invoke-ntpdc.texi head/contrib/ntp/ntpdc/ntpdc-opts.c head/contrib/ntp/ntpdc/ntpdc-opts.h head/contrib/ntp/ntpdc/ntpdc.1ntpdcman head/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc head/contrib/ntp/ntpdc/ntpdc.html head/contrib/ntp/ntpdc/ntpdc.man.in head/contrib/ntp/ntpdc/ntpdc.mdoc.in head/contrib/ntp/ntpq/invoke-ntpq.texi head/contrib/ntp/ntpq/ntpq-opts.c head/contrib/ntp/ntpq/ntpq-opts.def head/contrib/ntp/ntpq/ntpq-opts.h head/contrib/ntp/ntpq/ntpq-subs.c head/contrib/ntp/ntpq/ntpq.1ntpqman head/contrib/ntp/ntpq/ntpq.1ntpqmdoc head/contrib/ntp/ntpq/ntpq.c head/contrib/ntp/ntpq/ntpq.h head/contrib/ntp/ntpq/ntpq.html head/contrib/ntp/ntpq/ntpq.man.in head/contrib/ntp/ntpq/ntpq.mdoc.in head/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c head/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman head/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc head/contrib/ntp/ntpsnmpd/ntpsnmpd.html head/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in head/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in head/contrib/ntp/packageinfo.sh head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in head/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in head/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi head/contrib/ntp/scripts/invoke-plot_summary.texi head/contrib/ntp/scripts/invoke-summary.texi head/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi head/contrib/ntp/scripts/ntp-wait/ntp-wait-opts head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman head/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc head/contrib/ntp/scripts/ntp-wait/ntp-wait.html head/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in head/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in head/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi head/contrib/ntp/scripts/ntpsweep/ntpsweep-opts head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman head/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc head/contrib/ntp/scripts/ntpsweep/ntpsweep.html head/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in head/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in head/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi head/contrib/ntp/scripts/ntptrace/ntptrace-opts head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman head/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc head/contrib/ntp/scripts/ntptrace/ntptrace.html head/contrib/ntp/scripts/ntptrace/ntptrace.man.in head/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in head/contrib/ntp/scripts/plot_summary-opts head/contrib/ntp/scripts/plot_summary.1plot_summaryman head/contrib/ntp/scripts/plot_summary.1plot_summarymdoc head/contrib/ntp/scripts/plot_summary.html head/contrib/ntp/scripts/plot_summary.man.in head/contrib/ntp/scripts/plot_summary.mdoc.in head/contrib/ntp/scripts/summary-opts head/contrib/ntp/scripts/summary.1summaryman head/contrib/ntp/scripts/summary.1summarymdoc head/contrib/ntp/scripts/summary.html head/contrib/ntp/scripts/summary.man.in head/contrib/ntp/scripts/summary.mdoc.in head/contrib/ntp/scripts/update-leap/invoke-update-leap.texi head/contrib/ntp/scripts/update-leap/update-leap-opts head/contrib/ntp/scripts/update-leap/update-leap.1update-leapman head/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc head/contrib/ntp/scripts/update-leap/update-leap.html head/contrib/ntp/scripts/update-leap/update-leap.man.in head/contrib/ntp/scripts/update-leap/update-leap.mdoc.in head/contrib/ntp/sntp/config.h.in head/contrib/ntp/sntp/configure head/contrib/ntp/sntp/crypto.c head/contrib/ntp/sntp/include/version.def head/contrib/ntp/sntp/include/version.texi head/contrib/ntp/sntp/invoke-sntp.texi head/contrib/ntp/sntp/m4/ntp_libntp.m4 head/contrib/ntp/sntp/m4/version.m4 head/contrib/ntp/sntp/sntp-opts.c head/contrib/ntp/sntp/sntp-opts.h head/contrib/ntp/sntp/sntp.1sntpman head/contrib/ntp/sntp/sntp.1sntpmdoc head/contrib/ntp/sntp/sntp.html head/contrib/ntp/sntp/sntp.man.in head/contrib/ntp/sntp/sntp.mdoc.in head/contrib/ntp/sntp/version.c head/contrib/ntp/tests/libntp/Makefile.am head/contrib/ntp/tests/libntp/Makefile.in head/contrib/ntp/tests/libntp/lfpfunc.c head/contrib/ntp/tests/libntp/run-lfpfunc.c head/contrib/ntp/tests/libntp/run-timevalops.c head/contrib/ntp/tests/libntp/ssl_init.c head/contrib/ntp/tests/libntp/timespecops.c head/contrib/ntp/tests/libntp/timevalops.c head/contrib/ntp/tests/ntpq/Makefile.am head/contrib/ntp/tests/ntpq/Makefile.in head/contrib/ntp/util/invoke-ntp-keygen.texi head/contrib/ntp/util/ntp-keygen-opts.c head/contrib/ntp/util/ntp-keygen-opts.h head/contrib/ntp/util/ntp-keygen.1ntp-keygenman head/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc head/contrib/ntp/util/ntp-keygen.html head/contrib/ntp/util/ntp-keygen.man.in head/contrib/ntp/util/ntp-keygen.mdoc.in head/usr.sbin/ntp/config.h head/usr.sbin/ntp/doc/ntp-keygen.8 head/usr.sbin/ntp/doc/ntp.conf.5 head/usr.sbin/ntp/doc/ntp.keys.5 head/usr.sbin/ntp/doc/ntpd.8 head/usr.sbin/ntp/doc/ntpdc.8 head/usr.sbin/ntp/doc/ntpq.8 head/usr.sbin/ntp/doc/sntp.8 head/usr.sbin/ntp/libntp/Makefile head/usr.sbin/ntp/scripts/mkver Directory Properties: head/contrib/ntp/ (props changed) Modified: head/contrib/ntp/ChangeLog ============================================================================== --- head/contrib/ntp/ChangeLog Wed Apr 27 06:49:16 2016 (r298694) +++ head/contrib/ntp/ChangeLog Wed Apr 27 07:46:38 2016 (r298695) @@ -1,4 +1,65 @@ --- +(4.2.8p7) 2016/04/26 Released by Harlan Stenn + +* [Sec 2901] KoD packets must have non-zero transmit timestamps. HStenn. +* [Sec 2936] Skeleton Key: Any system knowing the trusted key can serve + time. Include passive servers in this check. HStenn. +* [Sec 2945] Additional KoD packet checks. HStenn. +* [Sec 2978] Interleave can be partially triggered. HStenn. +* [Sec 3007] Validate crypto-NAKs. Danny Mayer. +* [Sec 3008] Always check the return value of ctl_getitem(). + - initial work by HStenn + - Additional cleanup of ctl_getitem by perlinger@ntp.org +* [Sec 3009] Crafted addpeer with hmode > 7 causes OOB error. perlinger@ntp.org + - added more stringent checks on packet content +* [Sec 3010] remote configuration trustedkey/requestkey values + are not properly validated. perlinger@ntp.org + - sidekick: Ignore keys that have an unsupported MAC algorithm + but are otherwise well-formed +* [Sec 3011] Duplicate IPs on unconfig directives will cause an assertion botch + - graciously accept the same IP multiple times. perlinger@ntp.org +* [Sec 3020] Refclock impersonation. HStenn. +* [Bug 2831] Segmentation Fault in DNS lookup during startup. perlinger@ntp.org + - fixed yet another race condition in the threaded resolver code. +* [Bug 2858] bool support. Use stdbool.h when available. HStenn. +* [Bug 2879] Improve NTP security against timing attacks. perlinger@ntp.org + - integrated patches by Loganaden Velvidron + with some modifications & unit tests +* [Bug 2952] Symmetric active/passive mode is broken. HStenn. +* [Bug 2960] async name resolution fixes for chroot() environments. + Reinhard Max. +* [Bug 2994] Systems with HAVE_SIGNALED_IO fail to compile. perlinger@ntp.org +* [Bug 2995] Fixes to compile on Windows +* [Bug 2999] out-of-bounds access in 'is_safe_filename()'. perlinger@ntp.org +* [Bug 3013] Fix for ssl_init.c SHA1 test. perlinger@ntp.org + - Patch provided by Ch. Weisgerber +* [Bug 3015] ntpq: config-from-file: "request contains an unprintable character" + - A change related to [Bug 2853] forbids trailing white space in + remote config commands. perlinger@ntp.org +* [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - report and patch from Aleksandr Kostikov. + - Overhaul of Windows IO completion port handling. perlinger@ntp.org +* [Bug 3022] authkeys.c should be refactored. perlinger@ntp.org + - fixed memory leak in access list (auth[read]keys.c) + - refactored handling of key access lists (auth[read]keys.c) + - reduced number of error branches (authreadkeys.c) +* [Bug 3023] ntpdate cannot correct dates in the future. perlinger@ntp.org +* [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. +* [Bug 3031] ntp broadcastclient unable to synchronize to an server + when the time of server changed. perlinger@ntp.org + - Check the initial delay calculation and reject/unpeer the broadcast + server if the delay exceeds 50ms. Retry again after the next + broadcast packet. +* [Bug 3036] autokey trips an INSIST in authistrustedip(). Harlan Stenn. +* Document ntp.key's optional IP list in authenetic.html. Harlan Stenn. +* Update html/xleave.html documentation. Harlan Stenn. +* Update ntp.conf documentation. Harlan Stenn. +* Fix some Credit: attributions in the NEWS file. Harlan Stenn. +* Fix typo in html/monopt.html. Harlan Stenn. +* Add README.pullrequests. Harlan Stenn. +* Cleanup to include/ntp.h. Harlan Stenn. + +--- (4.2.8p6) 2016/01/20 Released by Harlan Stenn * [Sec 2935] Deja Vu: Replay attack on authenticated broadcast mode. HStenn. @@ -92,6 +153,7 @@ * Update scripts/calc_tickadj/Makefile.am. Harlan Stenn. --- +(4.2.8p4) 2015/10/21 Released by Harlan Stenn * [Sec 2899] CVE-2014-9297 perlinger@ntp.org * [Sec 2901] Drop invalid packet before checking KoD. Check for all KoD's. Modified: head/contrib/ntp/CommitLog ============================================================================== --- head/contrib/ntp/CommitLog Wed Apr 27 06:49:16 2016 (r298694) +++ head/contrib/ntp/CommitLog Wed Apr 27 07:46:38 2016 (r298695) @@ -1,3 +1,1130 @@ +ChangeSet@1.3669, 2016-04-26 20:30:51-04:00, stenn@deacon.udel.edu + NTP_4_2_8P7 + TAG: NTP_4_2_8P7 + + ChangeLog@1.1820 +1 -0 + NTP_4_2_8P7 + + ntpd/invoke-ntp.conf.texi@1.198 +38 -20 + NTP_4_2_8P7 + + ntpd/invoke-ntp.keys.texi@1.189 +1 -1 + NTP_4_2_8P7 + + ntpd/invoke-ntpd.texi@1.505 +2 -2 + NTP_4_2_8P7 + + ntpd/ntp.conf.5man@1.232 +43 -24 + NTP_4_2_8P7 + + ntpd/ntp.conf.5mdoc@1.232 +40 -18 + NTP_4_2_8P7 + + ntpd/ntp.conf.html@1.184 +34 -10 + NTP_4_2_8P7 + + ntpd/ntp.conf.man.in@1.232 +43 -24 + NTP_4_2_8P7 + + ntpd/ntp.conf.mdoc.in@1.232 +40 -18 + NTP_4_2_8P7 + + ntpd/ntp.keys.5man@1.223 +2 -2 + NTP_4_2_8P7 + + ntpd/ntp.keys.5mdoc@1.223 +2 -2 + NTP_4_2_8P7 + + ntpd/ntp.keys.html@1.185 +1 -1 + NTP_4_2_8P7 + + ntpd/ntp.keys.man.in@1.223 +2 -2 + NTP_4_2_8P7 + + ntpd/ntp.keys.mdoc.in@1.223 +2 -2 + NTP_4_2_8P7 + + ntpd/ntpd-opts.c@1.527 +7 -7 + NTP_4_2_8P7 + + ntpd/ntpd-opts.h@1.526 +3 -3 + NTP_4_2_8P7 + + ntpd/ntpd.1ntpdman@1.334 +3 -3 + NTP_4_2_8P7 + + ntpd/ntpd.1ntpdmdoc@1.334 +2 -2 + NTP_4_2_8P7 + + ntpd/ntpd.html@1.178 +2 -2 + NTP_4_2_8P7 + + ntpd/ntpd.man.in@1.334 +3 -3 + NTP_4_2_8P7 + + ntpd/ntpd.mdoc.in@1.334 +2 -2 + NTP_4_2_8P7 + + ntpdc/invoke-ntpdc.texi@1.502 +2 -2 + NTP_4_2_8P7 + + ntpdc/ntpdc-opts.c@1.520 +7 -7 + NTP_4_2_8P7 + + ntpdc/ntpdc-opts.h@1.519 +3 -3 + NTP_4_2_8P7 + + ntpdc/ntpdc.1ntpdcman@1.333 +3 -3 + NTP_4_2_8P7 + + ntpdc/ntpdc.1ntpdcmdoc@1.333 +2 -2 + NTP_4_2_8P7 + + ntpdc/ntpdc.html@1.346 +2 -2 + NTP_4_2_8P7 + + ntpdc/ntpdc.man.in@1.333 +3 -3 + NTP_4_2_8P7 + + ntpdc/ntpdc.mdoc.in@1.333 +2 -2 + NTP_4_2_8P7 + + ntpq/invoke-ntpq.texi@1.510 +2 -2 + NTP_4_2_8P7 + + ntpq/ntpq-opts.c@1.527 +7 -7 + NTP_4_2_8P7 + + ntpq/ntpq-opts.h@1.525 +3 -3 + NTP_4_2_8P7 + + ntpq/ntpq.1ntpqman@1.338 +3 -3 + NTP_4_2_8P7 + + ntpq/ntpq.1ntpqmdoc@1.338 +2 -2 + NTP_4_2_8P7 + + ntpq/ntpq.html@1.175 +36 -6 + NTP_4_2_8P7 + + ntpq/ntpq.man.in@1.338 +3 -3 + NTP_4_2_8P7 + + ntpq/ntpq.mdoc.in@1.338 +2 -2 + NTP_4_2_8P7 + + ntpsnmpd/invoke-ntpsnmpd.texi@1.504 +2 -2 + NTP_4_2_8P7 + + ntpsnmpd/ntpsnmpd-opts.c@1.522 +7 -7 + NTP_4_2_8P7 + + ntpsnmpd/ntpsnmpd-opts.h@1.521 +3 -3 + NTP_4_2_8P7 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdman@1.333 +3 -3 + NTP_4_2_8P7 + + ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc@1.333 +2 -2 + NTP_4_2_8P7 + + ntpsnmpd/ntpsnmpd.html@1.173 +1 -1 + NTP_4_2_8P7 + + ntpsnmpd/ntpsnmpd.man.in@1.333 +3 -3 + NTP_4_2_8P7 + + ntpsnmpd/ntpsnmpd.mdoc.in@1.333 +2 -2 + NTP_4_2_8P7 + + packageinfo.sh@1.526 +2 -2 + NTP_4_2_8P7 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjman@1.94 +3 -3 + NTP_4_2_8P7 + + scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc@1.95 +2 -2 + NTP_4_2_8P7 + + scripts/calc_tickadj/calc_tickadj.html@1.96 +1 -1 + NTP_4_2_8P7 + + scripts/calc_tickadj/calc_tickadj.man.in@1.93 +3 -3 + NTP_4_2_8P7 + + scripts/calc_tickadj/calc_tickadj.mdoc.in@1.95 +2 -2 + NTP_4_2_8P7 + + scripts/calc_tickadj/invoke-calc_tickadj.texi@1.98 +1 -1 + NTP_4_2_8P7 + + scripts/invoke-plot_summary.texi@1.115 +2 -2 + NTP_4_2_8P7 + + scripts/invoke-summary.texi@1.115 +2 -2 + NTP_4_2_8P7 + + scripts/ntp-wait/invoke-ntp-wait.texi@1.325 +2 -2 + NTP_4_2_8P7 + + scripts/ntp-wait/ntp-wait-opts@1.61 +2 -2 + NTP_4_2_8P7 + + scripts/ntp-wait/ntp-wait.1ntp-waitman@1.322 +3 -3 + NTP_4_2_8P7 + + scripts/ntp-wait/ntp-wait.1ntp-waitmdoc@1.323 +2 -2 + NTP_4_2_8P7 + + scripts/ntp-wait/ntp-wait.html@1.342 +2 -2 + NTP_4_2_8P7 + + scripts/ntp-wait/ntp-wait.man.in@1.322 +3 -3 + NTP_4_2_8P7 + + scripts/ntp-wait/ntp-wait.mdoc.in@1.323 +2 -2 + NTP_4_2_8P7 + + scripts/ntpsweep/invoke-ntpsweep.texi@1.113 +2 -2 + NTP_4_2_8P7 + + scripts/ntpsweep/ntpsweep-opts@1.63 +2 -2 + NTP_4_2_8P7 + + scripts/ntpsweep/ntpsweep.1ntpsweepman@1.101 +3 -3 + NTP_4_2_8P7 + + scripts/ntpsweep/ntpsweep.1ntpsweepmdoc@1.101 +2 -2 + NTP_4_2_8P7 + + scripts/ntpsweep/ntpsweep.html@1.114 +2 -2 + NTP_4_2_8P7 + + scripts/ntpsweep/ntpsweep.man.in@1.101 +3 -3 + NTP_4_2_8P7 + + scripts/ntpsweep/ntpsweep.mdoc.in@1.102 +2 -2 + NTP_4_2_8P7 + + scripts/ntptrace/invoke-ntptrace.texi@1.114 +2 -2 + NTP_4_2_8P7 + + scripts/ntptrace/ntptrace-opts@1.63 +2 -2 + NTP_4_2_8P7 + + scripts/ntptrace/ntptrace.1ntptraceman@1.101 +3 -3 + NTP_4_2_8P7 + + scripts/ntptrace/ntptrace.1ntptracemdoc@1.102 +2 -2 + NTP_4_2_8P7 + + scripts/ntptrace/ntptrace.html@1.115 +2 -2 + NTP_4_2_8P7 + + scripts/ntptrace/ntptrace.man.in@1.101 +3 -3 + NTP_4_2_8P7 + + scripts/ntptrace/ntptrace.mdoc.in@1.103 +2 -2 + NTP_4_2_8P7 + + scripts/plot_summary-opts@1.63 +2 -2 + NTP_4_2_8P7 + + scripts/plot_summary.1plot_summaryman@1.113 +3 -3 + NTP_4_2_8P7 + + scripts/plot_summary.1plot_summarymdoc@1.113 +2 -2 + NTP_4_2_8P7 + + scripts/plot_summary.html@1.116 +2 -2 + NTP_4_2_8P7 + + scripts/plot_summary.man.in@1.113 +3 -3 + NTP_4_2_8P7 + + scripts/plot_summary.mdoc.in@1.113 +2 -2 + NTP_4_2_8P7 + + scripts/summary-opts@1.63 +2 -2 + NTP_4_2_8P7 + + scripts/summary.1summaryman@1.113 +3 -3 + NTP_4_2_8P7 + + scripts/summary.1summarymdoc@1.113 +2 -2 + NTP_4_2_8P7 + + scripts/summary.html@1.116 +2 -2 + NTP_4_2_8P7 + + scripts/summary.man.in@1.113 +3 -3 + NTP_4_2_8P7 + + scripts/summary.mdoc.in@1.113 +2 -2 + NTP_4_2_8P7 + + scripts/update-leap/invoke-update-leap.texi@1.14 +1 -1 + NTP_4_2_8P7 + + scripts/update-leap/update-leap-opts@1.14 +2 -2 + NTP_4_2_8P7 + + scripts/update-leap/update-leap.1update-leapman@1.14 +3 -3 + NTP_4_2_8P7 + + scripts/update-leap/update-leap.1update-leapmdoc@1.14 +2 -2 + NTP_4_2_8P7 + + scripts/update-leap/update-leap.html@1.14 +1 -1 + NTP_4_2_8P7 + + scripts/update-leap/update-leap.man.in@1.14 +3 -3 + NTP_4_2_8P7 + + scripts/update-leap/update-leap.mdoc.in@1.14 +2 -2 + NTP_4_2_8P7 + + sntp/invoke-sntp.texi@1.502 +2 -2 + NTP_4_2_8P7 + + sntp/sntp-opts.c@1.521 +7 -7 + NTP_4_2_8P7 + + sntp/sntp-opts.h@1.519 +3 -3 + NTP_4_2_8P7 + + sntp/sntp.1sntpman@1.337 +3 -3 + NTP_4_2_8P7 + + sntp/sntp.1sntpmdoc@1.337 +2 -2 + NTP_4_2_8P7 + + sntp/sntp.html@1.517 +2 -2 + NTP_4_2_8P7 + + sntp/sntp.man.in@1.337 +3 -3 + NTP_4_2_8P7 + + sntp/sntp.mdoc.in@1.337 +2 -2 + NTP_4_2_8P7 + + util/invoke-ntp-keygen.texi@1.505 +2 -2 + NTP_4_2_8P7 + + util/ntp-keygen-opts.c@1.523 +7 -7 + NTP_4_2_8P7 + + util/ntp-keygen-opts.h@1.521 +3 -3 + NTP_4_2_8P7 + + util/ntp-keygen.1ntp-keygenman@1.333 +3 -3 + NTP_4_2_8P7 + + util/ntp-keygen.1ntp-keygenmdoc@1.333 +2 -2 + NTP_4_2_8P7 + + util/ntp-keygen.html@1.179 +2 -2 + NTP_4_2_8P7 + + util/ntp-keygen.man.in@1.333 +3 -3 + NTP_4_2_8P7 + + util/ntp-keygen.mdoc.in@1.333 +2 -2 + NTP_4_2_8P7 + +ChangeSet@1.3668, 2016-04-26 20:07:48-04:00, stenn@deacon.udel.edu + ntp-4.2.8p7 + + packageinfo.sh@1.525 +1 -1 + ntp-4.2.8p7 + +ChangeSet@1.3667, 2016-04-26 23:24:25+00:00, stenn@psp-deb1.ntp.org + 4.2.8p7 documentation cleanup + + ChangeLog@1.1819 +9 -9 + 4.2.8p7 documentation cleanup + + NEWS@1.169 +123 -36 + 4.2.8p7 documentation cleanup + +ChangeSet@1.3666, 2016-04-24 09:17:06+00:00, stenn@psp-deb1.ntp.org + [Bug 3036] autokey trips an INSIST in authistrustedip() + + ntpd/ntp_proto.c@1.386 +0 -1 + [Bug 3036] autokey trips an INSIST in authistrustedip() + +ChangeSet@1.3665, 2016-04-21 23:42:43+00:00, stenn@psp-deb1.ntp.org + Update 3007 + + NEWS@1.168 +1 -1 + Update 3007 + +ChangeSet@1.3664, 2016-04-21 23:29:30+00:00, stenn@psp-deb1.ntp.org + [Bug 3007] Fix bug in crypto-NAK check + + ChangeLog@1.1818 +1 -1 + [Bug 3007] Fix bug in crypto-NAK check + + ntpd/ntp_proto.c@1.385 +3 -1 + [Bug 3007] Fix bug in crypto-NAK check + +ChangeSet@1.3663, 2016-04-21 09:29:31+00:00, stenn@psp-deb1.ntp.org + [Bug 3036] autokey trips an INSIST in authistrustedip() + + NEWS@1.167 +1 -0 + [Bug 3036] autokey trips an INSIST in authistrustedip() + +ChangeSet@1.3661, 2016-04-21 09:24:12+00:00, stenn@psp-deb1.ntp.org + tweak some ntp_proto.c timestamp log messages + + ntpd/ntp_proto.c@1.383 +4 -3 + tweak some ntp_proto.c timestamp log messages + +ChangeSet@1.3630.1.17, 2016-04-21 09:11:51+00:00, stenn@psp-deb1.ntp.org + [Bug 3036] autokey trips an INSIST in authistrustedip() + + ChangeLog@1.1794.1.15 +1 -0 + [Bug 3036] autokey trips an INSIST in authistrustedip() + + ntpd/ntp_proto.c@1.373.2.7 +6 -1 + [Bug 3036] autokey trips an INSIST in authistrustedip() + +ChangeSet@1.3660, 2016-04-19 05:29:57+00:00, stenn@psp-deb1.ntp.org + Windows cleanup for Bug 2978 mitigation + + ports/winnt/include/config.h@1.114 +6 -0 + Windows cleanup for Bug 2978 mitigation + +ChangeSet@1.3659, 2016-04-18 05:38:06+00:00, stenn@psp-deb1.ntp.org + 4.2.8p7 update: [Bug 2831] Segmentation Fault in DNS lookup during startup + + NEWS@1.166 +2 -0 + 4.2.8p7 update: [Bug 2831] Segmentation Fault in DNS lookup during startup + +ChangeSet@1.3630.15.1, 2016-04-18 06:07:25+02:00, perlinger@ntp.org + [Bug 2831] Segmentation Fault in DNS lookup during startup. + - fixed yet another race condition in the threaded resolver code. + + ChangeLog@1.1794.15.1 +2 -0 + [Bug 2831] Segmentation Fault in DNS lookup during startup. + - fixed yet another race condition in the threaded resolver code. + + include/ntp_worker.h@1.7 +2 -0 + [Bug 2831] Segmentation Fault in DNS lookup during startup. + - fixed yet another race condition in the threaded resolver code: global locker prototype + + libntp/ntp_intres.c@1.100 +20 -28 + [Bug 2831] Segmentation Fault in DNS lookup during startup. + - fixed yet another race condition in the threaded resolver code: + lock global context table during access + remove dangerous wrapper + + libntp/work_fork.c@1.14.1.1 +5 -0 + [Bug 2831] Segmentation Fault in DNS lookup during startup. + - fixed yet another race condition in the threaded resolver code: global locker dummy + + libntp/work_thread.c@1.21 +23 -0 + [Bug 2831] Segmentation Fault in DNS lookup during startup. + - fixed yet another race condition in the threaded resolver code: create&handle global lock + +ChangeSet@1.3657, 2016-04-16 07:59:23+00:00, stenn@psp-deb1.ntp.org + type + + NEWS@1.165 +1 -1 + type + +ChangeSet@1.3656, 2016-04-14 09:03:11+00:00, stenn@psp-deb1.ntp.org + Update the NEWS file for 4.2.8p7 + + NEWS@1.164 +7 -0 + Update the NEWS file for 4.2.8p7 + +ChangeSet@1.3655, 2016-04-14 01:59:45+00:00, stenn@psp-deb1.ntp.org + [Sec 2978] Interleave can be partially triggered + + ChangeLog@1.1815 +1 -0 + [Sec 2978] Interleave can be partially triggered + + configure.ac@1.605 +22 -0 + [Sec 2978] Interleave can be partially triggered + + ntpd/ntp_proto.c@1.382 +11 -3 + [Sec 2978] Interleave can be partially triggered + +ChangeSet@1.3654, 2016-04-14 01:46:50+00:00, stenn@psp-deb1.ntp.org + Update the NEWS file for 4.2.8p7 + + NEWS@1.163 +168 -26 + Update the NEWS file for 4.2.8p7 + +ChangeSet@1.3653, 2016-04-12 22:29:18+00:00, stenn@psp-deb1.ntp.org + 4.2.8p7 prep + + NEWS@1.162 +105 -5 + 4.2.8p7 prep + +ChangeSet@1.3652, 2016-04-12 09:01:09+00:00, stenn@psp-deb1.ntp.org + Credit Aleksandr Kostikov on bug 3019 + + ChangeLog@1.1814 +1 -0 + Credit Aleksandr Kostikov on bug 3019 + +ChangeSet@1.3630.13.6, 2016-04-12 07:43:08+00:00, stenn@psp-deb1.ntp.org + comment tweak + + ntpd/ntp_proto.c@1.373.2.6 +1 -1 + comment tweak + +ChangeSet@1.3650, 2016-04-11 20:26:29-07:00, harlan@max.pfcs.com + [Bug 2952] Symmetric active/passive mode is broken + + ChangeLog@1.1812 +1 -0 + [Bug 2952] Symmetric active/passive mode is broken + + ntpd/ntp_proto.c@1.380 +21 -12 + [Bug 2952] Symmetric active/passive mode is broken + +ChangeSet@1.3649, 2016-04-11 19:56:06-07:00, harlan@max.pfcs.com + Cleanup to include/ntp.h + + ChangeLog@1.1811 +1 -0 + Cleanup to include/ntp.h + + include/ntp.h@1.218 +7 -0 + cleanup + +ChangeSet@1.3630.13.5, 2016-04-01 19:18:25+02:00, jnperlin@nemesis.localnet + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed + - adjust pull cycle of broadcast client to trensmission of brodcast server + + libntp/ntp_worker.c@1.7.1.1 +1 -1 + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed + - side kick: fix annoying signed/unsigned clash + + ntpd/ntp_proto.c@1.373.2.5 +1 -0 + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed + - adjust pull cycle of broadcast client to trensmission of brodcast server + +ChangeSet@1.3630.13.4, 2016-03-30 23:55:33+02:00, jnperlin@nemesis.localnet + [Bug 3031] modify deadband + + ntpd/ntp_proto.c@1.373.2.4 +13 -12 + [Bug 3031] broadcast issues + - modify deadband for first round after volley + +ChangeSet@1.3630.14.1, 2016-03-30 17:28:04+00:00, perlinger@psp-deb1.ntp.org + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed. + - Check the initial delay calculation and reject/unpeer the broadcast server if the delay exceeds + the cutoff limit. (default 50ms) + Retry again after the next broadcast packet. + + ChangeLog@1.1794.14.1 +5 -0 + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed. + + ntpd/ntp_io.c@1.414.3.1 +28 -10 + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed. + - improve/fix handling of opening broadcast sockets (-> EADDRNOTAVAIL) + + ntpd/ntp_proto.c@1.373.3.1 +23 -4 + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed. + - Check the initial delay calculation and reject/unpeer the broadcast server if the delay exceeds 50ms. + Retry again after the next broadcast packet. + - the absolute value of negative broadcastdelays is cutoff limit for peer removal. + +ChangeSet@1.3630.13.2, 2016-03-30 19:23:06+02:00, jnperlin@nemesis.localnet + [Bug 3031] + + ntpd/ntp_io.c@1.414.2.1 +28 -10 + [Bug 3031] + - improve/fix handling of opening broadcast sockets (-> EADDRNOTAVAIL) + + ntpd/ntp_proto.c@1.373.2.2 +14 -6 + [Bug 3031] + - the absolute value of negative broadcastdelays is cutoff limit for peer removal + +ChangeSet@1.3630.1.14, 2016-03-30 10:29:07+00:00, stenn@psp-deb1.ntp.org + [Bug 2960] async name resolution fixes for chroot() environments. Reinhard Max + + ChangeLog@1.1794.1.12 +2 -0 + [Bug 2960] async name resolution fixes for chroot() environments. Reinhard Max + + libntp/work_fork.c@1.15 +1 -1 + [Bug 2960] async name resolution fixes for chroot() environments. Reinhard Max + + ntpd/ntp_timer.c@1.96 +6 -0 + [Bug 2960] async name resolution fixes for chroot() environments. Reinhard Max + + ntpd/ntpd.c@1.171 +15 -0 + [Bug 2960] async name resolution fixes for chroot() environments. Reinhard Max + + sntp/m4/ntp_libntp.m4@1.33 +1 -0 + [Bug 2960] async name resolution fixes for chroot() environments. Reinhard Max + +ChangeSet@1.3630.13.1, 2016-03-29 18:22:03+02:00, perlinger@ntp.org + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed. + - Check the initial delay calculation and reject/unpeer the broadcast server if the delay exceeds 50ms. + Retry again after the next broadcast packet. + + ChangeLog@1.1794.13.1 +5 -0 + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed. + + ntpd/ntp_proto.c@1.373.2.1 +11 -0 + [Bug 3031] ntp broadcastclient unable to synchronize to an server when the time of server changed. + - Check the initial delay calculation and reject/unpeer the broadcast server if the delay exceeds 50ms. + Retry again after the next broadcast packet. + +ChangeSet@1.3630.12.1, 2016-03-27 23:59:51+02:00, jnperlin@nemesis.localnet + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - complete refurbishment of overlapped IO engine + - cleanup + + ChangeLog@1.1794.12.1 +2 -0 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - work around windows network issues, improve overlapped IO. perlinger@ntp.org + + include/ntp.h@1.216.1.1 +1 -0 + [Bug 3019] NTPD stops processing packets ERROR_HOST_UNREACHABLE + - add IOCPL registration handle to interface + + include/ntp_refclock.h@1.38 +2 -1 + [Bug 3019] NTPD stops processing packets ERROR_HOST_UNREACHABLE + - add IOCPL registration handle to RIO structure + + include/recvbuff.h@1.26 +2 -2 + [Bug 3019] NTPD stops processing packets ERROR_HOST_UNREACHABLE + - fix SOCKET vs. FD clash + - 'get_free_recv_buffer_alloc()': extended comment + + libntp/ntp_worker.c@1.8 +1 -1 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - fix signed/unsigned clash + + libntp/recvbuff.c@1.41 +15 -13 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - API cleanup: accept and silently ignore NULL pointer in 'freerecvbuf()' + - fix SOCKET vs. FD clash + + ntpd/ntp_io.c@1.414.1.1 +42 -12 + [Bug 3019] NTPD stops processing packets after hitting ERROR_HOST_UNREACHABLE + - first invalidate FDs in shared structure, then close handles + - defer free() via cooling pond when doing overlapped IO + --- + [Bug 3019] NTPD stops processing packets after hitting ERROR_HOST_UNREACHABLE + - proper wiring to IO completion ports + --- + [Bug 3019] NTPD stops processing packets after hitting ERROR_HOST_UNREACHABLE + - first invalidate FDs in shared structure, then close handles + - defer free() via cooling pond when doing overlapped IO + - proper wiring to IO completion ports + --- + [Bug 3019] NTPD stops processing packets after hitting ERROR_HOST_UNREACHABLE + - wired the needed unregistration functions for overlapped IO + + ports/winnt/include/ntp_iocompletionport.h@1.22 +17 -10 + Bug 3019 - NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - extend API to provide essential information + - added missing unregistration functions to API + + ports/winnt/include/ntp_iocplmem.h@1.1 +24 -0 + [Bug 3019] NTPD stops processing packets after hitting ERROR_HOST_UNREACHABLE + - refactored IOCPL heap into separate file + + ports/winnt/include/ntp_iocplmem.h@1.0 +0 -0 + + ports/winnt/include/ntp_iocpltypes.h@1.1 +160 -0 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - refactored helper objects (locks, PPS/device context, IO context,...) into separate file + + ports/winnt/include/ntp_iocpltypes.h@1.0 +0 -0 + + ports/winnt/ntpd/ntp_iocompletionport.c@1.73 +875 -791 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - make sure ALL operations are overlapped for sockets + - use APC queue for deferred error processing + - take extra care to deal with interfaces/clocks being removed while overlapped IO in flight + - minor WINAPI cleanups (VS2008 vs VS2013) + - extend API to provide essential information + - better context checking + - implemented the missing unregistration functions + - implemented shared locking between clocks/interfaces and IO operations + - made sure minimal locking is engaged + - fixed / locked / avoided access to global / shared values from IO thread + - made sure interfaces and clocks cannot be deleted wile accessed from worker thread + - made sure feeding the receive queue stops with deregistration + In other words, a complete refurbishment. + - further refactoring, better handling of received packets + + ports/winnt/ntpd/ntp_iocplmem.c@1.1 +123 -0 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - refactored IOCPL heap into separate file + + ports/winnt/ntpd/ntp_iocplmem.c@1.0 +0 -0 + + ports/winnt/ntpd/ntp_iocpltypes.c@1.1 +366 -0 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - refactored helper objects (locks, PPS/device context, IO context,...) into separate file + + ports/winnt/ntpd/ntp_iocpltypes.c@1.0 +0 -0 + + ports/winnt/ntpd/ntservice.c@1.30 +13 -3 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - log request from SCM in INFO level + + ports/winnt/vs2005/ntpd.vcproj@1.21 +8 -18 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - added ntp_iocpl{mem,types}.c to sources. + + ports/winnt/vs2008/ntpd/ntpd.vcproj@1.51 +16 -0 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - added ntp_iocpl{mem,types}.c to sources. + + ports/winnt/vs2013/debug-x64.props@1.2 +1 -0 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - sidekick: property sheet name + + ports/winnt/vs2013/libntp/libntp.vcxproj.filters@1.7.1.1 +3 -0 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - auto update + + ports/winnt/vs2013/ntpd/ntpd.vcxproj@1.9 +4 -0 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - added ntp_iocpl{mem,types}.c to sources. + + ports/winnt/vs2013/ntpd/ntpd.vcxproj.filters@1.6 +12 -0 + [Bug 3019] NTPD stops processing packets after hitting ERROR_HOST_UNREACHABLE + - auto update + + ports/winnt/vs2013/release-x64.props@1.2 +1 -0 + [Bug 3019] NTPD stops processing packets after ERROR_HOST_UNREACHABLE + - sidekick: property sheet name + +ChangeSet@1.3630.1.12, 2016-03-19 09:09:07+00:00, stenn@psp-deb1.ntp.org + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + tests/ntpq/Makefile.am@1.9 +1 -0 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + +ChangeSet@1.3630.1.10, 2016-03-16 09:22:31+00:00, stenn@psp-deb1.ntp.org + Add README.pullrequests. Harlan Stenn + + ChangeLog@1.1794.1.9 +1 -0 + Add README.pullrequests. Harlan Stenn + + Makefile.am@1.135 +1 -0 + Add README.pullrequests. Harlan Stenn + + README.pullrequests@1.1 +90 -0 + BitKeeper file /home/stenn/ntp-stable/README.pullrequests + + README.pullrequests@1.0 +0 -0 + +ChangeSet@1.3630.11.1, 2016-03-16 08:46:16+00:00, stenn@psp-deb1.ntp.org + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ChangeLog@1.1794.11.1 +1 -0 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/invoke-ntpq.texi@1.509 +28 -1 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq-opts.c@1.526 +108 -50 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq-opts.def@1.27 +12 -0 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq-opts.h@1.524 +21 -8 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq-subs.c@1.116.1.1 +17 -10 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq.1ntpqman@1.337 +24 -3 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq.1ntpqmdoc@1.337 +22 -2 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq.c@1.169 +53 -2 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq.h@1.32 +3 -0 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq.man.in@1.337 +24 -3 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + + ntpq/ntpq.mdoc.in@1.337 +22 -2 + [Bug 3030] ntpq needs a general way to specify refid output format. HStenn. + +ChangeSet@1.3630.10.1, 2016-03-01 08:30:22+01:00, perlinger@ntp.org + [Bug 3023] ntpdate cannot correct dates in the future. + + ChangeLog@1.1794.10.1 +1 -0 + [Bug 3023] ntpdate cannot correct dates in the future. + + ntpdate/ntpdate.c@1.98 +9 -5 + [Bug 3023] ntpdate cannot correct dates in the future. + +ChangeSet@1.3642, 2016-03-01 05:46:29+00:00, stenn@psp-deb1.ntp.org + cleanup + + ChangeLog@1.1805 +0 -1 + cleanup + +ChangeSet@1.3641, 2016-02-29 23:01:01+00:00, stenn@psp-deb1.ntp.org + [Sec 3020] Refclock impersonation. HStenn. + + ChangeLog@1.1804 +1 -0 + [Sec 3020] Refclock impersonation. HStenn. + + configure.ac@1.604 +18 -0 + [Sec 3020] Refclock impersonation. HStenn. + + ntpd/ntp_io.c@1.415 +12 -0 + [Sec 3020] Refclock impersonation. HStenn. + +ChangeSet@1.3630.9.1, 2016-02-29 20:03:59+01:00, jnperlin@hydra.localnet + [Bug 3022] authkeys.c should be refactored + + ChangeLog@1.1794.9.1 +4 -0 + [Bug 3022] authkeys.c should be refactored + + include/ntp_keyacc.h@1.2 +6 -0 + [Bug 3022] authkeys.c should be refactored + - refactoring of key access handling + + libntp/authkeys.c@1.34 +146 -85 + [Bug 3022] authkeys.c should be refactored + - refactoring of key access handling + - fixed memory leak in access list + + libntp/authreadkeys.c@1.25.1.1 +52 -44 + [Bug 3022] authkeys.c should be refactored + - refactoring of key access handling + - reduced number of error branches + +ChangeSet@1.3638.2.2, 2016-02-22 05:33:56+00:00, stenn@psp-deb1.ntp.org + [Sec 3008] Always check the return value of ctl_getitem(). HStenn. + + ChangeLog@1.1801.2.1 +1 -0 + [Sec 3008] Always check the return value of ctl_getitem(). HStenn. + + ntpd/ntp_control.c@1.206.2.1 +11 -2 + [Sec 3008] Always check the return value of ctl_getitem(). HStenn. + +ChangeSet@1.3638.2.1, 2016-02-22 05:12:39+00:00, stenn@psp-deb1.ntp.org + Update ntp.conf documentation. Harlan Stenn. + + ntpd/ntp.conf.def@1.23 +38 -16 + Update ntp.conf documentation. Harlan Stenn. + +ChangeSet@1.3638.1.3, 2016-02-22 03:39:39+00:00, stenn@psp-deb1.ntp.org + Bug 3007 cleanup + + ntpd/ntp_proto.c@1.379 +4 -1 + Bug 3007 cleanup + +ChangeSet@1.3630.8.1, 2016-02-21 15:09:37+01:00, perlinger@ntp.org + [Bug 3009] Crafted addpeer with hmode > 7 causes OOB error + + ChangeLog@1.1794.8.1 +2 -0 + [Bug 3009] Crafted addpeer with hmode > 7 causes OOB error + + ntpd/ntp_request.c@1.117.2.1 +29 -2 + [Bug 3009] Crafted addpeer with hmode > 7 causes OOB error + - added more stringent checks on packet content: + hmode <= 6 (7 is already out of range for a peer mode!) + +ChangeSet@1.3630.7.2, 2016-02-21 09:39:25+01:00, perlinger@ntp.org + Bug 3010] remote configuration trustedkey/requestkey values are not properly validated + - sidekick: Ignore keys that have an unsupported MAC algorithm but are otherwise well-formed + + ChangeLog@1.1794.7.2 +2 -0 + Bug 3010] remote configuration trustedkey/requestkey values are not properly validated + - sidekick: Ignore keys that have an unsupported MAC algorithm but are otherwise well-formed + + libntp/authreadkeys.c@1.26 +48 -26 + [Bug 3010] remote configuration trustedkey/requestkey values are not properly validated + - sidekick: Ignore keys that have an unsupported MAC algorithm but are otherwise well-formed + +ChangeSet@1.3630.7.1, 2016-02-19 22:42:25+01:00, perlinger@ntp.org + [Bug 3010] remote configuration trustedkey/requestkey values are not properly validated + + ChangeLog@1.1794.7.1 +2 -0 + [Bug 3010] remote configuration trustedkey/requestkey values are not properly validated + + ntpd/ntp_request.c@1.117.1.1 +41 -25 + [Bug 3010] remote configuration trustedkey/requestkey values are not properly validated + - make sure the new keyids are valid static key IDs and present in the key table + +ChangeSet@1.3630.6.1, 2016-02-19 19:47:31+01:00, perlinger@ntp.org + [Bug 3013] Fix for ssl_init.c SHA1 test + + ChangeLog@1.1794.6.1 +2 -0 + [Bug 3013] Fix for ssl_init.c SHA1 test + + tests/libntp/ssl_init.c@1.9 +2 -2 + [Bug 3013] Fix for ssl_init.c SHA1 test + - Require SHA1 explicitely, to avoid confusion with (deprecated) SHA0. + Patch provided by Ch. Weisgerber + +ChangeSet@1.3630.5.1, 2016-02-17 18:36:10+01:00, perlinger@ntp.org + [Bug 3015] ntpq: config-from-file: "request contains an unprintable character" + + ChangeLog@1.1794.5.1 +3 -0 + [Bug 3015] ntpq: config-from-file: "request contains an unprintable character" + + ntpq/ntpq-subs.c@1.117 +35 -16 + [Bug 3015] ntpq: config-from-file: "request contains an unprintable character" + - remove trailing whitespace in remote config command + - remove comments, too. + +ChangeSet@1.3639, 2016-02-17 09:30:05+01:00, jnperlin@hydra.localnet + [Bug 3008] ctl_getitem() return value not always checked + + ChangeLog@1.1802 +3 -0 + [Bug 3008] ctl_getitem() return value not always checked + + ntpd/ntp_control.c@1.206.1.1 +101 -58 + [Bug 3008] ctl_getitem() return value not always checked + - also some cleanup of ctl_getitem + +ChangeSet@1.3630.3.3, 2016-02-14 10:15:57+00:00, stenn@psp-deb1.ntp.org + Fix typo in html/monopt.html. Harlan Stenn. + + ChangeLog@1.1794.3.3 +1 -0 + Fix typo in html/monopt.html. Harlan Stenn. + + html/monopt.html@1.39 +2 -2 + Fix typo in html/monopt.html. Harlan Stenn. + +ChangeSet@1.3630.3.2, 2016-02-13 09:15:45+00:00, stenn@psp-deb1.ntp.org + Fix some Credit: attributions in the NEWS file. Harlan Stenn. + + ChangeLog@1.1794.3.2 +1 -0 + Fix some Credit: attributions in the NEWS file. Harlan Stenn. + + NEWS@1.161 +3 -2 + Fix some Credit: attributions in the NEWS file. Harlan Stenn. + +ChangeSet@1.3630.4.1, 2016-02-10 20:11:21+01:00, perlinger@ntp.org + [Bug 3011] Duplicate IPs on unconfig directives will cause an assertion botch + + ChangeLog@1.1794.4.1 +2 -0 + [Bug 3011] Duplicate IPs on unconfig directives will cause an assertion botch + + ntpd/ntp_request.c@1.118 +48 -78 + [Bug 3011] Duplicate IPs on unconfig directives will cause an assertion botch + - reworked 'do_unconf()' to survive the effect of having peers named multiple times + +ChangeSet@1.3630.2.3, 2016-02-09 00:46:57+00:00, mayer@psp-deb1.ntp.org *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Apr 27 09:35:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEFD5B1EA4B; Wed, 27 Apr 2016 09:35:50 +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 6380119E1; Wed, 27 Apr 2016 09:35:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c211-30-172-161.carlnfd1.nsw.optusnet.com.au [211.30.172.161]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 0CDFF427618; Wed, 27 Apr 2016 19:04:56 +1000 (AEST) Date: Wed, 27 Apr 2016 19:04:55 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: "Conrad E. Meyer" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298671 - head/sys/geom/part In-Reply-To: <201604262230.u3QMUs7W073468@repo.freebsd.org> Message-ID: <20160427173605.H1272@besplex.bde.org> References: <201604262230.u3QMUs7W073468@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=c+ZWOkJl c=1 sm=1 tr=0 a=tA1DmVjRWuAyocftnDq7bQ==:117 a=tA1DmVjRWuAyocftnDq7bQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=tlvk3plgDSp4RpOT_RMA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 09:35:50 -0000 On Tue, 26 Apr 2016, Conrad E. Meyer wrote: > Log: > g_part_bsd64: Check for valid on-disk npartitions value > > This value is u32 on disk, but assigned to an int in memory. After we do the > implicit conversion via assignment, check that the result is at least one[1] > (non-negative[2]). > > 1. The subsequent for-loop iterates from gpt_entries minus one, down, until > reaching zero. A negative or zero initial index results in undefined signed > integer overflow. > 2. It is also used to index into arrays later. > > In practice, we expected non-malicious disks to contain small positive values. It is a common programming error to use unsigned types to contain small positive values. This gives [un]sign extension/overflow bugs like (1) by making it difficult to use subtraction operators. (The loop doesn't actually have bug (1) -- it correctly uses only ints in the loop -- see below near the end. Signed integer overflow mostly doesn't occur either. Only an initial value if INT_MIN would give it for subtracting 1. The first undefined behaviour for a negative initial index is actually for the array indexing in crc32(... d_partitions[basetable->gpt_entries]).) struct g_part_table doesn't have as many instances of this bug as struct disklabel or struct disklabel64, so conversions tend to cause [un]sign extension/overflow bugs like [0]. Using unsigned types just gives wrong values with no overflow if the target type is too small. > Reported by: Coverity > CID: 1223202 > Sponsored by: EMC / Isilon Storage Division > > Modified: > head/sys/geom/part/g_part_bsd64.c > > Modified: head/sys/geom/part/g_part_bsd64.c > ============================================================================== > --- head/sys/geom/part/g_part_bsd64.c Tue Apr 26 22:01:07 2016 (r298670) > +++ head/sys/geom/part/g_part_bsd64.c Tue Apr 26 22:30:54 2016 (r298671) > @@ -509,7 +509,8 @@ g_part_bsd64_read(struct g_part_table *b > > dlp = (struct disklabel64 *)buf; > basetable->gpt_entries = le32toh(dlp->d_npartitions); Overflow still occurs here if the source value actually uses all 32 of its bits (assuming 32-bit ints -- otherwise the analysis is even more complicated. POSIX now requires >= 32-bit ints, and FreeBSD never supported anything else, so this assumption is safe for now, but stating it complicates the analysis). > - if (basetable->gpt_entries > MAXPARTITIONS64) > + if (basetable->gpt_entries > MAXPARTITIONS64 || > + basetable->gpt_entries < 1) > goto invalid_label; This check is still bogus, since it checks for overflow after overflow has caused implementation-defined behaviour. This requires a complicated analysis to justify even for the usual behaviour of 2's complement wrapping. I've never seen any implementation that documuments this. The correct check doesn't need any complicated analysis. It just checks the source value before clobbering it by assigning it to a possibly-different type. It is still not so easy to know the correct type to use, since the source value is encoded and __typeof(source_value) is unportable. But we already had to use knowledge of its type to hard-code the decoding method as le32toh(). So we may as well hard-code the type too: uint32_t npart; /* XXX: assume that dlp_npartitions is u32 */ ... npart = le32toh(dlp->d_npartitions); if (npart < 1 || npart > MAXPARTITIONS64) goto invalid_label; basetable->gpt_entries = npart; Old struct disklabel has the same design bug, but its d_npartitions has type uint16_t. With 32-bit ints, uint16_t promotes to plain int, so its unsigned features are hard to use even if you want them. Expressions like le16toh(dlp->d_npartitions) - 1 worked as intended but rarely as wanted after C90 standardised the bad "value-preserving" sign extension rules: when the source value is 0, the value of this subtraction is -1 with a 16-bit source but 0xFFFFFFFFU with a 32-bit source (assuming a 32-bit int target -- the general case is more complicated). This makes loops difficult to write. If you use an index variable i then it should have type int, but might need to be uint32_t depending on the source type and compiler warnings. If you use the entry in the struct more directly, then counting down from -1 to 0 just won't work if the type in the struct is unsigned, except in some contexts where this type is smaller than int and the "value-preserving" rule gives the normally-unwanted value of -1. The decoding step prevents direct use in most cases. Thus it is very natural to fix unsigned design errors in standard structs -- you have to check bounds when converting, and the bounds usually don't go above INT16_MAX, so you can use signed types in your own structs. gpt->gpt_entries and the index variable ('index') for the loop that counts it down actually have the correct type (int), so point (1) is incorrect -- a negative or zero initial index just results in signed 0 being correctly counted down to -1 so that the loop iterates 0 times. Also, even with unsigned types, there would be no undefined behaviour -- 0U would be counted down to UINT_MAX, and assigning this to 'int index' would only cause implementation-defined behaviour. Nothing bad seems to happen for zero entries when the loop does nothing. Zero entries might even be a valid format; however, all disklabels are supposed to have a 'c' partition which takes 3 entries to reach, so 1 or 2 entries are just as invalid as ones with 0 entries. Bruce From owner-svn-src-head@freebsd.org Wed Apr 27 09:40:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB46EB1ED47; Wed, 27 Apr 2016 09:40:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ABE271D16; Wed, 27 Apr 2016 09:40:56 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3R9etA2075835; Wed, 27 Apr 2016 09:40:55 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3R9ethr075834; Wed, 27 Apr 2016 09:40:55 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604270940.u3R9ethr075834@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Wed, 27 Apr 2016 09:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298696 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 09:40:57 -0000 Author: sephe Date: Wed Apr 27 09:40:55 2016 New Revision: 298696 URL: https://svnweb.freebsd.org/changeset/base/298696 Log: tcp/lro: Fix typo. MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Wed Apr 27 07:46:38 2016 (r298695) +++ head/sys/netinet/tcp_lro.c Wed Apr 27 09:40:55 2016 (r298696) @@ -569,7 +569,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0) return (TCP_LRO_CANNOT); - /* XXX-BZ We lose a AKC|PUSH flag concatinating multiple segments. */ + /* XXX-BZ We lose a ACK|PUSH flag concatinating multiple segments. */ /* XXX-BZ Ideally we'd flush on PUSH? */ /* From owner-svn-src-head@freebsd.org Wed Apr 27 14:18:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 10529B1D967 for ; Wed, 27 Apr 2016 14:18:05 +0000 (UTC) (envelope-from bounce-mc.us1_50242045.3087345-svn-src-head=freebsd.org@mail196.atl21.rsgsv.net) Received: from mail196.atl21.rsgsv.net (mail196.atl21.rsgsv.net [205.201.133.196]) by mx1.freebsd.org (Postfix) with ESMTP id ACEE41C1E for ; Wed, 27 Apr 2016 14:18:04 +0000 (UTC) (envelope-from bounce-mc.us1_50242045.3087345-svn-src-head=freebsd.org@mail196.atl21.rsgsv.net) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; s=k1; d=mail196.atl21.rsgsv.net; h=Subject:From:Reply-To:To:Date:Message-ID:List-ID:List-Unsubscribe:Sender:Content-Type:MIME-Version; i=divyajit=3Dfashionablyin.com@mail196.atl21.rsgsv.net; bh=Qv6TeBYKgxokzj+IWdiOFHWYmsI=; b=VmfHCSD3WrkPU2jNztxKlbFppg7/2K0iNvO57++ryUVKnpQpHVHUX7XBoihxCuyd8+mL6cyaqsNF yWayDipgCPSTdZT/u0C2xg7tBBj59jUhErLJj9vBYWBC+87Tpd2xBU9NsyevJ665OlGpAL64BxGj ZpqYVJ+C91ihPxdQ9uE= Received: from (127.0.0.1) by mail196.atl21.rsgsv.net id h4351o1lgi4o for ; Wed, 27 Apr 2016 14:17:57 +0000 (envelope-from ) Subject: =?utf-8?Q?Leshow=20Moscow?= From: =?utf-8?Q?Divyajit=20Kaur?= Reply-To: =?utf-8?Q?Divyajit=20Kaur?= To: =?utf-8?Q??= Date: Wed, 27 Apr 2016 14:17:57 +0000 Message-ID: <8e7d8ec661c4606682b4765ddf2b96bde3b.20160427141707@mail196.atl21.rsgsv.net> X-Mailer: MailChimp Mailer - **CIDe0a87c6572f2b96bde3b** X-Campaign: mailchimp8e7d8ec661c4606682b4765dd.e0a87c6572 X-campaignid: mailchimp8e7d8ec661c4606682b4765dd.e0a87c6572 X-Report-Abuse: Please report abuse for this campaign here: http://www.mailchimp.com/abuse/abuse.phtml?u=8e7d8ec661c4606682b4765dd&id=e0a87c6572&e=f2b96bde3b X-MC-User: 8e7d8ec661c4606682b4765dd X-Feedback-ID: 50242045:50242045.3087345:us1:mc X-Accounttype: pd Sender: "Divyajit Kaur" x-mcda: FALSE MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format="fixed" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 14:18:05 -0000 ** 27 April 2016 ------------------------------------------------------------ ** Wednesday ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D9323eb3a35&e=3Df2b96bde3b http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3Df54d165284&e=3Df2b96bde3b ** Leshow Moscow ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D159992cbf6&e=3Df2b96bde3b ** ARS ARPEL GROUP ------------------------------------------------------------ ** Since 1947 in the field of footwear and leather goods=2C ARS ARPEL GROU= P magazines bring you the latest news on collections from trade fairs... Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8e= c661c4606682b4765dd&id=3Dc5408ba74c&e=3Df2b96bde3b) ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D00aaae5e64&e=3Df2b96bde3b ** WELL WAY INDUSTRIES ------------------------------------------------------------ ** WELLWAY is Globally reputed manufacturers & exporters of an extensive r= ange of all kind of Fashion Leather Garments... Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8e= c661c4606682b4765dd&id=3D3e84623329&e=3Df2b96bde3b) ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D301e004e70&e=3Df2b96bde3b ** FUXIN AODELI LEATHER CO LTD ------------------------------------------------------------ ** Fuxin Aodeli Leather Co.=2C Ltd. is a professional enterprise=2C which= combine the development=2C production=2C sales =2Cdevote ourselves... Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8e= c661c4606682b4765dd&id=3D5f703d7735&e=3Df2b96bde3b) ------------------------------------------------------------ http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8ec661c46066= 82b4765dd&id=3D3915a8e002&e=3Df2b96bde3b ** YOU ------------------------------------------------------------ ** CAN BE HERE ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D4bb3703e33&e=3Df2b96bde3b ** ARMADA FUR COLLECTION ------------------------------------------------------------ ** Armada Fur Collection - is a brand in the fur industry=2C which is a ve= ry short time has won the trust and respectability of its customers... Read More (http://fashionablyin.us1.list-manage1.com/track/click?u=3D8e7d8= ec661c4606682b4765dd&id=3Dc40e5a99b2&e=3Df2b96bde3b) ------------------------------------------------------------ http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c460668= 2b4765dd&id=3D9119efaf76&e=3Df2b96bde3b ** SOFT GOLD ------------------------------------------------------------ ** Soft Gold Studio is a line of modern jewelry grounded by minimalist met= alwork & inspired by unique materials. You'll find a mix of gold... Read More (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8e= c661c4606682b4765dd&id=3Dec4a23ba16&e=3Df2b96bde3b) ------------------------------------------------------------ =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3Ddc03d7b619&e=3Df2b96bde3b) Denim : Fashion's Frontier ** (http://fashionablyin.us1.list-manage2.com/track/click?u=3D8e7d8ec661c4= 606682b4765dd&id=3Ded01c0c1b9&e=3Df2b96bde3b) BECOME A FASHIONABLYIN CONSULTANT ** GO PREMIUM!! (http://fashionablyin.us1.list-manage1.com/track/click?u= =3D8e7d8ec661c4606682b4765dd&id=3Dee844d299b&e=3Df2b96bde3b) ** MARKETING SERVICES (http://fashionablyin.us1.list-manage2.com/track/cli= ck?u=3D8e7d8ec661c4606682b4765dd&id=3D220c9f9b45&e=3Df2b96bde3b) ** ADVERTISE ON FASHIONABLYIN (http://fashionablyin.us1.list-manage.com/tr= ack/click?u=3D8e7d8ec661c4606682b4765dd&id=3Df0f9637367&e=3D= f2b96bde3b) ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3De20bd43dff&e=3Df2b96bde3b) ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3D9b1928403f&e=3Df2b96bde3b) ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3De21b854cde&e=3Df2b96bde3b) ** (http://fashionablyin.us1.list-manage.com/track/click?u=3D8e7d8ec661c46= 06682b4765dd&id=3Ddb8ae4cde1&e=3Df2b96bde3b) Copyright =C2=A9 2016 FASHIONABLYIN=2C All rights reserved. You subscribed on our website - Fashionablyin.com Our mailing address is: FASHIONABLYIN 2-4 Unit 27 Exmoor Street London=2C W10 6BD United Kingdom Want to change how you receive these emails? You can ** update your preferences (http://fashionablyin.us1.list-manage2.= com/profile?u=3D8e7d8ec661c4606682b4765dd&id=3Db4c7b5ed13&e=3Df2b96bde3b) or ** unsubscribe from this list (http://fashionablyin.us1.list-manage1.co= m/unsubscribe?u=3D8e7d8ec661c4606682b4765dd&id=3Db4c7b5ed13&e=3Df2b96bde3b&c= =3De0a87c6572) From owner-svn-src-head@freebsd.org Wed Apr 27 14:57:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8845B1E4F4 for ; Wed, 27 Apr 2016 14:57:50 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x230.google.com (mail-lf0-x230.google.com [IPv6:2a00:1450:4010: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 31A62130D for ; Wed, 27 Apr 2016 14:57:50 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x230.google.com with SMTP id j11so59849423lfb.1 for ; Wed, 27 Apr 2016 07:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Lm3j5gLvhs2UtXHUpNRFatY/VmoVcXXB6iO5dNI7zf8=; b=XVpmc1rx1n6JHQHBBwKBl2qwSdy07osjV5jsXk7Pni57psO0Mg4b/AtR+l2AO07K1o 5/XPqih01DffEd40ztTD0wE9pM83UlZi/viRR0uAZjaFwxrmj0QWK5cBj73wd93vyyoQ ipOd8+pPeMeOU7gJcoxzIhox0/XobcfBN8P8j4BwBpwsKR+2amzostntYW+8hJUsJVrt dKOMEL0VmP/3KChu+5hXANiz1m0DuRr6gSgc8O/RIVK5t8cj6QwY/Xc7KHkMB6mZUprI s6CzTqjKF8WMFNL7o6q81ZWyjSTwPFKNKYOV5iVBxkEoW+aHvgBlIrcdEA27kiWTfyHW zGaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Lm3j5gLvhs2UtXHUpNRFatY/VmoVcXXB6iO5dNI7zf8=; b=VUYXuVgwdkvzVJijF/J/ubfJGvZdfNuI4z1xkTvOQq2LsAQlDY2pqUR+4zHW5XfgDk i1V/bswv88zoX3eY8Cce2yhjaRkMsr26W//5BghKpVGnp7bTAJQ3iY7zIzFuTUfRzGyQ E3YXCdP2+sx9JZobgnqaBoqaTiTWeT8DvgW9oFt8/GL82ex392tbIhIRnbRN2UW87YnD dh/JQYlIFc+rwTGOMYwVYQhJVBgtaExSFUrm3VZdNKhw/ZY/a2YsFXM0Iesb0hSABwPd Uyv1FHywNin4AjHvt52MFxiEdGZS9VUIMpjqlv+1zqcxtuUwTM3wRX71voSwkP8IIT+9 532g== X-Gm-Message-State: AOPr4FVpy4G/IPsnBUecByMswUDac8UieoqkiB63Dhwqp5zn/FuTnbYs4Q8pEqSl6US+Ng2putaqcJOLscIfSA== X-Received: by 10.25.135.5 with SMTP id j5mr2128092lfd.15.1461769067914; Wed, 27 Apr 2016 07:57:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.205.1 with HTTP; Wed, 27 Apr 2016 07:57:28 -0700 (PDT) In-Reply-To: <201604211827.u3LIR5ML089177@repo.freebsd.org> References: <201604211827.u3LIR5ML089177@repo.freebsd.org> From: Zbigniew Bodek Date: Wed, 27 Apr 2016 16:57:28 +0200 Message-ID: Subject: Re: svn commit: r298425 - head/sys/dev/acpica To: John Baldwin , =?UTF-8?Q?Micha=C5=82_Stanek?= 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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 14:57:51 -0000 Hello, I'm forwarding a message from Michal Stanek who found some problems wit this commit. Please see below: ------------------------------------------- I'm getting a lot of ACPI error messages on ThunderX (arm64). The kernel also panics before it gets to prompt. Running bisect pointed to this patch as the culprit. Removing acpi from GENERIC configuration fixes the issue. Here is the boot log: FreeBSD/SMP: Multiprocessor System Detected: 48 CPUs random: entropy device external interface ACPI: Table initialisation failed: AE_NOT_FOUND ACPI: Try disabling either ACPI or apic support. ofwbus0: simplebus0: on ofwbus0 (...) Timecounters tick every 1.000 msec usbus0: 5.0Gbps Super Speed USB v3.0 usbus1: 5.0Gbps Super Speed USB v3.0 ugen0.1: <0x177d> at usbus0 uhub0: <0x177d XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus0 ugen1.1: <0x177d> at usbus1 uhub1: <0x177d XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus1 ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) ada0 at ahcich0 bus 0 scbus0 target 0 lun 0 ada0: ATA-7 SATA 1.x device ada0: Serial Number 9QZ6QN7K ada0: 150.000MB/s transfers (SATA 1.x, UDMA6, PIO 8192bytes) ada0: Command Queueing enabled ada0: 76319MB (156301488 512 byte sectors) ACPI Exception: AE_BAD_PARAMETER, nfs_diskless: no NFS handle Release APs CPU 0: Cavium Thunder r0p1 affinity: 0 0 Instruction Set Attributes 0 = Instruction Set Attributes 1 = <0> Thread 100112 could not acquire Mutex [0x1] Processor Features 0 = < (20150818/utmutex-320) GICACPI Exception: AE_BAD_PARAMETER, ,AdvSIMDThread 100112 could not acquire Mutex [0x1],Float (20150818/utmutex-320) ,EL3ACPI Exception: AE_BAD_PARAMETER, ,EL2Thread 100112 could not acquire Mutex [0x1],EL1 (20150818/utmutex-320) ,EL0ACPI Exception: AE_BAD_PARAMETER, > Thread 100112 could not acquire Mutex [0x1] Processor Features 1 = <0> (20150818/utmutex-320) Memory Model Features 0 = (20150818/utmutex-320) Memory Model Features 1 = <0x20> ACPI Exception: AE_BAD_PARAMETER, Debug Features 0 = Thread 100112 could not acquire Mutex [0x1] Debug Features 1 = <0> (20150818/utmutex-320) Auxiliary Features 0 = <0> ACPI Exception: AE_BAD_PARAMETER, Auxiliary Features 1 = <0> Thread 100112 could not acquire Mutex [0x1]CPU 1: Cavium Thunder r0p1 (20150818/utmutex-320) affinity:ACPI Exception: AE_BAD_PARAMETER, 0Thread 100112 could not acquire Mutex [0x1] 1 (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, CPU 2: Cavium Thunder r0p1Thread 100112 could not acquire Mutex [0x1] affinity: (20150818/utmutex-320) 0ACPI Exception: AE_BAD_PARAMETER, 2Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) CPU 3: Cavium Thunder r0p1ACPI Exception: AE_BAD_PARAMETER, affinity:Thread 100112 could not acquire Mutex [0x1] 0 (20150818/utmutex-320) 3ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1]CPU 4: Cavium Thunder r0p1 (20150818/utmutex-320) affinity:ACPI Exception: AE_BAD_PARAMETER, 0Thread 100112 could not acquire Mutex [0x1] 4 (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, CPU 5: Cavium Thunder r0p1Thread 100112 could not acquire Mutex [0x1] affinity: (20150818/utmutex-320) 0ACPI Exception: AE_BAD_PARAMETER, 5Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) CPU 6: Cavium Thunder r0p1ACPI Exception: AE_BAD_PARAMETER, affinity:Thread 100112 could not acquire Mutex [0x1] 0 (20150818/utmutex-320) 6ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1]CPU 7: Cavium Thunder r0p1 (20150818/utmutex-320) affinity:ACPI Exception: AE_BAD_PARAMETER, 0Thread 100112 could not acquire Mutex [0x1] 7 (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, CPU 8: Cavium Thunder r0p1Thread 100112 could not acquire Mutex [0x1] affinity: (20150818/utmutex-320) 0ACPI Exception: AE_BAD_PARAMETER, 8Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) CPU 9: Cavium Thunder r0p1ACPI Exception: AE_BAD_PARAMETER, affinity:Thread 100112 could not acquire Mutex [0x1] 0 (20150818/utmutex-320) 9ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1]CPU 10: Cavium Thunder r0p1 (20150818/utmutex-320) affinity:ACPI Exception: AE_BAD_PARAMETER, 0Thread 100112 could not acquire Mutex [0x1] 10 (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, CPU 11: Cavium Thunder r0p1Thread 100112 could not acquire Mutex [0x1] affinity: (20150818/utmutex-320) 0ACPI Exception: AE_BAD_PARAMETER, 11Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) CPU 12: Cavium Thunder r0p1ACPI Exception: AE_BAD_PARAMETER, affinity:Thread 100112 could not acquire Mutex [0x1] 0 (20150818/utmutex-320) 12ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1]CPU 13: Cavium Thunder r0p1 (20150818/utmutex-320) affinity:ACPI Exception: AE_BAD_PARAMETER, 0Thread 100112 could not acquire Mutex [0x1] 13 (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, CPU 14: Cavium Thunder r0p1Thread 100112 could not acquire Mutex [0x1] affinity: (20150818/utmutex-320) 0ACPI Exception: AE_BAD_PARAMETER, 14Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) CPU 15: Cavium Thunder r0p1ACPI Exception: AE_BAD_PARAMETER, affinity:Thread 100112 could not acquire Mutex [0x1] 0 (20150818/utmutex-320) 15ACPI Exception: AE_BAD_PARAMETER, Thread 100112 could not acquire Mutex [0x1]CPU 16: Cavium Thunder r0p1 (20150818/utmutex-320) affinity:ACPI Exception: AE_BAD_PARAMETER, 1Thread 100112 could not acquire Mutex [0x1] 0 (20150818/utmutex-320) ACPI Exception: AE_BAD_PARAMETER, CPU 17: Cavium Thunder r0p1Thread 100112 could not acquire Mutex [0x1] affinity: (20150818/utmutex-320) 1ACPI Exception: AE_BAD_PARAMETER, 1Thread 100112 could not acquire Mutex [0x1] (20150818/utmutex-320) CPU 18: Cavium Thunder r0p1 affinity: 1 2 CPU 19: Cavium Thunder r0p1 affinity: 1 3 CPU 20: Cavium Thunder r0p1 affinity: 1 4 CPU 21: Cavium Thunder r0p1 affinity: 1 5 CPU 22: Cavium Thunder r0p1 affinity: 1 6 CPU 23: Cavium Thunder r0p1 affinity: 1 7 CPU 24: Cavium Thunder r0p1 affinity: 1 8 CPU 25: Cavium Thunder r0p1 affinity: 1 9 CPU 26: Cavium Thunder r0p1 affinity: 1 10 CPU 27: Cavium Thunder r0p1 affinity: 1 11 CPU 28: Cavium Thunder r0p1 affinity: 1 12 CPU 29: Cavium Thunder r0p1 affinity: 1 13 CPU 30: Cavium Thunder r0p1 affinity: 1 14 CPU 31: Cavium Thunder r0p1 affinity: 1 15 CPU 32: Cavium Thunder r0p1 affinity: 2 0 CPU 33: Cavium Thunder r0p1 affinity: 2 1 CPU 34: Cavium Thunder r0p1 affinity: 2 2 CPU 35: Cavium Thunder r0p1 affinity: 2 3 CPU 36: Cavium Thunder r0p1 affinity: 2 4 CPU 37: Cavium Thunder r0p1 affinity: 2 5 CPU 38: Cavium Thunder r0p1 affinity: 2 6 CPU 39: Cavium Thunder r0p1 affinity: 2 7 CPU 40: Cavium Thunder r0p1 affinity: 2 8 CPU 41: Cavium Thunder r0p1 affinity: 2 9 CPU 42: Cavium Thunder r0p1 affinity: 2 10 CPU 43: Cavium Thunder r0p1 affinity: 2 11 CPU 44: Cavium Thunder r0p1 affinity: 2 12 CPU 45: Cavium Thunder r0p1 affinity: 2 13 CPU 46: Cavium Thunder r0p1 affinity: 2 14 CPU 47: Cavium Thunder r0p1 affinity: 2 15 WARNING: WITNESS option enabled, expect reduced performance. Root mount waiting for: usbus1 usbus0 uhub1: 2 ports with 2 removable, self powered uhub0: 2 ports with 2 removable, self powered ugen1.2: at usbus1 uhub2: on usbus1 uhub2: MTT could not be enabled device_attach: uhub2 attach returned 6 Root mount waiting for: usbus1 ugen1.3: at usbus1 uhub2: on usbus1 uhub2: 4 ports with 4 removable, self powered Loader variables: Manual root filesystem specification: : [options] Mount using filesystem and with the specified (optional) option list. eg. ufs:/dev/da0s1a zfs:tank cd9660:/dev/cd0 ro (which is equivalent to: mount -t cd9660 -o ro /dev/cd0 /) ? List valid disk boot devices . Yield 1 second (for background tasks) Abort manual input mountroot> ufs:/dev/ada0s2 Trying to mount root from ufs:/dev/ada0s2 []... usb_dev_suspend_peer: Setting device remote wakeup failed warning: no time-of-day clock registered, system time will not be set accurately usb_dev_resume_peer: Clearing device remote wakeup failed: USB_ERR_STALLED Setting hostuuid: 701a2acc-d0a0-11e5-8550-001517169365. Setting hostid: 0x2abffeca. No suitable dump device was found. Starting file system checks: /dev/ada0s2: FILE SYSTEM CLEAN; SKIPPING CHECKS /dev/ada0s2: clean, 15310288 free (1672 frags, 1913577 blocks, 0.0% fragmentation) Mounting local file systems:. ELF ldconfig path: /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/llvm36/lib random: unblocking device. Setting hostname: thunder_crb4. Setting up harvesting:[UMA],[FS_ATIME],SWI,INTERRUPT,NET_NG,NET_ETHER,NET_TUN,MOUSE,KEYBOARD,ATTACH,CACHED Feeding entropy:. Starting Network: lo0 em0. lo0: flags=8049 metric 0 mtu 16384 options=600003 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 inet 127.0.0.1 netmask 0xff000000 groups: lo nd6 options=21 em0: flags=8843 metric 0 mtu 1500 options=4019b ether 00:15:17:16:93:65 media: Ethernet autoselect status: no carrier nd6 options=29 Starting devd. panic: Bad link elm 0xfffffd0004972020 next->prev != elm cpuid = 47 KDB: stack backtrace: db_trace_self() at db_trace_self_wrapper+0x28 pc = 0xffff000000532e20 lr = 0xffff0000000770e4 sp = 0xffff0006535fd510 fp = 0xffff0006535fd720 db_trace_self_wrapper() at vpanic+0x170 pc = 0xffff0000000770e4 lr = 0xffff0000002a8278 sp = 0xffff0006535fd730 fp = 0xffff0006535fd7b0 vpanic() at panic+0x4c pc = 0xffff0000002a8278 lr = 0xffff0000002a8308 sp = 0xffff0006535fd7c0 fp = 0xffff0006535fd840 panic() at devread+0x174 pc = 0xffff0000002a8308 lr = 0xffff0000002dbea4 sp = 0xffff0006535fd850 fp = 0xffff0006535fd870 devread() at devfs_read_f+0xdc pc = 0xffff0000002dbea4 lr = 0xffff00000019981c sp = 0xffff0006535fd880 fp = 0xffff0006535fd8d0 devfs_read_f() at dofileread+0x9c pc = 0xffff00000019981c lr = 0xffff000000303ebc sp = 0xffff0006535fd8e0 fp = 0xffff0006535fd920 dofileread() at kern_readv+0x6c pc = 0xffff000000303ebc lr = 0xffff000000303ba4 sp = 0xffff0006535fd930 fp = 0xffff0006535fd970 kern_readv() at sys_read+0x7c pc = 0xffff000000303ba4 lr = 0xffff000000303b28 sp = 0xffff0006535fd980 fp = 0xffff0006535fd9c0 sys_read() at do_el0_sync+0x4d4 pc = 0xffff000000303b28 lr = 0xffff00000054906c sp = 0xffff0006535fd9d0 fp = 0xffff0006535fda80 do_el0_sync() at handle_el0_sync+0x64 pc = 0xffff00000054906c lr = 0xffff0000005349d0 sp = 0xffff0006535fda90 fp = 0xffff0006535fdba0 handle_el0_sync() at 0x403074 pc = 0xffff0000005349d0 lr = 0x0000000000403074 sp = 0xffff0006535fdbb0 fp = 0x0000ffffffffed30 KDB: enter: panic [ thread pid 268 tid 100177 ] Stopped at kdb_enter+0x40: undefined d4200000 db> 2016-04-21 20:27 GMT+02:00 John Baldwin : > Author: jhb > Date: Thu Apr 21 18:27:05 2016 > New Revision: 298425 > URL: https://svnweb.freebsd.org/changeset/base/298425 > > Log: > Queue the CPU-probing task after all acpi_cpu devices are attached. > > Eventually with earlier AP startup this code will change to call the > startup function synchronously instead of queueing the task. Moving > the time we queue the task should be a no-op since taskqueue threads > don't start executing tasks until much later, but this reduces the diff > with the earlier AP startup patches. > > Sponsored by: Netflix > > Modified: > head/sys/dev/acpica/acpi_cpu.c > > Modified: head/sys/dev/acpica/acpi_cpu.c > > ============================================================================== > --- head/sys/dev/acpica/acpi_cpu.c Thu Apr 21 17:45:37 2016 > (r298424) > +++ head/sys/dev/acpica/acpi_cpu.c Thu Apr 21 18:27:05 2016 > (r298425) > @@ -355,9 +355,6 @@ acpi_cpu_attach(device_t dev) > cpu_sysctl_tree = SYSCTL_ADD_NODE(&cpu_sysctl_ctx, > SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "cpu", > CTLFLAG_RD, 0, "node for CPU children"); > - > - /* Queue post cpu-probing task handler */ > - AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL); > } > > /* > @@ -423,17 +420,27 @@ acpi_cpu_postattach(void *unused __unuse > device_t *devices; > int err; > int i, n; > + int attached; > > err = devclass_get_devices(acpi_cpu_devclass, &devices, &n); > if (err != 0) { > printf("devclass_get_devices(acpi_cpu_devclass) failed\n"); > return; > } > + attached = 0; > + for (i = 0; i < n; i++) > + if (device_is_attached(devices[i])) > + attached = 1; > for (i = 0; i < n; i++) > bus_generic_probe(devices[i]); > for (i = 0; i < n; i++) > bus_generic_attach(devices[i]); > free(devices, M_TEMP); > + > + if (attached) { > + /* Queue post cpu-probing task handler */ > + AcpiOsExecute(OSL_NOTIFY_HANDLER, acpi_cpu_startup, NULL); > + } > } > > SYSINIT(acpi_cpu, SI_SUB_CONFIGURE, SI_ORDER_MIDDLE, > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Wed Apr 27 15:10:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E11FB1E7CA; Wed, 27 Apr 2016 15:10:41 +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 7A9111AC0; Wed, 27 Apr 2016 15:10:41 +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 u3RFAeuH076606; Wed, 27 Apr 2016 15:10:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RFAe1s076601; Wed, 27 Apr 2016 15:10:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604271510.u3RFAe1s076601@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Apr 2016 15:10:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298698 - in head/sys/geom: . mirror raid virstor X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 15:10:41 -0000 Author: pfg Date: Wed Apr 27 15:10:40 2016 New Revision: 298698 URL: https://svnweb.freebsd.org/changeset/base/298698 Log: geom: unsign some types to match their definitions and avoid overflows. In struct:gctl_req, nargs is unsigned. In mirror: g_mirror_syncreqs is unsigned. In raid: in struct:g_raid_volume, v_disks_count is unsigned. In virstor: in struct:g_virstor_softc, n_components is unsigned. MFC after: 2 weeks Modified: head/sys/geom/geom_ctl.c head/sys/geom/mirror/g_mirror.c head/sys/geom/raid/md_promise.c head/sys/geom/raid/md_sii.c head/sys/geom/virstor/g_virstor.c Modified: head/sys/geom/geom_ctl.c ============================================================================== --- head/sys/geom/geom_ctl.c Wed Apr 27 13:10:43 2016 (r298697) +++ head/sys/geom/geom_ctl.c Wed Apr 27 15:10:40 2016 (r298698) @@ -135,7 +135,7 @@ gctl_copyin(struct gctl_req *req) { struct gctl_req_arg *ap; char *p; - int i; + u_int i; ap = geom_alloc_copyin(req, req->arg, req->narg * sizeof(*ap)); if (ap == NULL) { @@ -212,7 +212,7 @@ gctl_copyout(struct gctl_req *req) static void gctl_free(struct gctl_req *req) { - int i; + u_int i; sbuf_delete(req->serror); if (req->arg == NULL) @@ -270,7 +270,7 @@ int gctl_set_param(struct gctl_req *req, const char *param, void const *ptr, int len) { - int i; + u_int i; struct gctl_req_arg *ap; for (i = 0; i < req->narg; i++) { @@ -311,7 +311,7 @@ gctl_set_param_err(struct gctl_req *req, void * gctl_get_param(struct gctl_req *req, const char *param, int *len) { - int i; + u_int i; void *p; struct gctl_req_arg *ap; @@ -332,7 +332,7 @@ gctl_get_param(struct gctl_req *req, con char const * gctl_get_asciiparam(struct gctl_req *req, const char *param) { - int i; + u_int i; char const *p; struct gctl_req_arg *ap; Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Apr 27 13:10:43 2016 (r298697) +++ head/sys/geom/mirror/g_mirror.c Wed Apr 27 15:10:40 2016 (r298698) @@ -1160,7 +1160,7 @@ g_mirror_sync_collision(struct g_mirror_ struct g_mirror_disk *disk; struct bio *sbp; off_t rstart, rend, sstart, send; - int i; + u_int i; if (sc->sc_sync.ds_ndisks == 0) return (0); Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Wed Apr 27 13:10:43 2016 (r298697) +++ head/sys/geom/raid/md_promise.c Wed Apr 27 15:10:40 2016 (r298698) @@ -893,7 +893,7 @@ g_raid_md_promise_start(struct g_raid_vo struct g_raid_md_promise_perdisk *pd; struct g_raid_md_promise_pervolume *pv; struct promise_raid_conf *meta; - int i; + u_int i; sc = vol->v_softc; md = sc->sc_md; Modified: head/sys/geom/raid/md_sii.c ============================================================================== --- head/sys/geom/raid/md_sii.c Wed Apr 27 13:10:43 2016 (r298697) +++ head/sys/geom/raid/md_sii.c Wed Apr 27 15:10:40 2016 (r298698) @@ -1482,7 +1482,7 @@ g_raid_md_write_sii(struct g_raid_md_obj struct g_raid_md_sii_object *mdi; struct g_raid_md_sii_perdisk *pd; struct sii_raid_conf *meta; - int i; + u_int i; sc = md->mdo_softc; mdi = (struct g_raid_md_sii_object *)md; Modified: head/sys/geom/virstor/g_virstor.c ============================================================================== --- head/sys/geom/virstor/g_virstor.c Wed Apr 27 13:10:43 2016 (r298697) +++ head/sys/geom/virstor/g_virstor.c Wed Apr 27 15:10:40 2016 (r298698) @@ -471,7 +471,7 @@ static void update_metadata(struct g_virstor_softc *sc) { struct g_virstor_metadata md; - int n; + u_int n; if (virstor_valid_components(sc) != sc->n_components) return; /* Incomplete device */ @@ -928,7 +928,7 @@ virstor_geom_destroy(struct g_virstor_so { struct g_provider *pp; struct g_geom *gp; - int n; + u_int n; g_topology_assert(); From owner-svn-src-head@freebsd.org Wed Apr 27 15:28:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12D56B1EDC7; Wed, 27 Apr 2016 15:28:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C06E41AD5; Wed, 27 Apr 2016 15:28:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3RFSPZE082269; Wed, 27 Apr 2016 15:28:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RFSP6J082267; Wed, 27 Apr 2016 15:28:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201604271528.u3RFSP6J082267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 27 Apr 2016 15:28:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298702 - head/sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 15:28:27 -0000 Author: ae Date: Wed Apr 27 15:28:25 2016 New Revision: 298702 URL: https://svnweb.freebsd.org/changeset/base/298702 Log: Make create_object callback optional and return EOPNOTSUPP when it isn't defined. Remove eaction_create_compat() and use designated initializers to initialize eaction_opcodes structure. Obtained from: Yandex LLC Modified: head/sys/netpfil/ipfw/ip_fw_eaction.c head/sys/netpfil/ipfw/ip_fw_sockopt.c Modified: head/sys/netpfil/ipfw/ip_fw_eaction.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_eaction.c Wed Apr 27 15:27:23 2016 (r298701) +++ head/sys/netpfil/ipfw/ip_fw_eaction.c Wed Apr 27 15:28:25 2016 (r298702) @@ -151,20 +151,14 @@ eaction_findbykidx(struct ip_fw_chain *c return (ipfw_objhash_lookup_kidx(CHAIN_TO_SRV(ch), idx)); } -static int -eaction_create_compat(struct ip_fw_chain *ch, struct tid_info *ti, - uint16_t *pkidx) -{ - - return (EOPNOTSUPP); -} - static struct opcode_obj_rewrite eaction_opcodes[] = { { - O_EXTERNAL_ACTION, IPFW_TLV_EACTION, - eaction_classify, eaction_update, - eaction_findbyname, eaction_findbykidx, - eaction_create_compat + .opcode = O_EXTERNAL_ACTION, + .etlv = IPFW_TLV_EACTION, + .classifier = eaction_classify, + .update = eaction_update, + .find_byname = eaction_findbyname, + .find_bykidx = eaction_findbykidx, }, }; Modified: head/sys/netpfil/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Apr 27 15:27:23 2016 (r298701) +++ head/sys/netpfil/ipfw/ip_fw_sockopt.c Wed Apr 27 15:28:25 2016 (r298702) @@ -2236,7 +2236,10 @@ create_objects_compat(struct ip_fw_chain KASSERT(rw != NULL, ("Unable to find handler for op %d", (cmd + p->off)->opcode)); - error = rw->create_object(ch, ti, &kidx); + if (rw->create_object == NULL) + error = EOPNOTSUPP; + else + error = rw->create_object(ch, ti, &kidx); if (error == 0) { p->kidx = kidx; continue; From owner-svn-src-head@freebsd.org Wed Apr 27 15:35:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1245EB1E02D; Wed, 27 Apr 2016 15:35:07 +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 BAFB31FB4; Wed, 27 Apr 2016 15:35:06 +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 u3RFZ586085238; Wed, 27 Apr 2016 15:35:05 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RFZ5i1085236; Wed, 27 Apr 2016 15:35:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604271535.u3RFZ5i1085236@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 27 Apr 2016 15:35:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298703 - in head/sys/cam: . ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 15:35:07 -0000 Author: pfg Date: Wed Apr 27 15:35:05 2016 New Revision: 298703 URL: https://svnweb.freebsd.org/changeset/base/298703 Log: cam: unsign some types to match their definitions and avoid overflows. numpatterns is u_int. ctl: CTL_NUM_MODE_PAGES comes from sizeof(). In struct:ctl_scsiio, kern_sg_entries is uint32_t. MFC after: 2 weeks Modified: head/sys/cam/cam_xpt.c head/sys/cam/ctl/ctl.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Wed Apr 27 15:28:25 2016 (r298702) +++ head/sys/cam/cam_xpt.c Wed Apr 27 15:35:05 2016 (r298703) @@ -1182,7 +1182,7 @@ xptbusmatch(struct dev_match_pattern *pa struct cam_eb *bus) { dev_match_ret retval; - int i; + u_int i; retval = DM_RET_NONE; @@ -1294,7 +1294,7 @@ xptdevicematch(struct dev_match_pattern struct cam_ed *device) { dev_match_ret retval; - int i; + u_int i; retval = DM_RET_NONE; @@ -1417,7 +1417,7 @@ xptperiphmatch(struct dev_match_pattern struct cam_periph *periph) { dev_match_ret retval; - int i; + u_int i; /* * If we aren't given something to match against, that's an error. Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Apr 27 15:28:25 2016 (r298702) +++ head/sys/cam/ctl/ctl.c Wed Apr 27 15:35:05 2016 (r298703) @@ -916,7 +916,7 @@ ctl_isc_announce_mode(struct ctl_lun *lu { struct ctl_softc *softc = lun->ctl_softc; union ctl_ha_msg msg; - int i; + u_int i; if (softc->ha_link != CTL_HA_LINK_ONLINE) return; @@ -1284,7 +1284,7 @@ static void ctl_isc_mode_sync(struct ctl_softc *softc, union ctl_ha_msg *msg, int len) { struct ctl_lun *lun; - int i; + u_int i; uint32_t initidx, targ_lun; targ_lun = msg->hdr.nexus.targ_mapped_lun; @@ -6405,7 +6405,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) */ switch (page_code) { case SMS_ALL_PAGES_PAGE: { - int i; + u_int i; page_len = 0; @@ -6457,7 +6457,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) break; } default: { - int i; + u_int i; page_len = 0; @@ -12775,7 +12775,7 @@ static void ctl_datamove_remote_write_cb(struct ctl_ha_dt_req *rq) { union ctl_io *io; - int i; + uint32_t i; io = rq->context; @@ -12853,7 +12853,7 @@ ctl_datamove_remote_dm_read_cb(union ctl char path_str[64]; struct sbuf sb; #endif - int i; + uint32_t i; for (i = 0; i < io->scsiio.kern_sg_entries; i++) free(io->io_hdr.local_sglist[i].addr, M_CTL); @@ -13094,7 +13094,7 @@ static void ctl_datamove_remote_read(union ctl_io *io) { int retval; - int i; + uint32_t i; /* * This will send an error to the other controller in the case of a From owner-svn-src-head@freebsd.org Wed Apr 27 15:56:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01CC8B1E690; Wed, 27 Apr 2016 15:56:52 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id E89D010C3; Wed, 27 Apr 2016 15:56:51 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 55333179CE; Wed, 27 Apr 2016 08:56:45 -0700 (PDT) Date: Wed, 27 Apr 2016 08:56:45 -0700 From: hiren panchasara To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298696 - head/sys/netinet Message-ID: <20160427155645.GQ33164@strugglingcoder.info> References: <201604270940.u3R9ethr075834@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z87VqPJ/HsYrR2WM" Content-Disposition: inline In-Reply-To: <201604270940.u3R9ethr075834@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 15:56:52 -0000 --z87VqPJ/HsYrR2WM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 04/27/16 at 09:40P, Sepherosa Ziehau wrote: > Author: sephe > Date: Wed Apr 27 09:40:55 2016 > New Revision: 298696 > URL: https://svnweb.freebsd.org/changeset/base/298696 >=20 > Log: > tcp/lro: Fix typo. > =20 > MFC after: 1 week > Sponsored by: Microsoft OSTC >=20 > Modified: > head/sys/netinet/tcp_lro.c >=20 > Modified: head/sys/netinet/tcp_lro.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_lro.c Wed Apr 27 07:46:38 2016 (r298695) > +++ head/sys/netinet/tcp_lro.c Wed Apr 27 09:40:55 2016 (r298696) > @@ -569,7 +569,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m > if ((th->th_flags & ~(TH_ACK | TH_PUSH)) !=3D 0) > return (TCP_LRO_CANNOT); > =20 > - /* XXX-BZ We lose a AKC|PUSH flag concatinating multiple segments. */ > + /* XXX-BZ We lose a ACK|PUSH flag concatinating multiple segments. */ Also s/concatinating /concatenating / ? Cheers, Hiren --z87VqPJ/HsYrR2WM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXIOE9XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lfpcIAIw4IVgEp7o5iBWQEewjt/J3 CMV+uqE/8LhtzB3Zw6EXUXn5x6XGaenyKp3LiPZmEIA3jxGeE8VcDxjfBc4Jp06s 5omGepUp7zoqUUZ4p64GhWuewBeK+FHkB3bTc3qqA/WC8pWEdjiGStLhCTRlqYSb RF543jo5GeiGz+xsvVgY2lLXXwyENFCni3NqZIR4r/BSNj/jYlk/p0W6yMdgGhtc JrAOhw51kzWmoYPpjQSC92wnOitLxPUmdfawpQGgiuhH+TNFWNeCFyuFdoiGb5+S zwMDi7wzvij4PpJLouUIv58ouIg50+Mg2KVOwtbjUK9I1UDKI769irz2lwgbpk8= =8Idi -----END PGP SIGNATURE----- --z87VqPJ/HsYrR2WM-- From owner-svn-src-head@freebsd.org Wed Apr 27 16:29:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C16E6B1E0D4; Wed, 27 Apr 2016 16:29:05 +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 980541CDB; Wed, 27 Apr 2016 16:29:05 +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 u3RGT4uB001184; Wed, 27 Apr 2016 16:29:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RGT33r001174; Wed, 27 Apr 2016 16:29:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604271629.u3RGT33r001174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 16:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298707 - in head: lib/libdevctl share/man/man9 sys/kern sys/sys usr.sbin/devctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 16:29:05 -0000 Author: jhb Date: Wed Apr 27 16:29:03 2016 New Revision: 298707 URL: https://svnweb.freebsd.org/changeset/base/298707 Log: Add a new rescan method to the bus interface. The BUS_RESCAN() method rescans a single bus device checking for devices that have been added or removed from the bus. A new 'rescan' command is added to devctl(8) to trigger a rescan. Differential Revision: https://reviews.freebsd.org/D6016 Added: head/share/man/man9/BUS_RESCAN.9 (contents, props changed) Modified: head/lib/libdevctl/devctl.3 head/lib/libdevctl/devctl.c head/lib/libdevctl/devctl.h head/share/man/man9/Makefile head/sys/kern/bus_if.m head/sys/kern/subr_bus.c head/sys/sys/bus.h head/usr.sbin/devctl/devctl.8 head/usr.sbin/devctl/devctl.c Modified: head/lib/libdevctl/devctl.3 ============================================================================== --- head/lib/libdevctl/devctl.3 Wed Apr 27 16:23:16 2016 (r298706) +++ head/lib/libdevctl/devctl.3 Wed Apr 27 16:29:03 2016 (r298707) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2016 +.Dd April 27, 2016 .Dt DEVCTL 3 .Os .Sh NAME @@ -34,6 +34,7 @@ .Nm devctl_detach , .Nm devctl_disable , .Nm devctl_enable , +.Nm devctl_rescan , .Nm devctl_resume , .Nm devctl_set_driver , .Nm devctl_suspend @@ -51,6 +52,8 @@ .Ft int .Fn devctl_enable "const char *device" .Ft int +.Fn devctl_rescan "const char *device" +.Ft int .Fn devctl_resume "const char *device" .Ft int .Fn devctl_set_driver "const char *device" "const char *driver" "bool force" @@ -149,9 +152,14 @@ If the device is already attached and is true, the device will be detached from its current device driver before it is attached to the new device driver. +.Pp +The +.Fn devctl_rescan +function rescans a bus device checking for devices that have been added or +removed. .Sh RETURN VALUES .Rv -std devctl_attach devctl_detach devctl_disable devctl_enable \ -devctl_suspend devctl_resume devctl_set_driver +devctl_suspend devctl_rescan devctl_resume devctl_set_driver .Sh ERRORS In addition to specific errors noted below, all of the @@ -280,6 +288,16 @@ The device is disabled. .It Bq Er ENXIO The new device driver failed to attach. .El +.Pp +The +.Fn devctl_rescan +function may fail if: +.Bl -tag -width Er +.It Bq Er ENXIO +The device is not attached to a driver. +.It Bq Er ENXIO +The bus driver does not support rescanning. +.El .Sh SEE ALSO .Xr devinfo 3 , .Xr devstat 3 , Modified: head/lib/libdevctl/devctl.c ============================================================================== --- head/lib/libdevctl/devctl.c Wed Apr 27 16:23:16 2016 (r298706) +++ head/lib/libdevctl/devctl.c Wed Apr 27 16:29:03 2016 (r298707) @@ -122,3 +122,10 @@ devctl_set_driver(const char *device, co req.dr_flags |= DEVF_SET_DRIVER_DETACH; return (devctl_request(DEV_SET_DRIVER, &req)); } + +int +devctl_rescan(const char *device) +{ + + return (devctl_simple_request(DEV_RESCAN, device, 0)); +} Modified: head/lib/libdevctl/devctl.h ============================================================================== --- head/lib/libdevctl/devctl.h Wed Apr 27 16:23:16 2016 (r298706) +++ head/lib/libdevctl/devctl.h Wed Apr 27 16:29:03 2016 (r298707) @@ -38,5 +38,6 @@ int devctl_disable(const char *device, b int devctl_suspend(const char *device); int devctl_resume(const char *device); int devctl_set_driver(const char *device, const char *driver, bool force); +int devctl_rescan(const char *device); #endif /* !__DEVCTL_H__ */ Added: head/share/man/man9/BUS_RESCAN.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/BUS_RESCAN.9 Wed Apr 27 16:29:03 2016 (r298707) @@ -0,0 +1,51 @@ +.\" -*- nroff -*- +.\" +.\" Copyright (c) 2016 John H. Baldwin +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd April 27, 2016 +.Dt BUS_RESCAN 9 +.Os +.Sh NAME +.Nm BUS_RESCAN +.Nd "rescan a bus checking for devices that have been added or removed" +.Sh SYNOPSIS +.In sys/param.h +.In sys/bus.h +.Ft void +.Fn BUS_RESCAN "device_t dev" +.Sh DESCRIPTION +The +.Fn BUS_RESCAN +method is called to request a rescan of the child devices on a bus device. +The method should add any devices that have been added since the previous +scan and remove devices that have been removed. +This method is not required to re-examine existing devices to determine if +their properties have changed. +This method is also not required to propagate the rescan request to child +devices. +.Sh SEE ALSO +.Xr device 9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Apr 27 16:23:16 2016 (r298706) +++ head/share/man/man9/Makefile Wed Apr 27 16:29:03 2016 (r298707) @@ -46,6 +46,7 @@ MAN= accept_filter.9 \ BUS_NEW_PASS.9 \ BUS_PRINT_CHILD.9 \ BUS_READ_IVAR.9 \ + BUS_RESCAN.9 \ bus_release_resource.9 \ bus_set_pass.9 \ bus_set_resource.9 \ Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Wed Apr 27 16:23:16 2016 (r298706) +++ head/sys/kern/bus_if.m Wed Apr 27 16:29:03 2016 (r298707) @@ -232,6 +232,19 @@ METHOD device_t add_child { } DEFAULT null_add_child; /** + * @brief Rescan the bus + * + * This method is called by a parent bridge or devctl to trigger a bus + * rescan. The rescan should delete devices no longer present and + * enumerate devices that have newly arrived. + * + * @param _dev the bus device + */ +METHOD int rescan { + device_t _dev; +} + +/** * @brief Allocate a system resource * * This method is called by child devices of a bus to allocate resources. Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Apr 27 16:23:16 2016 (r298706) +++ head/sys/kern/subr_bus.c Wed Apr 27 16:29:03 2016 (r298707) @@ -5203,6 +5203,7 @@ devctl2_ioctl(struct cdev *cdev, u_long case DEV_SUSPEND: case DEV_RESUME: case DEV_SET_DRIVER: + case DEV_RESCAN: error = priv_check(td, PRIV_DRIVER); if (error == 0) error = find_device(req, &dev); @@ -5366,6 +5367,13 @@ devctl2_ioctl(struct cdev *cdev, u_long error = device_probe_and_attach(dev); break; } + case DEV_RESCAN: + if (!device_is_attached(dev)) { + error = ENXIO; + break; + } + error = BUS_RESCAN(dev); + break; } mtx_unlock(&Giant); return (error); Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Wed Apr 27 16:23:16 2016 (r298706) +++ head/sys/sys/bus.h Wed Apr 27 16:29:03 2016 (r298707) @@ -117,6 +117,7 @@ struct devreq { #define DEV_SUSPEND _IOW('D', 5, struct devreq) #define DEV_RESUME _IOW('D', 6, struct devreq) #define DEV_SET_DRIVER _IOW('D', 7, struct devreq) +#define DEV_RESCAN _IOW('D', 9, struct devreq) /* Flags for DEV_DETACH and DEV_DISABLE. */ #define DEVF_FORCE_DETACH 0x0000001 Modified: head/usr.sbin/devctl/devctl.8 ============================================================================== --- head/usr.sbin/devctl/devctl.8 Wed Apr 27 16:23:16 2016 (r298706) +++ head/usr.sbin/devctl/devctl.8 Wed Apr 27 16:29:03 2016 (r298707) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 2, 2016 +.Dd April 27, 2016 .Dt DEVCTL 8 .Os .Sh NAME @@ -56,6 +56,9 @@ .Cm set driver .Op Fl f .Ar device driver +.Nm +.Cm rescan +.Ar device .Sh DESCRIPTION The .Nm @@ -126,6 +129,9 @@ If the device is already attached to a d .Fl f flag is not specified, the device will not be changed. +.It Cm rescan Ar device +Rescan a bus device checking for devices that have been added or +removed. .El .Sh SEE ALSO .Xr devctl 3 , Modified: head/usr.sbin/devctl/devctl.c ============================================================================== --- head/usr.sbin/devctl/devctl.c Wed Apr 27 16:23:16 2016 (r298706) +++ head/usr.sbin/devctl/devctl.c Wed Apr 27 16:29:03 2016 (r298707) @@ -259,6 +259,18 @@ set_driver(int ac, char **av) } DEVCTL_COMMAND(set, driver, set_driver); +static int +rescan(int ac, char **av) +{ + + if (ac != 2) + usage(); + if (devctl_rescan(av[1]) < 0) + err(1, "Failed to rescan %s", av[1]); + return (0); +} +DEVCTL_COMMAND(top, rescan, rescan); + int main(int ac, char *av[]) { From owner-svn-src-head@freebsd.org Wed Apr 27 16:31:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6593AB1E26D; Wed, 27 Apr 2016 16:31:14 +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 27FB41F72; Wed, 27 Apr 2016 16:31:14 +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 u3RGVDS8001322; Wed, 27 Apr 2016 16:31:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RGVCjE001316; Wed, 27 Apr 2016 16:31:12 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604271631.u3RGVCjE001316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 16:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298708 - in head/sys: dev/cardbus dev/pci mips/nlm powerpc/ofw sparc64/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 16:31:14 -0000 Author: jhb Date: Wed Apr 27 16:31:12 2016 New Revision: 298708 URL: https://svnweb.freebsd.org/changeset/base/298708 Log: Implement a PCI bus rescan method. Rescanning a PCI bus uses the following steps: - Fetch the current set of child devices and save it in the 'devlist' array. - Allocate a parallel array 'unchanged' initalized with NULL pointers. - Scan the bus checking each slot (and each function on slots with a multifunction device). - If a valid function is found, look for a matching device in the 'devlist' array. If a device is found, save the pointer in the 'unchanged' array. If a device is not found, add a new device. - After the scan has finished, walk the 'devlist' array deleting any devices that do not have a matching pointer in the 'unchanged' array. - Finally, fetch an updated set of child devices and explicitly attach any devices that are not present in the 'unchanged' array. This builds on the previous changes to move subclass data management into pci_alloc_devinfo(), pci_child_added(), and bus_child_deleted(). Subclasses of the PCI bus use custom rescan logic explicitly override the rescan method to disable rescans. Differential Revision: https://reviews.freebsd.org/D6018 Modified: head/sys/dev/cardbus/cardbus.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_private.h head/sys/mips/nlm/xlp_pci.c head/sys/powerpc/ofw/ofw_pcibus.c head/sys/sparc64/pci/ofw_pcibus.c Modified: head/sys/dev/cardbus/cardbus.c ============================================================================== --- head/sys/dev/cardbus/cardbus.c Wed Apr 27 16:29:03 2016 (r298707) +++ head/sys/dev/cardbus/cardbus.c Wed Apr 27 16:31:12 2016 (r298708) @@ -346,6 +346,7 @@ static device_method_t cardbus_methods[] DEVMETHOD(bus_get_dma_tag, bus_generic_get_dma_tag), DEVMETHOD(bus_read_ivar, cardbus_read_ivar), DEVMETHOD(bus_driver_added, cardbus_driver_added), + DEVMETHOD(bus_rescan, kobj_error_method), /* Card Interface */ DEVMETHOD(card_attach_card, cardbus_attach_card), Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Apr 27 16:29:03 2016 (r298707) +++ head/sys/dev/pci/pci.c Wed Apr 27 16:31:12 2016 (r298708) @@ -168,6 +168,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_remap_intr, pci_remap_intr_method), DEVMETHOD(bus_suspend_child, pci_suspend_child), DEVMETHOD(bus_resume_child, pci_resume_child), + DEVMETHOD(bus_rescan, pci_rescan_method), /* PCI interface */ DEVMETHOD(pci_read_config, pci_read_config_method), @@ -3917,6 +3918,103 @@ pci_add_children(device_t dev, int domai #undef REG } +int +pci_rescan_method(device_t dev) +{ +#define REG(n, w) PCIB_READ_CONFIG(pcib, busno, s, f, n, w) + device_t pcib = device_get_parent(dev); + struct pci_softc *sc; + device_t child, *devlist, *unchanged; + int devcount, error, i, j, maxslots, oldcount; + int busno, domain, s, f, pcifunchigh; + uint8_t hdrtype; + + /* No need to check for ARI on a rescan. */ + error = device_get_children(dev, &devlist, &devcount); + if (error) + return (error); + if (devcount != 0) { + unchanged = malloc(devcount * sizeof(device_t), M_TEMP, + M_NOWAIT | M_ZERO); + if (unchanged == NULL) { + free(devlist, M_TEMP); + return (ENOMEM); + } + } else + unchanged = NULL; + + sc = device_get_softc(dev); + domain = pcib_get_domain(dev); + busno = pcib_get_bus(dev); + maxslots = PCIB_MAXSLOTS(pcib); + for (s = 0; s <= maxslots; s++) { + /* If function 0 is not present, skip to the next slot. */ + f = 0; + if (REG(PCIR_VENDOR, 2) == 0xffff) + continue; + pcifunchigh = 0; + hdrtype = REG(PCIR_HDRTYPE, 1); + if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) + continue; + if (hdrtype & PCIM_MFDEV) + pcifunchigh = PCIB_MAXFUNCS(pcib); + for (f = 0; f <= pcifunchigh; f++) { + if (REG(PCIR_VENDOR, 2) == 0xfff) + continue; + + /* + * Found a valid function. Check if a + * device_t for this device already exists. + */ + for (i = 0; i < devcount; i++) { + child = devlist[i]; + if (child == NULL) + continue; + if (pci_get_slot(child) == s && + pci_get_function(child) == f) { + unchanged[i] = child; + goto next_func; + } + } + + pci_identify_function(pcib, dev, domain, busno, s, f); + next_func:; + } + } + + /* Remove devices that are no longer present. */ + for (i = 0; i < devcount; i++) { + if (unchanged[i] != NULL) + continue; + device_delete_child(dev, devlist[i]); + } + + free(devlist, M_TEMP); + oldcount = devcount; + + /* Try to attach the devices just added. */ + error = device_get_children(dev, &devlist, &devcount); + if (error) { + free(unchanged, M_TEMP); + return (error); + } + + for (i = 0; i < devcount; i++) { + for (j = 0; j < oldcount; j++) { + if (devlist[i] == unchanged[j]) + goto next_device; + } + + device_probe_and_attach(devlist[i]); + next_device:; + } + + free(unchanged, M_TEMP); + free(devlist, M_TEMP); + return (0); +#undef REG +} + #ifdef PCI_IOV device_t pci_add_iov_child(device_t bus, device_t pf, uint16_t rid, uint16_t vid, Modified: head/sys/dev/pci/pci_private.h ============================================================================== --- head/sys/dev/pci/pci_private.h Wed Apr 27 16:29:03 2016 (r298707) +++ head/sys/dev/pci/pci_private.h Wed Apr 27 16:31:12 2016 (r298708) @@ -57,6 +57,7 @@ void pci_add_resources(device_t bus, de void pci_add_resources_ea(device_t bus, device_t dev, int alloc_iov); struct pci_devinfo *pci_alloc_devinfo_method(device_t dev); int pci_attach_common(device_t dev); +int pci_rescan_method(device_t dev); void pci_driver_added(device_t dev, driver_t *driver); int pci_ea_is_enabled(device_t dev, int rid); int pci_print_child(device_t dev, device_t child); Modified: head/sys/mips/nlm/xlp_pci.c ============================================================================== --- head/sys/mips/nlm/xlp_pci.c Wed Apr 27 16:29:03 2016 (r298707) +++ head/sys/mips/nlm/xlp_pci.c Wed Apr 27 16:31:12 2016 (r298708) @@ -154,6 +154,7 @@ static device_method_t xlp_pci_methods[] /* Device interface */ DEVMETHOD(device_probe, xlp_pci_probe), DEVMETHOD(device_attach, xlp_pci_attach), + DEVMETHOD(bus_rescan, kobj_error_method), DEVMETHOD_END }; Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Wed Apr 27 16:29:03 2016 (r298707) +++ head/sys/powerpc/ofw/ofw_pcibus.c Wed Apr 27 16:31:12 2016 (r298708) @@ -77,6 +77,7 @@ static device_method_t ofw_pcibus_method /* Bus interface */ DEVMETHOD(bus_child_deleted, ofw_pcibus_child_deleted), DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_child_pnpinfo_str_method), + DEVMETHOD(bus_rescan, kobj_error_method), /* PCI interface */ DEVMETHOD(pci_alloc_devinfo, ofw_pcibus_alloc_devinfo), Modified: head/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- head/sys/sparc64/pci/ofw_pcibus.c Wed Apr 27 16:29:03 2016 (r298707) +++ head/sys/sparc64/pci/ofw_pcibus.c Wed Apr 27 16:31:12 2016 (r298708) @@ -81,6 +81,7 @@ static device_method_t ofw_pcibus_method /* Bus interface */ DEVMETHOD(bus_child_deleted, ofw_pcibus_child_deleted), DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_pnpinfo_str), + DEVMETHOD(bus_rescan, kobj_error_method), /* PCI interface */ DEVMETHOD(pci_alloc_devinfo, ofw_pcibus_alloc_devinfo), From owner-svn-src-head@freebsd.org Wed Apr 27 16:33:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 429DBB1E334; Wed, 27 Apr 2016 16:33:19 +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 045A812BC; Wed, 27 Apr 2016 16:33: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 u3RGXIqS004031; Wed, 27 Apr 2016 16:33:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RGXHed004024; Wed, 27 Apr 2016 16:33:17 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604271633.u3RGXHed004024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 16:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298709 - in head: lib/libdevctl sys/kern sys/sys usr.sbin/devctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 16:33:19 -0000 Author: jhb Date: Wed Apr 27 16:33:17 2016 New Revision: 298709 URL: https://svnweb.freebsd.org/changeset/base/298709 Log: Add 'devctl delete' that calls device_delete_child(). 'devctl delete' can be used to delete a device that is no longer present. As an anti-foot-shooting measure, 'delete' will not delete a device unless it's parent bus says it is no longer present. This can be overridden by passing the force ('-f') flag. Note that this command should be used with care. If a device is deleted that is actually present it can't be resurrected unless the parent bus device's driver supports rescans. Differential Revision: https://reviews.freebsd.org/D6019 Modified: head/lib/libdevctl/devctl.3 head/lib/libdevctl/devctl.c head/lib/libdevctl/devctl.h head/sys/kern/subr_bus.c head/sys/sys/bus.h head/usr.sbin/devctl/devctl.8 head/usr.sbin/devctl/devctl.c Modified: head/lib/libdevctl/devctl.3 ============================================================================== --- head/lib/libdevctl/devctl.3 Wed Apr 27 16:31:12 2016 (r298708) +++ head/lib/libdevctl/devctl.3 Wed Apr 27 16:33:17 2016 (r298709) @@ -31,6 +31,7 @@ .Sh NAME .Nm devctl , .Nm devctl_attach , +.Nm devctl_delete , .Nm devctl_detach , .Nm devctl_disable , .Nm devctl_enable , @@ -46,6 +47,8 @@ .Ft int .Fn devctl_attach "const char *device" .Ft int +.Fn devctl_delete "const char *device" "bool force" +.Ft int .Fn devctl_detach "const char *device" "bool force" .Ft int .Fn devctl_disable "const char *device" "bool force_detach" @@ -110,6 +113,15 @@ is true, the current device driver will be detached even if the device is busy. .Pp The +.Fn devctl_delete +function deletes a device from the device tree. +No +If +.Fa force +is true, +the device is deleted even if the device is physically present. +.Pp +The .Fn devctl_disable function disables a device. If the device is currently attached to a device driver, @@ -158,8 +170,8 @@ The function rescans a bus device checking for devices that have been added or removed. .Sh RETURN VALUES -.Rv -std devctl_attach devctl_detach devctl_disable devctl_enable \ -devctl_suspend devctl_rescan devctl_resume devctl_set_driver +.Rv -std devctl_attach devctl_delete devctl_detach devctl_disable \ +devctl_enable devctl_suspend devctl_rescan devctl_resume devctl_set_driver .Sh ERRORS In addition to specific errors noted below, all of the @@ -298,6 +310,19 @@ The device is not attached to a driver. .It Bq Er ENXIO The bus driver does not support rescanning. .El +.Pp +The +.Fn devctl_delete +function may fail if: +.Bl -tag -width Er +.It Bq Er EBUSY +The device is physically present and +.Fa force +is false. +.It Bq Er EINVAL +.Fa dev +is the root device of the device tree. +.El .Sh SEE ALSO .Xr devinfo 3 , .Xr devstat 3 , Modified: head/lib/libdevctl/devctl.c ============================================================================== --- head/lib/libdevctl/devctl.c Wed Apr 27 16:31:12 2016 (r298708) +++ head/lib/libdevctl/devctl.c Wed Apr 27 16:33:17 2016 (r298709) @@ -129,3 +129,11 @@ devctl_rescan(const char *device) return (devctl_simple_request(DEV_RESCAN, device, 0)); } + +int +devctl_delete(const char *device, bool force) +{ + + return (devctl_simple_request(DEV_DELETE, device, force ? + DEVF_FORCE_DELETE : 0)); +} Modified: head/lib/libdevctl/devctl.h ============================================================================== --- head/lib/libdevctl/devctl.h Wed Apr 27 16:31:12 2016 (r298708) +++ head/lib/libdevctl/devctl.h Wed Apr 27 16:33:17 2016 (r298709) @@ -39,5 +39,6 @@ int devctl_suspend(const char *device); int devctl_resume(const char *device); int devctl_set_driver(const char *device, const char *driver, bool force); int devctl_rescan(const char *device); +int devctl_delete(const char *device, bool force); #endif /* !__DEVCTL_H__ */ Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Apr 27 16:31:12 2016 (r298708) +++ head/sys/kern/subr_bus.c Wed Apr 27 16:33:17 2016 (r298709) @@ -5204,6 +5204,7 @@ devctl2_ioctl(struct cdev *cdev, u_long case DEV_RESUME: case DEV_SET_DRIVER: case DEV_RESCAN: + case DEV_DELETE: error = priv_check(td, PRIV_DRIVER); if (error == 0) error = find_device(req, &dev); @@ -5374,6 +5375,24 @@ devctl2_ioctl(struct cdev *cdev, u_long } error = BUS_RESCAN(dev); break; + case DEV_DELETE: { + device_t parent; + + parent = device_get_parent(dev); + if (parent == NULL) { + error = EINVAL; + break; + } + if (!(req->dr_flags & DEVF_FORCE_DELETE)) { + if (bus_child_present(dev) != 0) { + error = EBUSY; + break; + } + } + + error = device_delete_child(parent, dev); + break; + } } mtx_unlock(&Giant); return (error); Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Wed Apr 27 16:31:12 2016 (r298708) +++ head/sys/sys/bus.h Wed Apr 27 16:33:17 2016 (r298709) @@ -118,6 +118,7 @@ struct devreq { #define DEV_RESUME _IOW('D', 6, struct devreq) #define DEV_SET_DRIVER _IOW('D', 7, struct devreq) #define DEV_RESCAN _IOW('D', 9, struct devreq) +#define DEV_DELETE _IOW('D', 10, struct devreq) /* Flags for DEV_DETACH and DEV_DISABLE. */ #define DEVF_FORCE_DETACH 0x0000001 @@ -125,6 +126,9 @@ struct devreq { /* Flags for DEV_SET_DRIVER. */ #define DEVF_SET_DRIVER_DETACH 0x0000001 /* Detach existing driver. */ +/* Flags for DEV_DELETE. */ +#define DEVF_FORCE_DELETE 0x0000001 + #ifdef _KERNEL #include Modified: head/usr.sbin/devctl/devctl.8 ============================================================================== --- head/usr.sbin/devctl/devctl.8 Wed Apr 27 16:31:12 2016 (r298708) +++ head/usr.sbin/devctl/devctl.8 Wed Apr 27 16:33:17 2016 (r298709) @@ -59,6 +59,10 @@ .Nm .Cm rescan .Ar device +.Nm +.Cm delete +.Op Fl f +.Ar device .Sh DESCRIPTION The .Nm @@ -132,6 +136,18 @@ the device will not be changed. .It Cm rescan Ar device Rescan a bus device checking for devices that have been added or removed. +.It Xo Cm delete +.Op Fl +.Ar device +.Xc +Delete the device from the device tree. +If the +.Fl f +flag is specified, +the device will be deleted even if it is physically present. +This command should be used with care as a device that is deleted but present +can no longer be used unless the parent bus device rediscovers the device via +a rescan request. .El .Sh SEE ALSO .Xr devctl 3 , Modified: head/usr.sbin/devctl/devctl.c ============================================================================== --- head/usr.sbin/devctl/devctl.c Wed Apr 27 16:31:12 2016 (r298708) +++ head/usr.sbin/devctl/devctl.c Wed Apr 27 16:33:17 2016 (r298709) @@ -70,14 +70,16 @@ DEVCTL_TABLE(top, set); static void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", "usage: devctl attach device", " devctl detach [-f] device", " devctl disable [-f] device", " devctl enable device", " devctl suspend device", " devctl resume device", - " devctl set driver [-f] device driver"); + " devctl set driver [-f] device driver", + " devctl rescan device", + " devctl delete [-f] device"); exit(1); } @@ -271,6 +273,40 @@ rescan(int ac, char **av) } DEVCTL_COMMAND(top, rescan, rescan); +static void +delete_usage(void) +{ + + fprintf(stderr, "usage: devctl delete [-f] device\n"); + exit(1); +} + +static int +delete(int ac, char **av) +{ + bool force; + int ch; + + force = false; + while ((ch = getopt(ac, av, "f")) != -1) + switch (ch) { + case 'f': + force = true; + break; + default: + delete_usage(); + } + ac -= optind; + av += optind; + + if (ac != 1) + delete_usage(); + if (devctl_delete(av[0], force) < 0) + err(1, "Failed to delete %s", av[0]); + return (0); +} +DEVCTL_COMMAND(top, delete, delete); + int main(int ac, char *av[]) { From owner-svn-src-head@freebsd.org Wed Apr 27 16:34:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFD2DB1E3CB; Wed, 27 Apr 2016 16:34:30 +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 6446814DE; Wed, 27 Apr 2016 16:34:30 +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 u3RGYTBI004109; Wed, 27 Apr 2016 16:34:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RGYTV4004108; Wed, 27 Apr 2016 16:34:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604271634.u3RGYTV4004108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 16:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298710 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 16:34:30 -0000 Author: jhb Date: Wed Apr 27 16:34:29 2016 New Revision: 298710 URL: https://svnweb.freebsd.org/changeset/base/298710 Log: Fix PCI bus detach to delete child devices. Differential Revision: https://reviews.freebsd.org/D6020 Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Apr 27 16:33:17 2016 (r298709) +++ head/sys/dev/pci/pci.c Wed Apr 27 16:34:29 2016 (r298710) @@ -97,9 +97,7 @@ static int pci_add_map(device_t bus, de struct resource_list *rl, int force, int prefetch); static int pci_probe(device_t dev); static int pci_attach(device_t dev); -#ifdef PCI_RES_BUS static int pci_detach(device_t dev); -#endif static void pci_load_vendor_data(void); static int pci_describe_parse_line(char **ptr, int *vendor, int *device, char **desc); @@ -133,11 +131,7 @@ static device_method_t pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, pci_probe), DEVMETHOD(device_attach, pci_attach), -#ifdef PCI_RES_BUS DEVMETHOD(device_detach, pci_detach), -#else - DEVMETHOD(device_detach, bus_generic_detach), -#endif DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, pci_resume), @@ -4145,20 +4139,25 @@ pci_attach(device_t dev) return (bus_generic_attach(dev)); } -#ifdef PCI_RES_BUS static int pci_detach(device_t dev) { +#ifdef PCI_RES_BUS struct pci_softc *sc; +#endif int error; error = bus_generic_detach(dev); if (error) return (error); sc = device_get_softc(dev); - return (bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus)); -} +#ifdef PCI_RES_BUS + error = bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus); + if (error) + return (error); #endif + return (device_delete_children(dev)); +} static void pci_set_power_child(device_t dev, device_t child, int state) From owner-svn-src-head@freebsd.org Wed Apr 27 16:37:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5628AB1E4A1; Wed, 27 Apr 2016 16:37:06 +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 388E718BD; Wed, 27 Apr 2016 16:37:06 +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 1EB63B93A; Wed, 27 Apr 2016 12:37:05 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298710 - head/sys/dev/pci Date: Wed, 27 Apr 2016 09:37 -0700 Message-ID: <2682991.ssHHFcoi01@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604271634.u3RGYTV4004108@repo.freebsd.org> References: <201604271634.u3RGYTV4004108@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); Wed, 27 Apr 2016 12:37:05 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 16:37:06 -0000 On Wednesday, April 27, 2016 04:34:29 PM John Baldwin wrote: > Author: jhb > Date: Wed Apr 27 16:34:29 2016 > New Revision: 298710 > URL: https://svnweb.freebsd.org/changeset/base/298710 > > Log: > Fix PCI bus detach to delete child devices. > > Differential Revision: https://reviews.freebsd.org/D6020 Arguably, bus_generic_detach() should be calling device_delete_children() as most (if not all) buses should delete child devices when detaching, but that's a larger problem to solve. If I had my druthers I'd probably rename bus_generic_detach() to device_detach_children() and change bus_generic_detach() to call device_detach_children() followed by device_delete_children(). Perhaps in 12 we can try to drain that swamp. bus_generic_attach() has similar issues in that a generic bus attach routine should really do what 'bus_generic_probe()' and 'bus_generic_attach()' should do. There is no "generic" probe routine for a bus since a probe routine must set a device description which is unique to the driver. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 27 16:39:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70CCDB1E52E; Wed, 27 Apr 2016 16:39: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 49D161AD3; Wed, 27 Apr 2016 16:39: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 u3RGd6uN029551; Wed, 27 Apr 2016 16:39:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RGd5lv029543; Wed, 27 Apr 2016 16:39:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604271639.u3RGd5lv029543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 16:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298711 - in head/sys: dev/acpica dev/pci powerpc/ofw sparc64/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 16:39:07 -0000 Author: jhb Date: Wed Apr 27 16:39:05 2016 New Revision: 298711 URL: https://svnweb.freebsd.org/changeset/base/298711 Log: Add a pcib_attach_child() method to manage adding the child "pci" device. This allows the PCI-PCI bridge driver to save a reference to the child device in its softc. Note that this required moving the "pci" device creation out of acpi_pcib_attach(). Instead, acpi_pcib_attach() is renamed to acpi_pcib_fetch_prt() as it's sole action now is to fetch the PCI interrupt routing table. Differential Revision: https://reviews.freebsd.org/D6021 Modified: head/sys/dev/acpica/acpi_pcib.c head/sys/dev/acpica/acpi_pcib_acpi.c head/sys/dev/acpica/acpi_pcib_pci.c head/sys/dev/acpica/acpi_pcibvar.h head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pcib_private.h head/sys/powerpc/ofw/ofw_pcib_pci.c head/sys/sparc64/pci/ofw_pcib.c Modified: head/sys/dev/acpica/acpi_pcib.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib.c Wed Apr 27 16:34:29 2016 (r298710) +++ head/sys/dev/acpica/acpi_pcib.c Wed Apr 27 16:39:05 2016 (r298711) @@ -126,11 +126,10 @@ prt_attach_devices(ACPI_PCI_ROUTING_TABL ACPI_ADR_PCI_SLOT(entry->Address), entry->Pin); } -int -acpi_pcib_attach(device_t dev, ACPI_BUFFER *prt, int busno) +void +acpi_pcib_fetch_prt(device_t dev, ACPI_BUFFER *prt) { ACPI_STATUS status; - int error; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -148,20 +147,9 @@ acpi_pcib_attach(device_t dev, ACPI_BUFF acpi_name(acpi_get_handle(dev)), AcpiFormatException(status)); /* - * Attach the PCI bus proper. - */ - if (device_add_child(dev, "pci", -1) == NULL) { - device_printf(device_get_parent(dev), "couldn't attach pci bus\n"); - return_VALUE(ENXIO); - } - - /* - * Now go scan the bus. + * Ensure all the link devices are attached. */ prt_walk_table(prt, prt_attach_devices, dev); - - error = bus_generic_attach(dev); - return_VALUE(error); } static void Modified: head/sys/dev/acpica/acpi_pcib_acpi.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_acpi.c Wed Apr 27 16:34:29 2016 (r298710) +++ head/sys/dev/acpica/acpi_pcib_acpi.c Wed Apr 27 16:39:05 2016 (r298711) @@ -502,7 +502,13 @@ acpi_pcib_acpi_attach(device_t dev) if (sc->ap_segment == 0 && sc->ap_bus == 0) bus0_seen = 1; - return (acpi_pcib_attach(dev, &sc->ap_prt, sc->ap_bus)); + acpi_pcib_fetch_prt(dev, &sc->ap_prt); + + if (device_add_child(dev, "pci", -1) == NULL) { + device_printf(device_get_parent(dev), "couldn't attach pci bus\n"); + return (ENXIO); + } + return (bus_generic_attach(dev)); } /* Modified: head/sys/dev/acpica/acpi_pcib_pci.c ============================================================================== --- head/sys/dev/acpica/acpi_pcib_pci.c Wed Apr 27 16:34:29 2016 (r298710) +++ head/sys/dev/acpica/acpi_pcib_pci.c Wed Apr 27 16:39:05 2016 (r298711) @@ -120,7 +120,9 @@ acpi_pcib_pci_attach(device_t dev) pcib_attach_common(dev); sc = device_get_softc(dev); sc->ap_handle = acpi_get_handle(dev); - return (acpi_pcib_attach(dev, &sc->ap_prt, sc->ap_pcibsc.bus.sec)); + acpi_pcib_fetch_prt(dev, &sc->ap_prt); + + return (pcib_attach_child(dev)); } static int Modified: head/sys/dev/acpica/acpi_pcibvar.h ============================================================================== --- head/sys/dev/acpica/acpi_pcibvar.h Wed Apr 27 16:34:29 2016 (r298710) +++ head/sys/dev/acpica/acpi_pcibvar.h Wed Apr 27 16:39:05 2016 (r298711) @@ -35,7 +35,7 @@ void acpi_pci_link_add_reference(device_t dev, int index, device_t pcib, int slot, int pin); int acpi_pci_link_route_interrupt(device_t dev, int index); -int acpi_pcib_attach(device_t bus, ACPI_BUFFER *prt, int busno); +void acpi_pcib_fetch_prt(device_t bus, ACPI_BUFFER *prt); int acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin, ACPI_BUFFER *prtbuf); int acpi_pcib_power_for_sleep(device_t pcib, device_t dev, Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Wed Apr 27 16:34:29 2016 (r298710) +++ head/sys/dev/pci/pci_pci.c Wed Apr 27 16:39:05 2016 (r298711) @@ -1075,21 +1075,26 @@ pcib_attach_common(device_t dev) } int +pcib_attach_child(device_t dev) +{ + struct pcib_softc *sc; + + sc = device_get_softc(dev); + if (sc->bus.sec == 0) { + /* no secondary bus; we should have fixed this */ + return(0); + } + + sc->child = device_add_child(dev, "pci", -1); + return (bus_generic_attach(dev)); +} + +int pcib_attach(device_t dev) { - struct pcib_softc *sc; - device_t child; pcib_attach_common(dev); - sc = device_get_softc(dev); - if (sc->bus.sec != 0) { - child = device_add_child(dev, "pci", -1); - if (child != NULL) - return(bus_generic_attach(dev)); - } - - /* no secondary bus; we should have fixed this */ - return(0); + return (pcib_attach_child(dev)); } int Modified: head/sys/dev/pci/pcib_private.h ============================================================================== --- head/sys/dev/pci/pcib_private.h Wed Apr 27 16:34:29 2016 (r298710) +++ head/sys/dev/pci/pcib_private.h Wed Apr 27 16:39:05 2016 (r298711) @@ -101,6 +101,7 @@ struct pcib_secbus { struct pcib_softc { device_t dev; + device_t child; uint32_t flags; /* flags */ #define PCIB_SUBTRACTIVE 0x1 #define PCIB_DISABLE_MSI 0x2 @@ -144,6 +145,7 @@ void pcib_setup_secbus(device_t dev, st int min_count); #endif int pcib_attach(device_t dev); +int pcib_attach_child(device_t dev); void pcib_attach_common(device_t dev); void pcib_bridge_init(device_t dev); #ifdef NEW_PCIB Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Wed Apr 27 16:34:29 2016 (r298710) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Wed Apr 27 16:39:05 2016 (r298711) @@ -114,10 +114,7 @@ ofw_pcib_pci_attach(device_t dev) sizeof(cell_t)); pcib_attach_common(dev); - - device_add_child(dev, "pci", -1); - - return (bus_generic_attach(dev)); + return (pcib_attach_child(dev)); } static phandle_t Modified: head/sys/sparc64/pci/ofw_pcib.c ============================================================================== --- head/sys/sparc64/pci/ofw_pcib.c Wed Apr 27 16:34:29 2016 (r298710) +++ head/sys/sparc64/pci/ofw_pcib.c Wed Apr 27 16:39:05 2016 (r298711) @@ -149,8 +149,7 @@ ofw_pcib_attach(device_t dev) ofw_pcib_gen_setup(dev); pcib_attach_common(dev); - device_add_child(dev, "pci", -1); - return (bus_generic_attach(dev)); + return (pcib_attach_child(dev)); } static void From owner-svn-src-head@freebsd.org Wed Apr 27 16:42:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 568FAB1E76A; Wed, 27 Apr 2016 16:42:35 +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 38A9E1139; Wed, 27 Apr 2016 16:42:35 +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 529ACB93C; Wed, 27 Apr 2016 12:42:34 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298709 - in head: lib/libdevctl sys/kern sys/sys usr.sbin/devctl Date: Wed, 27 Apr 2016 09:42:31 -0700 Message-ID: <1568866.L86RL8nV80@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604271633.u3RGXHed004024@repo.freebsd.org> References: <201604271633.u3RGXHed004024@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); Wed, 27 Apr 2016 12:42:34 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 16:42:35 -0000 On Wednesday, April 27, 2016 04:33:17 PM John Baldwin wrote: > Author: jhb > Date: Wed Apr 27 16:33:17 2016 > New Revision: 298709 > URL: https://svnweb.freebsd.org/changeset/base/298709 > > Log: > Add 'devctl delete' that calls device_delete_child(). > > 'devctl delete' can be used to delete a device that is no longer present. > As an anti-foot-shooting measure, 'delete' will not delete a device > unless it's parent bus says it is no longer present. This can be > overridden by passing the force ('-f') flag. > > Note that this command should be used with care. If a device is deleted > that is actually present it can't be resurrected unless the parent bus > device's driver supports rescans. > > Differential Revision: https://reviews.freebsd.org/D6019 Oops, both of the devctl commits probably warranted a 'Relnotes: yes'. One obscure-ish use case for these commands is if you are working with a PCI FPGA adapter that you can flash while the host machine is running. The new configuration may involve changes to BAR layout, etc. In that case you should now be able to 'devctl delete' the device before flashing it and 'devctl rescan' the parent bus after the flash is complete. You can also use 'devctl rescan' for a poor-man's PCI-e hotplug support on bridges that support automated PCI-e hotplug (no power controller, etc.) such as the ExpressCard slot on the two Lenovo's I have (T400 and X220). -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 27 17:05:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BABD5B1EF7D; Wed, 27 Apr 2016 17:05:56 +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 8A7E812C7; Wed, 27 Apr 2016 17:05:56 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id 6437ED78FE; Wed, 27 Apr 2016 17:05:50 +0000 (UTC) Date: Wed, 27 Apr 2016 18:05:46 +0100 From: Andrew Turner To: Zbigniew Bodek Cc: John Baldwin , =?ISO-8859-1?Q?Micha=3F?= Stanek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298425 - head/sys/dev/acpica Message-ID: <20160427180546.311aecdf@zapp> In-Reply-To: References: <201604211827.u3LIR5ML089177@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 17:05:56 -0000 On Wed, 27 Apr 2016 16:57:28 +0200 Zbigniew Bodek wrote: > Hello, > > I'm forwarding a message from Michal Stanek who found some problems > wit this commit. Please see below: > > ------------------------------------------- > I'm getting a lot of ACPI error messages on ThunderX (arm64). The > kernel also panics before it gets to prompt. > Running bisect pointed to this patch as the culprit. > > Removing acpi from GENERIC configuration fixes the issue. See r298639. I know the issue, the code is picking up the ofw cpu devices. I'm expecting to work on ACPI in a few months so will expect to fix this then (unless someone else gets to it first) Andrew From owner-svn-src-head@freebsd.org Wed Apr 27 17:23:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8BCEB1E4E5; Wed, 27 Apr 2016 17:23:58 +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 8AA961077; Wed, 27 Apr 2016 17:23:58 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 6ACE3B93A; Wed, 27 Apr 2016 13:23:57 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298708 - in head/sys: dev/cardbus dev/pci mips/nlm powerpc/ofw sparc64/pci Date: Wed, 27 Apr 2016 10:23:55 -0700 Message-ID: <1976035.cgz5COcGKZ@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604271631.u3RGVCjE001316@repo.freebsd.org> References: <201604271631.u3RGVCjE001316@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); Wed, 27 Apr 2016 13:23:57 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 17:23:58 -0000 On Wednesday, April 27, 2016 04:31:12 PM John Baldwin wrote: > Author: jhb > Date: Wed Apr 27 16:31:12 2016 > New Revision: 298708 > URL: https://svnweb.freebsd.org/changeset/base/298708 > > Log: > Implement a PCI bus rescan method. > > Rescanning a PCI bus uses the following steps: > - Fetch the current set of child devices and save it in the 'devlist' > array. > - Allocate a parallel array 'unchanged' initalized with NULL pointers. > - Scan the bus checking each slot (and each function on slots with a > multifunction device). > - If a valid function is found, look for a matching device in the 'devlist' > array. If a device is found, save the pointer in the 'unchanged' array. > If a device is not found, add a new device. > - After the scan has finished, walk the 'devlist' array deleting any > devices that do not have a matching pointer in the 'unchanged' array. > - Finally, fetch an updated set of child devices and explicitly attach any > devices that are not present in the 'unchanged' array. > > This builds on the previous changes to move subclass data management into > pci_alloc_devinfo(), pci_child_added(), and bus_child_deleted(). > > Subclasses of the PCI bus use custom rescan logic explicitly override the > rescan method to disable rescans. > > Differential Revision: https://reviews.freebsd.org/D6018 Argh, I thought for certain I had done a tinderbox build, but using kobj_error_method breaks the build. I will test a fix that adds a null_rescan method instead and commit it shortly. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 27 17:24:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDD64B1E4EC; Wed, 27 Apr 2016 17:24: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 9EF78107C; Wed, 27 Apr 2016 17:24:00 +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 B22BCB93C; Wed, 27 Apr 2016 13:23:59 -0400 (EDT) From: John Baldwin To: Zbigniew Bodek Cc: =?utf-8?B?TWljaGHFgg==?= Stanek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298425 - head/sys/dev/acpica Date: Wed, 27 Apr 2016 09:46:35 -0700 Message-ID: <32556581.Dd6EY0QH0C@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201604211827.u3LIR5ML089177@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); Wed, 27 Apr 2016 13:23:59 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 17:24:00 -0000 On Wednesday, April 27, 2016 04:57:28 PM Zbigniew Bodek wrote: > Hello, > > I'm forwarding a message from Michal Stanek who found some problems wit > this commit. Please see below: It looks like you have "cpuX" devices that aren't acpi_cpu.c devices. That's fine, but that is why this driver is confused a bit. Before my change all that happened was that this triggered extra probe/attach of child devices, but now it queues the ACPI-specific task as well. I've add you to a review for a change I think will fix this (and which I've tested on amd64 with ACPI): https://reviews.freebsd.org/D6133 -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 27 17:26:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BEEEDB1E747 for ; Wed, 27 Apr 2016 17:26:57 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: from mail-lf0-x234.google.com (mail-lf0-x234.google.com [IPv6:2a00:1450:4010:c07::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 45E1816AA for ; Wed, 27 Apr 2016 17:26:57 +0000 (UTC) (envelope-from zbb@semihalf.com) Received: by mail-lf0-x234.google.com with SMTP id u64so57775037lff.3 for ; Wed, 27 Apr 2016 10:26:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=TlYnSfq08wG7O4GM4R+J7e8Qm7F1A0K+H5SsY5mC7i4=; b=pg71j2yIWqIzLuALHBWN97PQXNoQt/iUg29CTSxMo546DKu/2tgm+6Fr+xz0CfynRk SZP4nDBwGI4T72hRz0x2p+3FaSIKkivHbN27OyEhyNUb5rszptguJT90aqMTExa2sJxC F7EaJE0mbyLrq7ufBVNKUla8z5LsCMEf80nqb8F0byykbMUq8Temur6S4Y8qhyaab7M7 wbTtFX42EgZ1/P/mjUdzsqlGawDw4VXzVJexkMMoQjhplpe31u0aYxxmG13fbC5mpvgP HegFF4Z5tZMUmGuYLwA17LXcXCgK/7NyfGkQC0fUy04j8p/ec2JiXUBb+IPyxIzYmOQ7 evIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=TlYnSfq08wG7O4GM4R+J7e8Qm7F1A0K+H5SsY5mC7i4=; b=YFOXbBqFY3Gd0orj5WrskA3AM4tuoMLN80lJOFpTo9q5Wxn2ajhshaW0r801qevh29 dTzrlYrEpmgeeMpx1+7BbJo2vok25NC7olE1mksEEGbORr9V3Fe+FXc2qv5AQuf9iSnV /0fXOmpHUMNvZ5E2xr81aGCpZYPeh/U6IKwWZeXCnOuGIVF2FOtTOi+cMKPSdxwZjc/E Nk8d4491FYBmLInC9TlkW4rDiB0pCWwRx+yRUhj3gwYkwG/pbaEOiJv4z/LBdpbn57LK rKkyoTmNKnf0XdjPTrKFpVF5wEJSL7IZ6G0byzsxovP+8G55g/XU5fSi6P2r45+eOXH6 A49w== X-Gm-Message-State: AOPr4FXlX3vFCk7ghTnjNwNEAGgXXZCHCdN+Zkqsb0rbqYSKPPo6aPWHKwIpl8w8UER9P9OWRoD2LLzE1/BZig== X-Received: by 10.25.16.73 with SMTP id f70mr4295579lfi.34.1461778015100; Wed, 27 Apr 2016 10:26:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.25.205.1 with HTTP; Wed, 27 Apr 2016 10:26:35 -0700 (PDT) In-Reply-To: <32556581.Dd6EY0QH0C@ralph.baldwin.cx> References: <201604211827.u3LIR5ML089177@repo.freebsd.org> <32556581.Dd6EY0QH0C@ralph.baldwin.cx> From: Zbigniew Bodek Date: Wed, 27 Apr 2016 19:26:35 +0200 Message-ID: Subject: Re: svn commit: r298425 - head/sys/dev/acpica To: John Baldwin Cc: =?UTF-8?Q?Micha=C5=82_Stanek?= , 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.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 17:26:57 -0000 2016-04-27 18:46 GMT+02:00 John Baldwin : > On Wednesday, April 27, 2016 04:57:28 PM Zbigniew Bodek wrote: > > Hello, > > > > I'm forwarding a message from Michal Stanek who found some problems wit > > this commit. Please see below: > > It looks like you have "cpuX" devices that aren't acpi_cpu.c devices. > That's fine, but that is why this driver is confused a bit. Before my > change all that happened was that this triggered extra probe/attach of > child devices, but now it queues the ACPI-specific task as well. > > I've add you to a review for a change I think will fix this (and which I've > tested on amd64 with ACPI): > > https://reviews.freebsd.org/D6133 > > Thanks. Please add Michal Stanek (mst) as well. Best regards zbb From owner-svn-src-head@freebsd.org Wed Apr 27 17:49:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FACAB1EE36; Wed, 27 Apr 2016 17:49: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 EE4F41802; Wed, 27 Apr 2016 17:49: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 u3RHnhMF051457; Wed, 27 Apr 2016 17:49:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RHngl6051451; Wed, 27 Apr 2016 17:49:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604271749.u3RHngl6051451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 17:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298712 - in head/sys: dev/cardbus kern mips/nlm powerpc/ofw sparc64/pci sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 17:49:44 -0000 Author: jhb Date: Wed Apr 27 17:49:42 2016 New Revision: 298712 URL: https://svnweb.freebsd.org/changeset/base/298712 Log: Add a bus_null_rescan() method that always fails with an error. Use this in place of kobj_error_method to disable BUS_RESCAN() on PCI drivers that do not use the "standard" scanning algorithm. Modified: head/sys/dev/cardbus/cardbus.c head/sys/kern/subr_bus.c head/sys/mips/nlm/xlp_pci.c head/sys/powerpc/ofw/ofw_pcibus.c head/sys/sparc64/pci/ofw_pcibus.c head/sys/sys/bus.h Modified: head/sys/dev/cardbus/cardbus.c ============================================================================== --- head/sys/dev/cardbus/cardbus.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/dev/cardbus/cardbus.c Wed Apr 27 17:49:42 2016 (r298712) @@ -346,7 +346,7 @@ static device_method_t cardbus_methods[] DEVMETHOD(bus_get_dma_tag, bus_generic_get_dma_tag), DEVMETHOD(bus_read_ivar, cardbus_read_ivar), DEVMETHOD(bus_driver_added, cardbus_driver_added), - DEVMETHOD(bus_rescan, kobj_error_method), + DEVMETHOD(bus_rescan, bus_null_rescan), /* Card Interface */ DEVMETHOD(card_attach_card, cardbus_attach_card), Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/kern/subr_bus.c Wed Apr 27 17:49:42 2016 (r298712) @@ -4289,6 +4289,19 @@ bus_generic_get_domain(device_t dev, dev return (ENOENT); } +/** + * @brief Helper function for implementing BUS_RESCAN(). + * + * This null implementation of BUS_RESCAN() always fails to indicate + * the bus does not support rescanning. + */ +int +bus_null_rescan(device_t dev) +{ + + return (ENXIO); +} + /* * Some convenience functions to make it easier for drivers to use the * resource-management functions. All these really do is hide the Modified: head/sys/mips/nlm/xlp_pci.c ============================================================================== --- head/sys/mips/nlm/xlp_pci.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/mips/nlm/xlp_pci.c Wed Apr 27 17:49:42 2016 (r298712) @@ -154,7 +154,7 @@ static device_method_t xlp_pci_methods[] /* Device interface */ DEVMETHOD(device_probe, xlp_pci_probe), DEVMETHOD(device_attach, xlp_pci_attach), - DEVMETHOD(bus_rescan, kobj_error_method), + DEVMETHOD(bus_rescan, bus_null_rescan), DEVMETHOD_END }; Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/powerpc/ofw/ofw_pcibus.c Wed Apr 27 17:49:42 2016 (r298712) @@ -77,7 +77,7 @@ static device_method_t ofw_pcibus_method /* Bus interface */ DEVMETHOD(bus_child_deleted, ofw_pcibus_child_deleted), DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_child_pnpinfo_str_method), - DEVMETHOD(bus_rescan, kobj_error_method), + DEVMETHOD(bus_rescan, bus_null_rescan), /* PCI interface */ DEVMETHOD(pci_alloc_devinfo, ofw_pcibus_alloc_devinfo), Modified: head/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- head/sys/sparc64/pci/ofw_pcibus.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/sparc64/pci/ofw_pcibus.c Wed Apr 27 17:49:42 2016 (r298712) @@ -81,7 +81,7 @@ static device_method_t ofw_pcibus_method /* Bus interface */ DEVMETHOD(bus_child_deleted, ofw_pcibus_child_deleted), DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_pnpinfo_str), - DEVMETHOD(bus_rescan, kobj_error_method), + DEVMETHOD(bus_rescan, bus_null_rescan), /* PCI interface */ DEVMETHOD(pci_alloc_devinfo, ofw_pcibus_alloc_devinfo), Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/sys/bus.h Wed Apr 27 17:49:42 2016 (r298712) @@ -430,6 +430,7 @@ int bus_generic_teardown_intr(device_t d struct resource *irq, void *cookie); int bus_generic_write_ivar(device_t dev, device_t child, int which, uintptr_t value); +int bus_null_rescan(device_t dev); /* * Wrapper functions for the BUS_*_RESOURCE methods to make client code From owner-svn-src-head@freebsd.org Wed Apr 27 17:59:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D2F5B1E1AB; Wed, 27 Apr 2016 17:59:20 +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 6EFB81F36; Wed, 27 Apr 2016 17:59:20 +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 77B3AB978; Wed, 27 Apr 2016 13:59:19 -0400 (EDT) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298712 - in head/sys: dev/cardbus kern mips/nlm powerpc/ofw sparc64/pci sys Date: Wed, 27 Apr 2016 10:54:42 -0700 Message-ID: <2789741.CjRGbn4rPl@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201604271749.u3RHngl6051451@repo.freebsd.org> References: <201604271749.u3RHngl6051451@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); Wed, 27 Apr 2016 13:59:19 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 17:59:20 -0000 On Wednesday, April 27, 2016 05:49:42 PM John Baldwin wrote: > Author: jhb > Date: Wed Apr 27 17:49:42 2016 > New Revision: 298712 > URL: https://svnweb.freebsd.org/changeset/base/298712 > > Log: > Add a bus_null_rescan() method that always fails with an error. > > Use this in place of kobj_error_method to disable BUS_RESCAN() on > PCI drivers that do not use the "standard" scanning algorithm. This should fix the build. > Modified: > head/sys/dev/cardbus/cardbus.c > head/sys/kern/subr_bus.c > head/sys/mips/nlm/xlp_pci.c > head/sys/powerpc/ofw/ofw_pcibus.c > head/sys/sparc64/pci/ofw_pcibus.c > head/sys/sys/bus.h Note that some of these drivers could be changed to use the "standard" scanning algorithm and support rescans if they moved some of their custom scanning logic into a pci_child_added callback. This is generally true of all but cardbus except that the OFW busses use the OFW tree to drive scanning (so it seems they will add PCI devices that don't appear valid to a PCI scan but are in the OFW tree). I'm not sure how well that can work in practice as no PCI device driver is going to attach to a PCI device with a vendor ID of 0xffff (ACPI doesn't attempt to handle devices that show up in the ACPI namespace but not in a PCI scan). The xlp driver would just move the function-specific fixups into the pci_child_added callback (though the special interrupt routing is perhaps best done in PCI_ASSIGN_INTERRUPT or the like). OFW would walk the OFW tree to find the corresponding node (if one is found) and initialize the OFW ivars (similar to what ACPI does) in the callback. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Apr 27 18:58:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7687AB1F198; Wed, 27 Apr 2016 18:58:48 +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 390BF13E5; Wed, 27 Apr 2016 18:58:48 +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 u3RIwlVJ073654; Wed, 27 Apr 2016 18:58:47 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RIwlNA073653; Wed, 27 Apr 2016 18:58:47 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604271858.u3RIwlNA073653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Wed, 27 Apr 2016 18:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298713 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 18:58:48 -0000 Author: tuexen Date: Wed Apr 27 18:58:47 2016 New Revision: 298713 URL: https://svnweb.freebsd.org/changeset/base/298713 Log: Don't use the control argument after calling sctp_add_to_readq(). This breaks the userland stack. There should be no functional change for the FreeBSD kernel stack. While there, use consistent variable nameing. Modified: head/sys/netinet/sctp_indata.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Wed Apr 27 17:49:42 2016 (r298712) +++ head/sys/netinet/sctp_indata.c Wed Apr 27 18:58:47 2016 (r298713) @@ -812,11 +812,6 @@ restart: control->on_strm_q = 0; } } - if (control->on_read_q == 0) { - sctp_add_to_readq(stcb->sctp_ep, stcb, control, - &stcb->sctp_socket->so_rcv, control->end_added, - SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - } if (control->pdapi_started) { strm->pd_api_started = 0; control->pdapi_started = 0; @@ -825,6 +820,11 @@ restart: TAILQ_REMOVE(&strm->uno_inqueue, control, next_instrm); control->on_strm_q = 0; } + if (control->on_read_q == 0) { + sctp_add_to_readq(stcb->sctp_ep, stcb, control, + &stcb->sctp_socket->so_rcv, control->end_added, + SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + } sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); if ((nc) && (nc->first_frag_seen)) { /* @@ -843,11 +843,11 @@ restart: } } if ((control->length > pd_point) && (strm->pd_api_started == 0)) { + strm->pd_api_started = 1; + control->pdapi_started = 1; sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, control->end_added, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); - strm->pd_api_started = 1; - control->pdapi_started = 1; sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); return (0); } else { @@ -1083,16 +1083,16 @@ done_un: TAILQ_REMOVE(&strm->inqueue, control, next_instrm); control->on_strm_q = 0; } + if (strm->pd_api_started && control->pdapi_started) { + control->pdapi_started = 0; + strm->pd_api_started = 0; + } if (control->on_read_q == 0) { sctp_add_to_readq(stcb->sctp_ep, stcb, control, &stcb->sctp_socket->so_rcv, control->end_added, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } - if (strm->pd_api_started && control->pdapi_started) { - control->pdapi_started = 0; - strm->pd_api_started = 0; - } control = nctl; } } @@ -1113,6 +1113,8 @@ deliver_more: nctl = TAILQ_NEXT(control, next_instrm); if ((control->sinfo_ssn == next_to_del) && (control->first_frag_seen)) { + int done; + /* Ok we can deliver it onto the stream. */ if (control->end_added) { /* We are done with it afterwards */ @@ -1147,6 +1149,7 @@ deliver_more: goto out; } } + done = (control->end_added) && (control->last_frag_seen); if (control->on_read_q == 0) { sctp_add_to_readq(stcb->sctp_ep, stcb, control, @@ -1154,7 +1157,7 @@ deliver_more: SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); } strm->last_sequence_delivered = next_to_del; - if ((control->end_added) && (control->last_frag_seen)) { + if (done) { control = nctl; goto deliver_more; } else { @@ -1248,7 +1251,7 @@ sctp_queue_data_for_reasm(struct sctp_tc { uint32_t next_fsn; struct sctp_tmit_chunk *at, *nat; - int cnt_added, unordered; + int do_wakeup, unordered; /* * For old un-ordered data chunks. @@ -1457,7 +1460,7 @@ sctp_queue_data_for_reasm(struct sctp_tc * Ok lets see if we can suck any up into the control structure that * are in seq if it makes sense. */ - cnt_added = 0; + do_wakeup = 0; /* * If the first fragment has not been seen there is no sense in * looking. @@ -1474,7 +1477,9 @@ sctp_queue_data_for_reasm(struct sctp_tc next_fsn, control->fsn_included); TAILQ_REMOVE(&control->reasm, at, sctp_next); sctp_add_chk_to_control(control, strm, stcb, asoc, at); - cnt_added++; + if (control->on_read_q) { + do_wakeup = 1; + } next_fsn++; if (control->end_added && control->pdapi_started) { if (strm->pd_api_started) { @@ -1486,6 +1491,7 @@ sctp_queue_data_for_reasm(struct sctp_tc control, &stcb->sctp_socket->so_rcv, control->end_added, SCTP_READ_LOCK_NOT_HELD, SCTP_SO_NOT_LOCKED); + do_wakeup = 1; } break; } @@ -1494,7 +1500,7 @@ sctp_queue_data_for_reasm(struct sctp_tc } } } - if ((control->on_read_q) && (cnt_added > 0)) { + if (do_wakeup) { /* Need to wakeup the reader */ sctp_wakeup_the_read_socket(stcb->sctp_ep, stcb, SCTP_SO_NOT_LOCKED); } @@ -1503,29 +1509,28 @@ sctp_queue_data_for_reasm(struct sctp_tc static struct sctp_queued_to_read * find_reasm_entry(struct sctp_stream_in *strm, uint32_t msg_id, int ordered, int old) { - struct sctp_queued_to_read *reasm; + struct sctp_queued_to_read *control; if (ordered) { - TAILQ_FOREACH(reasm, &strm->inqueue, next_instrm) { - if (reasm->msg_id == msg_id) { + TAILQ_FOREACH(control, &strm->inqueue, next_instrm) { + if (control->msg_id == msg_id) { break; } } } else { if (old) { - reasm = TAILQ_FIRST(&strm->uno_inqueue); - return (reasm); + control = TAILQ_FIRST(&strm->uno_inqueue); + return (control); } - TAILQ_FOREACH(reasm, &strm->uno_inqueue, next_instrm) { - if (reasm->msg_id == msg_id) { + TAILQ_FOREACH(control, &strm->uno_inqueue, next_instrm) { + if (control->msg_id == msg_id) { break; } } } - return (reasm); + return (control); } - static int sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc, struct mbuf **m, int offset, int chk_length, From owner-svn-src-head@freebsd.org Wed Apr 27 19:09:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F95B1F3B5; Wed, 27 Apr 2016 19:09:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EF4E1C69; Wed, 27 Apr 2016 19:09:23 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3RJ9MGQ076977; Wed, 27 Apr 2016 19:09:22 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RJ9Mvf076972; Wed, 27 Apr 2016 19:09:22 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201604271909.u3RJ9Mvf076972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 27 Apr 2016 19:09:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298714 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 19:09:23 -0000 Author: jkim Date: Wed Apr 27 19:09:21 2016 New Revision: 298714 URL: https://svnweb.freebsd.org/changeset/base/298714 Log: Merge ACPICA 20160422. Added: head/sys/contrib/dev/acpica/common/acfileio.c - copied, changed from r291333, vendor-sys/acpica/dist/source/common/acfileio.c head/sys/contrib/dev/acpica/common/dmtables.c - copied, changed from r291333, vendor-sys/acpica/dist/source/common/dmtables.c head/sys/contrib/dev/acpica/compiler/aslcstyle.y - copied, changed from r288425, vendor-sys/acpica/dist/source/compiler/aslcstyle.y head/sys/contrib/dev/acpica/compiler/asldebug.c (contents, props changed) - copied, changed from r295571, vendor-sys/acpica/dist/source/compiler/asldebug.c head/sys/contrib/dev/acpica/compiler/aslexternal.c (contents, props changed) - copied, changed from r295571, vendor-sys/acpica/dist/source/compiler/aslexternal.c head/sys/contrib/dev/acpica/compiler/aslpld.c - copied, changed from r297044, vendor-sys/acpica/dist/source/compiler/aslpld.c head/sys/contrib/dev/acpica/compiler/aslresources.y - copied, changed from r288425, vendor-sys/acpica/dist/source/compiler/aslresources.y head/sys/contrib/dev/acpica/compiler/aslxrefout.c (contents, props changed) - copied, changed from r295571, vendor-sys/acpica/dist/source/compiler/aslxrefout.c head/sys/contrib/dev/acpica/compiler/dttable1.c - copied, changed from r291333, vendor-sys/acpica/dist/source/compiler/dttable1.c head/sys/contrib/dev/acpica/compiler/dttable2.c - copied, changed from r291333, vendor-sys/acpica/dist/source/compiler/dttable2.c head/sys/contrib/dev/acpica/components/executer/exconcat.c - copied, changed from r297044, vendor-sys/acpica/dist/source/components/executer/exconcat.c head/sys/contrib/dev/acpica/components/executer/extrace.c - copied, changed from r291333, vendor-sys/acpica/dist/source/components/executer/extrace.c head/sys/contrib/dev/acpica/components/utilities/utascii.c (contents, props changed) - copied, changed from r298595, vendor-sys/acpica/dist/source/components/utilities/utascii.c head/sys/libkern/strncat.c (contents, props changed) Deleted: head/sys/contrib/dev/acpica/components/utilities/utfileio.c Modified: head/sys/conf/files head/sys/contrib/dev/acpica/acpica_prep.sh head/sys/contrib/dev/acpica/changes.txt head/sys/contrib/dev/acpica/common/acgetline.c head/sys/contrib/dev/acpica/common/adfile.c head/sys/contrib/dev/acpica/common/adisasm.c head/sys/contrib/dev/acpica/common/adwalk.c head/sys/contrib/dev/acpica/common/ahids.c head/sys/contrib/dev/acpica/common/ahpredef.c head/sys/contrib/dev/acpica/common/ahtable.c head/sys/contrib/dev/acpica/common/ahuuids.c head/sys/contrib/dev/acpica/common/cmfsize.c head/sys/contrib/dev/acpica/common/dmextern.c head/sys/contrib/dev/acpica/common/dmrestag.c head/sys/contrib/dev/acpica/common/dmtable.c head/sys/contrib/dev/acpica/common/dmtbdump.c head/sys/contrib/dev/acpica/common/dmtbinfo.c head/sys/contrib/dev/acpica/common/getopt.c head/sys/contrib/dev/acpica/compiler/aslanalyze.c head/sys/contrib/dev/acpica/compiler/aslascii.c head/sys/contrib/dev/acpica/compiler/aslbtypes.c head/sys/contrib/dev/acpica/compiler/aslcodegen.c head/sys/contrib/dev/acpica/compiler/aslcompile.c head/sys/contrib/dev/acpica/compiler/aslcompiler.h head/sys/contrib/dev/acpica/compiler/aslcompiler.l head/sys/contrib/dev/acpica/compiler/asldefine.h head/sys/contrib/dev/acpica/compiler/aslerror.c head/sys/contrib/dev/acpica/compiler/aslfileio.c head/sys/contrib/dev/acpica/compiler/aslfiles.c head/sys/contrib/dev/acpica/compiler/aslfold.c head/sys/contrib/dev/acpica/compiler/aslglobal.h head/sys/contrib/dev/acpica/compiler/aslhex.c head/sys/contrib/dev/acpica/compiler/asllength.c head/sys/contrib/dev/acpica/compiler/asllisting.c head/sys/contrib/dev/acpica/compiler/asllistsup.c head/sys/contrib/dev/acpica/compiler/aslload.c head/sys/contrib/dev/acpica/compiler/asllookup.c head/sys/contrib/dev/acpica/compiler/aslmain.c head/sys/contrib/dev/acpica/compiler/aslmap.c head/sys/contrib/dev/acpica/compiler/aslmapenter.c head/sys/contrib/dev/acpica/compiler/aslmapoutput.c head/sys/contrib/dev/acpica/compiler/aslmaputils.c head/sys/contrib/dev/acpica/compiler/aslmessages.c head/sys/contrib/dev/acpica/compiler/aslmessages.h head/sys/contrib/dev/acpica/compiler/aslmethod.c head/sys/contrib/dev/acpica/compiler/aslnamesp.c head/sys/contrib/dev/acpica/compiler/asloffset.c head/sys/contrib/dev/acpica/compiler/aslopcodes.c head/sys/contrib/dev/acpica/compiler/asloperands.c head/sys/contrib/dev/acpica/compiler/aslopt.c head/sys/contrib/dev/acpica/compiler/asloptions.c head/sys/contrib/dev/acpica/compiler/aslparser.y head/sys/contrib/dev/acpica/compiler/aslpredef.c head/sys/contrib/dev/acpica/compiler/aslprepkg.c head/sys/contrib/dev/acpica/compiler/aslprintf.c head/sys/contrib/dev/acpica/compiler/aslprune.c head/sys/contrib/dev/acpica/compiler/aslresource.c head/sys/contrib/dev/acpica/compiler/aslrestype1.c head/sys/contrib/dev/acpica/compiler/aslrestype1i.c head/sys/contrib/dev/acpica/compiler/aslrestype2.c head/sys/contrib/dev/acpica/compiler/aslrestype2d.c head/sys/contrib/dev/acpica/compiler/aslrestype2e.c head/sys/contrib/dev/acpica/compiler/aslrestype2q.c head/sys/contrib/dev/acpica/compiler/aslrestype2s.c head/sys/contrib/dev/acpica/compiler/aslrestype2w.c head/sys/contrib/dev/acpica/compiler/aslrules.y head/sys/contrib/dev/acpica/compiler/aslstartup.c head/sys/contrib/dev/acpica/compiler/aslstubs.c head/sys/contrib/dev/acpica/compiler/aslsupport.l head/sys/contrib/dev/acpica/compiler/aslsupport.y head/sys/contrib/dev/acpica/compiler/asltokens.y head/sys/contrib/dev/acpica/compiler/asltransform.c head/sys/contrib/dev/acpica/compiler/asltree.c head/sys/contrib/dev/acpica/compiler/asltypes.h head/sys/contrib/dev/acpica/compiler/asltypes.y head/sys/contrib/dev/acpica/compiler/aslutils.c head/sys/contrib/dev/acpica/compiler/asluuid.c head/sys/contrib/dev/acpica/compiler/aslwalks.c head/sys/contrib/dev/acpica/compiler/aslxref.c head/sys/contrib/dev/acpica/compiler/dtcompile.c head/sys/contrib/dev/acpica/compiler/dtcompiler.h head/sys/contrib/dev/acpica/compiler/dtexpress.c head/sys/contrib/dev/acpica/compiler/dtfield.c head/sys/contrib/dev/acpica/compiler/dtio.c head/sys/contrib/dev/acpica/compiler/dtparser.l head/sys/contrib/dev/acpica/compiler/dtparser.y head/sys/contrib/dev/acpica/compiler/dtsubtable.c head/sys/contrib/dev/acpica/compiler/dttable.c head/sys/contrib/dev/acpica/compiler/dttemplate.c head/sys/contrib/dev/acpica/compiler/dttemplate.h head/sys/contrib/dev/acpica/compiler/dtutils.c head/sys/contrib/dev/acpica/compiler/preprocess.h head/sys/contrib/dev/acpica/compiler/prexpress.c head/sys/contrib/dev/acpica/compiler/prmacros.c head/sys/contrib/dev/acpica/compiler/prparser.l head/sys/contrib/dev/acpica/compiler/prparser.y head/sys/contrib/dev/acpica/compiler/prscan.c head/sys/contrib/dev/acpica/compiler/prutils.c head/sys/contrib/dev/acpica/components/debugger/dbcmds.c head/sys/contrib/dev/acpica/components/debugger/dbconvert.c head/sys/contrib/dev/acpica/components/debugger/dbdisply.c head/sys/contrib/dev/acpica/components/debugger/dbexec.c head/sys/contrib/dev/acpica/components/debugger/dbfileio.c head/sys/contrib/dev/acpica/components/debugger/dbhistry.c head/sys/contrib/dev/acpica/components/debugger/dbinput.c head/sys/contrib/dev/acpica/components/debugger/dbmethod.c head/sys/contrib/dev/acpica/components/debugger/dbnames.c head/sys/contrib/dev/acpica/components/debugger/dbobject.c head/sys/contrib/dev/acpica/components/debugger/dbstats.c head/sys/contrib/dev/acpica/components/debugger/dbtest.c head/sys/contrib/dev/acpica/components/debugger/dbutils.c head/sys/contrib/dev/acpica/components/debugger/dbxface.c head/sys/contrib/dev/acpica/components/disassembler/dmbuffer.c head/sys/contrib/dev/acpica/components/disassembler/dmcstyle.c head/sys/contrib/dev/acpica/components/disassembler/dmdeferred.c head/sys/contrib/dev/acpica/components/disassembler/dmnames.c head/sys/contrib/dev/acpica/components/disassembler/dmopcode.c head/sys/contrib/dev/acpica/components/disassembler/dmresrc.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcl2.c head/sys/contrib/dev/acpica/components/disassembler/dmresrcs.c head/sys/contrib/dev/acpica/components/disassembler/dmutils.c head/sys/contrib/dev/acpica/components/disassembler/dmwalk.c head/sys/contrib/dev/acpica/components/dispatcher/dsargs.c head/sys/contrib/dev/acpica/components/dispatcher/dscontrol.c head/sys/contrib/dev/acpica/components/dispatcher/dsdebug.c head/sys/contrib/dev/acpica/components/dispatcher/dsfield.c head/sys/contrib/dev/acpica/components/dispatcher/dsinit.c head/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c head/sys/contrib/dev/acpica/components/dispatcher/dsmthdat.c head/sys/contrib/dev/acpica/components/dispatcher/dsobject.c head/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c head/sys/contrib/dev/acpica/components/dispatcher/dsutils.c head/sys/contrib/dev/acpica/components/dispatcher/dswexec.c head/sys/contrib/dev/acpica/components/dispatcher/dswload.c head/sys/contrib/dev/acpica/components/dispatcher/dswload2.c head/sys/contrib/dev/acpica/components/dispatcher/dswscope.c head/sys/contrib/dev/acpica/components/dispatcher/dswstate.c head/sys/contrib/dev/acpica/components/events/evevent.c head/sys/contrib/dev/acpica/components/events/evglock.c head/sys/contrib/dev/acpica/components/events/evgpe.c head/sys/contrib/dev/acpica/components/events/evgpeblk.c head/sys/contrib/dev/acpica/components/events/evgpeinit.c head/sys/contrib/dev/acpica/components/events/evgpeutil.c head/sys/contrib/dev/acpica/components/events/evhandler.c head/sys/contrib/dev/acpica/components/events/evmisc.c head/sys/contrib/dev/acpica/components/events/evregion.c head/sys/contrib/dev/acpica/components/events/evrgnini.c head/sys/contrib/dev/acpica/components/events/evsci.c head/sys/contrib/dev/acpica/components/events/evxface.c head/sys/contrib/dev/acpica/components/events/evxfevnt.c head/sys/contrib/dev/acpica/components/events/evxfgpe.c head/sys/contrib/dev/acpica/components/events/evxfregn.c head/sys/contrib/dev/acpica/components/executer/exconfig.c head/sys/contrib/dev/acpica/components/executer/exconvrt.c head/sys/contrib/dev/acpica/components/executer/excreate.c head/sys/contrib/dev/acpica/components/executer/exdebug.c head/sys/contrib/dev/acpica/components/executer/exdump.c head/sys/contrib/dev/acpica/components/executer/exfield.c head/sys/contrib/dev/acpica/components/executer/exfldio.c head/sys/contrib/dev/acpica/components/executer/exmisc.c head/sys/contrib/dev/acpica/components/executer/exmutex.c head/sys/contrib/dev/acpica/components/executer/exnames.c head/sys/contrib/dev/acpica/components/executer/exoparg1.c head/sys/contrib/dev/acpica/components/executer/exoparg2.c head/sys/contrib/dev/acpica/components/executer/exoparg3.c head/sys/contrib/dev/acpica/components/executer/exoparg6.c head/sys/contrib/dev/acpica/components/executer/exprep.c head/sys/contrib/dev/acpica/components/executer/exregion.c head/sys/contrib/dev/acpica/components/executer/exresnte.c head/sys/contrib/dev/acpica/components/executer/exresolv.c head/sys/contrib/dev/acpica/components/executer/exresop.c head/sys/contrib/dev/acpica/components/executer/exstore.c head/sys/contrib/dev/acpica/components/executer/exstoren.c head/sys/contrib/dev/acpica/components/executer/exstorob.c head/sys/contrib/dev/acpica/components/executer/exsystem.c head/sys/contrib/dev/acpica/components/executer/exutils.c head/sys/contrib/dev/acpica/components/hardware/hwacpi.c head/sys/contrib/dev/acpica/components/hardware/hwesleep.c head/sys/contrib/dev/acpica/components/hardware/hwgpe.c head/sys/contrib/dev/acpica/components/hardware/hwpci.c head/sys/contrib/dev/acpica/components/hardware/hwregs.c head/sys/contrib/dev/acpica/components/hardware/hwsleep.c head/sys/contrib/dev/acpica/components/hardware/hwtimer.c head/sys/contrib/dev/acpica/components/hardware/hwvalid.c head/sys/contrib/dev/acpica/components/hardware/hwxface.c head/sys/contrib/dev/acpica/components/hardware/hwxfsleep.c head/sys/contrib/dev/acpica/components/namespace/nsaccess.c head/sys/contrib/dev/acpica/components/namespace/nsalloc.c head/sys/contrib/dev/acpica/components/namespace/nsarguments.c head/sys/contrib/dev/acpica/components/namespace/nsconvert.c head/sys/contrib/dev/acpica/components/namespace/nsdump.c head/sys/contrib/dev/acpica/components/namespace/nsdumpdv.c head/sys/contrib/dev/acpica/components/namespace/nseval.c head/sys/contrib/dev/acpica/components/namespace/nsinit.c head/sys/contrib/dev/acpica/components/namespace/nsload.c head/sys/contrib/dev/acpica/components/namespace/nsnames.c head/sys/contrib/dev/acpica/components/namespace/nsobject.c head/sys/contrib/dev/acpica/components/namespace/nsparse.c head/sys/contrib/dev/acpica/components/namespace/nspredef.c head/sys/contrib/dev/acpica/components/namespace/nsprepkg.c head/sys/contrib/dev/acpica/components/namespace/nsrepair.c head/sys/contrib/dev/acpica/components/namespace/nsrepair2.c head/sys/contrib/dev/acpica/components/namespace/nssearch.c head/sys/contrib/dev/acpica/components/namespace/nsutils.c head/sys/contrib/dev/acpica/components/namespace/nswalk.c head/sys/contrib/dev/acpica/components/namespace/nsxfeval.c head/sys/contrib/dev/acpica/components/namespace/nsxfname.c head/sys/contrib/dev/acpica/components/namespace/nsxfobj.c head/sys/contrib/dev/acpica/components/parser/psargs.c head/sys/contrib/dev/acpica/components/parser/psloop.c head/sys/contrib/dev/acpica/components/parser/psobject.c head/sys/contrib/dev/acpica/components/parser/psopcode.c head/sys/contrib/dev/acpica/components/parser/psopinfo.c head/sys/contrib/dev/acpica/components/parser/psparse.c head/sys/contrib/dev/acpica/components/parser/psscope.c head/sys/contrib/dev/acpica/components/parser/pstree.c head/sys/contrib/dev/acpica/components/parser/psutils.c head/sys/contrib/dev/acpica/components/parser/pswalk.c head/sys/contrib/dev/acpica/components/parser/psxface.c head/sys/contrib/dev/acpica/components/resources/rsaddr.c head/sys/contrib/dev/acpica/components/resources/rscalc.c head/sys/contrib/dev/acpica/components/resources/rscreate.c head/sys/contrib/dev/acpica/components/resources/rsdump.c head/sys/contrib/dev/acpica/components/resources/rsdumpinfo.c head/sys/contrib/dev/acpica/components/resources/rsinfo.c head/sys/contrib/dev/acpica/components/resources/rsio.c head/sys/contrib/dev/acpica/components/resources/rsirq.c head/sys/contrib/dev/acpica/components/resources/rslist.c head/sys/contrib/dev/acpica/components/resources/rsmemory.c head/sys/contrib/dev/acpica/components/resources/rsmisc.c head/sys/contrib/dev/acpica/components/resources/rsserial.c head/sys/contrib/dev/acpica/components/resources/rsutils.c head/sys/contrib/dev/acpica/components/resources/rsxface.c head/sys/contrib/dev/acpica/components/tables/tbdata.c head/sys/contrib/dev/acpica/components/tables/tbfadt.c head/sys/contrib/dev/acpica/components/tables/tbfind.c head/sys/contrib/dev/acpica/components/tables/tbinstal.c head/sys/contrib/dev/acpica/components/tables/tbprint.c head/sys/contrib/dev/acpica/components/tables/tbutils.c head/sys/contrib/dev/acpica/components/tables/tbxface.c head/sys/contrib/dev/acpica/components/tables/tbxfload.c head/sys/contrib/dev/acpica/components/tables/tbxfroot.c head/sys/contrib/dev/acpica/components/utilities/utaddress.c head/sys/contrib/dev/acpica/components/utilities/utalloc.c head/sys/contrib/dev/acpica/components/utilities/utbuffer.c head/sys/contrib/dev/acpica/components/utilities/utcache.c head/sys/contrib/dev/acpica/components/utilities/utcopy.c head/sys/contrib/dev/acpica/components/utilities/utdebug.c head/sys/contrib/dev/acpica/components/utilities/utdecode.c head/sys/contrib/dev/acpica/components/utilities/utdelete.c head/sys/contrib/dev/acpica/components/utilities/uterror.c head/sys/contrib/dev/acpica/components/utilities/uteval.c head/sys/contrib/dev/acpica/components/utilities/utexcep.c head/sys/contrib/dev/acpica/components/utilities/utglobal.c head/sys/contrib/dev/acpica/components/utilities/uthex.c head/sys/contrib/dev/acpica/components/utilities/utids.c head/sys/contrib/dev/acpica/components/utilities/utinit.c head/sys/contrib/dev/acpica/components/utilities/utlock.c head/sys/contrib/dev/acpica/components/utilities/utmath.c head/sys/contrib/dev/acpica/components/utilities/utmisc.c head/sys/contrib/dev/acpica/components/utilities/utmutex.c head/sys/contrib/dev/acpica/components/utilities/utnonansi.c head/sys/contrib/dev/acpica/components/utilities/utobject.c head/sys/contrib/dev/acpica/components/utilities/utosi.c head/sys/contrib/dev/acpica/components/utilities/utownerid.c head/sys/contrib/dev/acpica/components/utilities/utpredef.c head/sys/contrib/dev/acpica/components/utilities/utprint.c head/sys/contrib/dev/acpica/components/utilities/utresrc.c head/sys/contrib/dev/acpica/components/utilities/utstate.c head/sys/contrib/dev/acpica/components/utilities/utstring.c head/sys/contrib/dev/acpica/components/utilities/uttrack.c head/sys/contrib/dev/acpica/components/utilities/utuuid.c head/sys/contrib/dev/acpica/components/utilities/utxface.c head/sys/contrib/dev/acpica/components/utilities/utxferror.c head/sys/contrib/dev/acpica/components/utilities/utxfinit.c head/sys/contrib/dev/acpica/components/utilities/utxfmutex.c head/sys/contrib/dev/acpica/include/acapps.h head/sys/contrib/dev/acpica/include/acbuffer.h head/sys/contrib/dev/acpica/include/acclib.h head/sys/contrib/dev/acpica/include/accommon.h head/sys/contrib/dev/acpica/include/acconfig.h head/sys/contrib/dev/acpica/include/acdebug.h head/sys/contrib/dev/acpica/include/acdisasm.h head/sys/contrib/dev/acpica/include/acdispat.h head/sys/contrib/dev/acpica/include/acevents.h head/sys/contrib/dev/acpica/include/acexcep.h head/sys/contrib/dev/acpica/include/acglobal.h head/sys/contrib/dev/acpica/include/achware.h head/sys/contrib/dev/acpica/include/acinterp.h head/sys/contrib/dev/acpica/include/aclocal.h head/sys/contrib/dev/acpica/include/acmacros.h head/sys/contrib/dev/acpica/include/acnames.h head/sys/contrib/dev/acpica/include/acnamesp.h head/sys/contrib/dev/acpica/include/acobject.h head/sys/contrib/dev/acpica/include/acopcode.h head/sys/contrib/dev/acpica/include/acoutput.h head/sys/contrib/dev/acpica/include/acparser.h head/sys/contrib/dev/acpica/include/acpi.h head/sys/contrib/dev/acpica/include/acpiosxf.h head/sys/contrib/dev/acpica/include/acpixf.h head/sys/contrib/dev/acpica/include/acpredef.h head/sys/contrib/dev/acpica/include/acresrc.h head/sys/contrib/dev/acpica/include/acrestyp.h head/sys/contrib/dev/acpica/include/acstruct.h head/sys/contrib/dev/acpica/include/actables.h head/sys/contrib/dev/acpica/include/actbl.h head/sys/contrib/dev/acpica/include/actbl1.h head/sys/contrib/dev/acpica/include/actbl2.h head/sys/contrib/dev/acpica/include/actbl3.h head/sys/contrib/dev/acpica/include/actypes.h head/sys/contrib/dev/acpica/include/acutils.h head/sys/contrib/dev/acpica/include/acuuid.h head/sys/contrib/dev/acpica/include/amlcode.h head/sys/contrib/dev/acpica/include/amlresrc.h head/sys/contrib/dev/acpica/include/platform/acenv.h head/sys/contrib/dev/acpica/include/platform/acenvex.h head/sys/contrib/dev/acpica/include/platform/acfreebsd.h head/sys/contrib/dev/acpica/include/platform/acgcc.h head/sys/contrib/dev/acpica/os_specific/service_layers/oslibcfs.c head/sys/contrib/dev/acpica/os_specific/service_layers/osunixxf.c head/sys/dev/acpica/Osd/OsdSchedule.c head/sys/sys/libkern.h head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/acpi/acpidb/acpidb.c head/usr.sbin/acpi/iasl/Makefile Directory Properties: head/sys/contrib/dev/acpica/ (props changed) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Apr 27 18:58:47 2016 (r298713) +++ head/sys/conf/files Wed Apr 27 19:09:21 2016 (r298714) @@ -288,7 +288,6 @@ contrib/dev/acpica/components/debugger/d contrib/dev/acpica/components/debugger/dbconvert.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbdisply.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbexec.c optional acpi acpi_debug -contrib/dev/acpica/components/debugger/dbfileio.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbhistry.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbinput.c optional acpi acpi_debug contrib/dev/acpica/components/debugger/dbmethod.c optional acpi acpi_debug @@ -339,6 +338,7 @@ contrib/dev/acpica/components/events/evx contrib/dev/acpica/components/events/evxfevnt.c optional acpi contrib/dev/acpica/components/events/evxfgpe.c optional acpi contrib/dev/acpica/components/events/evxfregn.c optional acpi +contrib/dev/acpica/components/executer/exconcat.c optional acpi contrib/dev/acpica/components/executer/exconfig.c optional acpi contrib/dev/acpica/components/executer/exconvrt.c optional acpi contrib/dev/acpica/components/executer/excreate.c optional acpi @@ -362,6 +362,7 @@ contrib/dev/acpica/components/executer/e contrib/dev/acpica/components/executer/exstoren.c optional acpi contrib/dev/acpica/components/executer/exstorob.c optional acpi contrib/dev/acpica/components/executer/exsystem.c optional acpi +contrib/dev/acpica/components/executer/extrace.c optional acpi contrib/dev/acpica/components/executer/exutils.c optional acpi contrib/dev/acpica/components/hardware/hwacpi.c optional acpi contrib/dev/acpica/components/hardware/hwesleep.c optional acpi @@ -430,6 +431,7 @@ contrib/dev/acpica/components/tables/tbx contrib/dev/acpica/components/tables/tbxfroot.c optional acpi contrib/dev/acpica/components/utilities/utaddress.c optional acpi contrib/dev/acpica/components/utilities/utalloc.c optional acpi +contrib/dev/acpica/components/utilities/utascii.c optional acpi contrib/dev/acpica/components/utilities/utbuffer.c optional acpi contrib/dev/acpica/components/utilities/utcache.c optional acpi contrib/dev/acpica/components/utilities/utcopy.c optional acpi @@ -3412,6 +3414,7 @@ libkern/strndup.c standard libkern/strlcat.c standard libkern/strlcpy.c standard libkern/strlen.c standard +libkern/strncat.c standard libkern/strncmp.c standard libkern/strncpy.c standard libkern/strnlen.c standard Modified: head/sys/contrib/dev/acpica/acpica_prep.sh ============================================================================== --- head/sys/contrib/dev/acpica/acpica_prep.sh Wed Apr 27 18:58:47 2016 (r298713) +++ head/sys/contrib/dev/acpica/acpica_prep.sh Wed Apr 27 19:09:21 2016 (r298714) @@ -20,8 +20,8 @@ fulldirs="common compiler components inc stripdirs="generate libraries tests tools" stripfiles="Makefile README accygwin.h acdragonfly.h acdragonflyex.h \ acefi.h acefiex.h achaiku.h acintel.h aclinux.h aclinuxex.h \ - acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acwin.h \ - acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \ + acmacosx.h acmsvc.h acmsvcex.h acnetbsd.h acos2.h acqnx.h \ + acwin.h acwin64.h acwinex.h new_table.txt osbsdtbl.c osefitbl.c \ osefixf.c osfreebsdtbl.c oslinuxtbl.c osunixdir.c osunixmap.c \ oswindir.c oswintbl.c oswinxf.c readme.txt utclib.c" Modified: head/sys/contrib/dev/acpica/changes.txt ============================================================================== --- head/sys/contrib/dev/acpica/changes.txt Wed Apr 27 18:58:47 2016 (r298713) +++ head/sys/contrib/dev/acpica/changes.txt Wed Apr 27 19:09:21 2016 (r298714) @@ -1,7 +1,604 @@ ---------------------------------------- -18 August 2015. Summary of changes for version 20150818: +22 April 2016. Summary of changes for version 20160422: -This release is available at https://acpica.org/downloads +1) ACPICA kernel-resident subsystem: + +Fixed a regression in the GAS (generic address structure) arbitrary bit +support in AcpiHwRead/AcpiHwWrite. Problem could cause incorrect behavior +and incorrect return values. Lv Zheng. ACPICA BZ 1270. + +ACPI 6.0: Added support for new/renamed resource macros. One new argument +was added to each of these macros, and the original name has been +deprecated. The AML disassembler will always disassemble to the new +names. Support for the new macros was added to iASL, disassembler, +resource manager, and the acpihelp utility. ACPICA BZ 1274. + + I2cSerialBus -> I2cSerialBusV2 + SpiSerialBus -> SpiSerialBusV2 + UartSerialBus -> UartSerialBusV2 + +ACPI 6.0: Added support for a new integer field that was appended to the +package object returned by the _BIX method. This adds iASL compile-time +and AML runtime error checking. ACPICA BZ 1273. + +ACPI 6.1: Added support for a new PCCT subtable, "HW-Reduced Comm +Subspace Type2" (Headers, Disassembler, and data table compiler). + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 137.4K Code, 52.6K Data, 190.0K Total + Debug Version: 201.5K Code, 82.2K Data, 283.7K Total + Previous Release: + Non-Debug Version: 137.1K Code, 51.5K Data, 188.6K Total + Debug Version: 201.0K Code, 82.0K Data, 283.0K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented an ASL grammar extension to allow/enable executable +"module-level code" to be created and executed under the various +operators that create new scopes. This type of AML code is already +supported in all known AML interpreters, and the grammar change will +appear in the next version of the ACPI specification. Simplifies the +conditional runtime creation of named objects under these object types: + + Device + PowerResource + Processor + Scope + ThermalZone + +iASL: Implemented a new ASL extension, a "For" loop macro to add greater +ease-of-use to the ASL language. The syntax is similar to the +corresponding C operator, and is implemented with the existing AML While +opcode -- thus requiring no changes to existing AML interpreters. + + For (Initialize, Predicate, Update) {TermList} + +Grammar: + ForTerm := + For ( + Initializer // Nothing | TermArg => ComputationalData + Predicate // Nothing | TermArg => ComputationalData + Update // Nothing | TermArg => ComputationalData + ) {TermList} + + +iASL: The _HID/_ADR detection and validation has been enhanced to search +under conditionals in order to allow these objects to be conditionally +created at runtime. + +iASL: Fixed several issues with the constant folding feature. The +improvement allows better detection and resolution of statements that can +be folded at compile time. ACPICA BZ 1266. + +iASL/Disassembler: Fixed a couple issues with the Else{If{}...} +conversion to the ASL ElseIf operator where incorrect ASL code could be +generated. + +iASL/Disassembler: Fixed a problem with the ASL+ code disassembly where +sometimes an extra (and extraneous) set of parentheses were emitted for +some combinations of operators. Although this did not cause any problems +with recompilation of the disassembled code, it made the code more +difficult to read. David Box. ACPICA BZ 1231. + +iASL: Changed to ignore the unreferenced detection for predefined names +of resource descriptor elements, when the resource descriptor is +created/defined within a control method. + +iASL: Disassembler: Fix a possible fault with externally declared Buffer +objects. + +---------------------------------------- +18 March 2016. Summary of changes for version 20160318: + +1) ACPICA kernel-resident subsystem: + +Added support for arbitrary bit lengths and bit offsets for registers +defined by the Generic Address Structure. Previously, only aligned bit +lengths of 8/16/32/64 were supported. This was sufficient for many years, +but recently some machines have been seen that require arbitrary bit- +level support. ACPICA BZ 1240. Lv Zheng. + +Fixed an issue where the \_SB._INI method sometimes must be evaluated +before any _REG methods are evaluated. Lv Zheng. + +Implemented several changes related to ACPI table support +(Headers/Disassembler/TableCompiler): +NFIT: For ACPI 6.1, updated to add some additional new fields and +constants. +FADT: Updated a warning message and set compliance to ACPI 6.1 (Version +6). +DMAR: Added new constants per the 10/2014 DMAR spec. +IORT: Added new subtable per the 10/2015 IORT spec. +HEST: For ACPI 6.1, added new constants and new subtable. +DBG2: Added new constants per the 12/2015 DBG2 spec. +FPDT: Fixed several incorrect fields, add the FPDT boot record structure. +ACPICA BZ 1249. +ERST/EINJ: Updated disassembler with new "Execute Timings" actions. + +Updated header support for the DMAR table to match the current version of +the related spec. + +Added extensions to the ASL Concatenate operator to allow any ACPI object +to be passed as an operand. Any object other than Integer/String/Buffer +simply returns a string containing the object type. This extends the +usefulness of the Printf macros. Previously, Concatenate would abort the +control method if a non-data object was encountered. + +ACPICA source code: Deployed the C "const" keyword across the source code +where appropriate. ACPICA BZ 732. Joerg Sonnenberger (NetBSD). + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 137.1K Code, 51.5K Data, 188.6K Total + Debug Version: 201.0K Code, 82.0K Data, 283.0K Total + Previous Release: + Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total + Debug Version: 200.4K Code, 82.0K Data, 282.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL/Disassembler: Improved the heuristic used to determine the number of +arguments for an externally defined control method (a method in another +table). Although this is an improvement, there is no deterministic way to +"guess" the number of method arguments. Only the ACPI 6.0 External opcode +will completely solve this problem as it is deployed (automatically) in +newer BIOS code. + +iASL/Disassembler: Fixed an ordering issue for emitted External() ASL +statements that could cause errors when the disassembled file is +compiled. ACPICA BZ 1243. David Box. + +iASL: Fixed a regression caused by the merger of the two versions of the +local strtoul64. Because of a dependency on a global variable, strtoul64 +could return an error for integers greater than a 32-bit value. ACPICA BZ +1260. + +iASL: Fixed a regression where a fault could occur for an ASL Return +statement if it invokes a control method that is not resolved. ACPICA BZ +1264. + +AcpiXtract: Improved input file validation: detection of binary files and +non-acpidump text files. + +---------------------------------------- +12 February 2016. Summary of changes for version 20160212: + +1) ACPICA kernel-resident subsystem: + +Implemented full support for the ACPI 6.1 specification (released in +January). This version of the specification is available at: +http://www.uefi.org/specifications + +Only a relatively small number of changes were required in ACPICA to +support ACPI 6.1, in these areas: +- New predefined names +- New _HID values +- A new subtable for HEST +- A few other header changes for new values + +Ensure \_SB_._INI is executed before any _REG methods are executed. There +appears to be existing BIOS code that relies on this behavior. Lv Zheng. + +Reverted a change made in version 20151218 which enabled method +invocations to be targets of various ASL operators (SuperName and Target +grammar elements). While the new behavior is supported by the ACPI +specification, other AML interpreters do not support this behavior and +never will. The ACPI specification will be updated for ACPI 6.2 to remove +this support. Therefore, the change was reverted to the original ACPICA +behavior. + +ACPICA now supports the GCC 6 compiler. + +Current Release: (Note: build changes increased sizes) + Non-Debug Version: 136.2K Code, 51.5K Data, 187.7K Total + Debug Version: 200.4K Code, 82.0K Data, 282.4K Total +Previous Release: + Non-Debug Version: 102.7K Code, 28.4K Data, 131.1K Total + Debug Version: 200.4K Code, 81.9K Data, 282.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Completed full support for the ACPI 6.0 External() AML opcode. The +compiler emits an external AML opcode for each ASL External statement. +This opcode is used by the disassembler to assist with the disassembly of +external control methods by specifying the required number of arguments +for the method. AML interpreters do not use this opcode. To ensure that +interpreters do not even see the opcode, a block of one or more external +opcodes is surrounded by an "If(0)" construct. As this feature becomes +commonly deployed in BIOS code, the ability of disassemblers to correctly +disassemble AML code will be greatly improved. David Box. + +iASL: Implemented support for an optional cross-reference output file. +The -lx option will create a the cross-reference file with the suffix +"xrf". Three different types of cross-reference are created in this file: +- List of object references made from within each control method +- Invocation (caller) list for each user-defined control method +- List of references to each non-method object in the namespace + +iASL: Method invocations as ASL Target operands are now disallowed and +flagged as errors in preparation for ACPI 6.2 (see the description of the +problem above). + +---------------------------------------- +8 January 2016. Summary of changes for version 20160108: + +1) ACPICA kernel-resident subsystem: + +Updated all ACPICA copyrights and signons to 2016: Added the 2016 +copyright to all source code module headers and utility/tool signons. +This includes the standard Linux dual-license header. This affects +virtually every file in the ACPICA core subsystem, iASL compiler, all +ACPICA utilities, and the ACPICA test suite. + +Fixed a regression introduced in version 20151218 concerning the +execution of so-called module-level ASL/AML code. Namespace objects +created under a module-level If() construct were not properly/fully +entered into the namespace and could cause an interpreter fault when +accessed. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + +Current Release: + Non-Debug Version: 102.7K Code, 28.4K Data, 131.1K Total + Debug Version: 200.4K Code, 81.9K Data, 282.4K Total + Previous Release: + Non-Debug Version: 102.6K Code, 28.4K Data, 131.0K Total + Debug Version: 200.3K Code, 81.9K Data, 282.3K Total + + +2) iASL Compiler/Disassembler and Tools: + +Fixed a problem with the compilation of the GpioIo and GpioInt resource +descriptors. The _PIN field name was incorrectly defined to be an array +of 32-bit values, but the _PIN values are in fact 16 bits each. This +would cause incorrect bit width warnings when using Word (16-bit) fields +to access the descriptors. + + +---------------------------------------- +18 December 2015. Summary of changes for version 20151218: + +1) ACPICA kernel-resident subsystem: + +Implemented per-AML-table execution of "module-level code" as individual +ACPI tables are loaded into the namespace during ACPICA initialization. +In other words, any module-level code within an AML table is executed +immediately after the table is loaded, instead of batched and executed +after all of the tables have been loaded. This provides compatibility +with other ACPI implementations. ACPICA BZ 1219. Bob Moore, Lv Zheng, +David Box. + +To fully support the feature above, the default operation region handlers +for the SystemMemory, SystemIO, and PCI_Config address spaces are now +installed before any ACPI tables are loaded. This enables module-level +code to access these address spaces during the table load and module- +level code execution phase. ACPICA BZ 1220. Bob Moore, Lv Zheng, David +Box. + +Implemented several changes to the internal _REG support in conjunction +with the changes above. Also, changes to the AcpiExec/AcpiNames/Examples +utilities for the changes above. Although these tools were changed, host +operating systems that simply use the default handlers for SystemMemory, +SystemIO, and PCI_Config spaces should not require any update. Lv Zheng. + +For example, in the code below, DEV1 is conditionally added to the +namespace by the DSDT via module-level code that accesses an operation +region. The SSDT references DEV1 via the Scope operator. DEV1 must be +created immediately after the DSDT is loaded in order for the SSDT to +successfully reference DEV1. Previously, this code would cause an +AE_NOT_EXIST exception during the load of the SSDT. Now, this code is +fully supported by ACPICA. + + DefinitionBlock ("", "DSDT", 2, "Intel", "DSDT1", 1) + { + OperationRegion (OPR1, SystemMemory, 0x400, 32) + Field (OPR1, AnyAcc, NoLock, Preserve) + { + FLD1, 1 + } + If (FLD1) + { + Device (\DEV1) + { + } + } + } + DefinitionBlock ("", "SSDT", 2, "Intel", "SSDT1", 1) + { + External (\DEV1, DeviceObj) + Scope (\DEV1) + { + } + } + +Fixed an AML interpreter problem where control method invocations were +not handled correctly when the invocation was itself a SuperName argument +to another ASL operator. In these cases, the method was not invoked. +ACPICA BZ 1002. Affects the following ASL operators that have a SuperName +argument: + Store + Acquire, Wait + CondRefOf, RefOf + Decrement, Increment + Load, Unload + Notify + Signal, Release, Reset + SizeOf + +Implemented automatic String-to-ObjectReference conversion support for +packages returned by predefined names (such as _DEP). A common BIOS error +is to add double quotes around an ObjectReference namepath, which turns +the reference into an unexpected string object. This support detects the +problem and corrects it before the package is returned to the caller that +invoked the method. Lv Zheng. + +Implemented extensions to the Concatenate operator. Concatenate now +accepts any type of object, it is not restricted to simply +Integer/String/Buffer. For objects other than these 3 basic data types, +the argument is treated as a string containing the name of the object +type. This expands the utility of Concatenate and the Printf/Fprintf +macros. ACPICA BZ 1222. + +Cleaned up the output of the ASL Debug object. The timer() value is now +optional and no longer emitted by default. Also, the basic data types of +Integer/String/Buffer are simply emitted as their values, without a data +type string -- since the data type is obvious from the output. ACPICA BZ +1221. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 102.6K Code, 28.4K Data, 131.0K Total + Debug Version: 200.3K Code, 81.9K Data, 282.3K Total + Previous Release: + Non-Debug Version: 102.0K Code, 28.3K Data, 130.3K Total + Debug Version: 199.6K Code, 81.8K Data, 281.4K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Fixed some issues with the ASL Include() operator. This operator +was incorrectly defined in the iASL parser rules, causing a new scope to +be opened for the code within the include file. This could lead to +several issues, including allowing ASL code that is technically illegal +and not supported by AML interpreters. Note, this does not affect the +related #include preprocessor operator. ACPICA BZ 1212. + +iASL/Disassembler: Implemented support for the ASL ElseIf operator. This +operator is essentially an ASL macro since there is no AML opcode +associated with it. The code emitted by the iASL compiler for ElseIf is +an Else opcode followed immediately by an If opcode. The disassembler +will now emit an ElseIf if it finds an Else immediately followed by an +If. This simplifies the decoded ASL, especially for deeply nested +If..Else and large Switch constructs. Thus, the disassembled code more +closely follows the original source ASL. ACPICA BZ 1211. Example: + + Old disassembly: + Else + { + If (Arg0 == 0x02) + { + Local0 = 0x05 + } + } + + New disassembly: + ElseIf (Arg0 == 0x02) + { + Local0 = 0x05 + } + +AcpiExec: Added support for the new module level code behavior and the +early region installation. This required a small change to the +initialization, since AcpiExec must install its own operation region +handlers. + +AcpiExec: Added support to make the debug object timer optional. Default +is timer disabled. This cleans up the debug object output -- the timer +data is rarely used. + +AcpiExec: Multiple ACPI tables are now loaded in the order that they +appear on the command line. This can be important when there are +interdependencies/references between the tables. + +iASL/Templates. Add support to generate template files with multiple +SSDTs within a single output file. Also added ommand line support to +specify the number of SSDTs (in addition to a single DSDT). ACPICA BZ +1223, 1225. + + +---------------------------------------- +24 November 2015. Summary of changes for version 20151124: + +1) ACPICA kernel-resident subsystem: + +Fixed a possible regression for a previous update to FADT handling. The +FADT no longer has a fixed table ID, causing some issues with code that +was hardwired to a specific ID. Lv Zheng. + +Fixed a problem where the method auto-serialization could interfere with +the current SyncLevel. This change makes the auto-serialization support +transparent to the SyncLevel support and management. + +Removed support for the _SUB predefined name in AcpiGetObjectInfo. This +interface is intended for early access to the namespace during the +initial namespace device discovery walk. The _SUB method has been seen to +access operation regions in some cases, causing errors because the +operation regions are not fully initialized. + +AML Debugger: Fixed some issues with the terminate/quit/exit commands +that can cause faults. Lv Zheng. + +AML Debugger: Add thread ID support so that single-step mode only applies +to the AML Debugger thread. This prevents runtime errors within some +kernels. Lv Zheng. + +Eliminated extraneous warnings from AcpiGetSleepTypeData. Since the _Sx +methods that are invoked by this interface are optional, removed warnings +emitted for the case where one or more of these methods do not exist. +ACPICA BZ 1208, original change by Prarit Bhargava. + +Made a major pass through the entire ACPICA source code base to +standardize formatting that has diverged a bit over time. There are no +functional changes, but this will of course cause quite a few code +differences from the previous ACPICA release. + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 102.0K Code, 28.3K Data, 130.3K Total + Debug Version: 199.6K Code, 81.8K Data, 281.4K Total + Previous Release: + Non-Debug Version: 101.7K Code, 27.9K Data, 129.6K Total + Debug Version: 199.3K Code, 81.4K Data, 280.7K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL/acpiexec/acpixtract/disassembler: Added support to allow multiple +definition blocks within a single ASL file and the resulting AML file. +Support for this type of file was also added to the various tools that +use binary AML files: acpiexec, acpixtract, and the AML disassembler. The +example code below shows two definition blocks within the same file: + + DefinitionBlock ("dsdt.aml", "DSDT", 2, "Intel", "Template", +0x12345678) + { + } + DefinitionBlock ("", "SSDT", 2, "Intel", "Template", 0xABCDEF01) + { + } + +iASL: Enhanced typechecking for the Name() operator. All expressions for +the value of the named object must be reduced/folded to a single constant +at compile time, as per the ACPI specification (the AML definition of +Name()). + +iASL: Fixed some code indentation issues for the -ic and -ia options (C +and assembly headers). Now all emitted code correctly begins in column 1. + +iASL: Added an error message for an attempt to open a Scope() on an +object defined in an SSDT. The DSDT is always loaded into the namespace +first, so any attempt to open a Scope on an SSDT object will fail at +runtime. + + +---------------------------------------- +30 September 2015. Summary of changes for version 20150930: + +1) ACPICA kernel-resident subsystem: + +Debugger: Implemented several changes and bug fixes to assist support for +the in-kernel version of the AML debugger. Lv Zheng. +- Fix the "predefined" command for in-kernel debugger. +- Do not enter debug command loop for the help and version commands. +- Disallow "execute" command during execution/single-step of a method. + +Interpreter: Updated runtime typechecking for all operators that have +target operands. The operand is resolved and validated that it is legal. +For example, the target cannot be a non-data object such as a Device, +Mutex, ThermalZone, etc., as per the ACPI specification. + +Debugger: Fixed the double-mutex user I/O handshake to work when local +deadlock detection is enabled. + +Debugger: limited display of method locals and arguments (LocalX and +ArgX) to only those that have actually been initialized. This prevents +lines of extraneous output. + +Updated the definition of the NFIT table to correct the bit polarity of +one flag: ACPI_NFIT_MEM_ARMED --> ACPI_NFIT_MEM_NOT_ARMED + +Example Code and Data Size: These are the sizes for the OS-independent +acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The +debug version of the code includes the debug output trace mechanism and +has a much larger code and data size. + + Current Release: + Non-Debug Version: 101.7K Code, 27.9K Data, 129.6K Total + Debug Version: 199.3K Code, 81.4K Data, 280.7K Total + Previous Release: + Non-Debug Version: 101.3K Code, 27.7K Data, 129.0K Total + Debug Version: 198.6K Code, 80.9K Data, 279.5K Total + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Improved the compile-time typechecking for operands of many of the +ASL operators: + +-- Added an option to disable compiler operand/operator typechecking (- +ot). + +-- For the following operators, the TermArg operands are now validated +when possible to be Integer data objects: BankField, OperationRegion, +DataTableRegion, Buffer, and Package. + +-- Store (Source, Target): Both the source and target operands are +resolved and checked that the operands are both legal. For example, +neither operand can be a non-data object such as a Device, Mutex, +ThermalZone, etc. Note, as per the ACPI specification, the CopyObject +operator can be used to store an object to any type of target object. + +-- Store (Source, Target): If the source is a Package object, the target +must be a Package object, LocalX, ArgX, or Debug. Likewise, if the target +is a Package, the source must also be a Package. + +-- Store (Source, Target): A warning is issued if the source and target +resolve to the identical named object. + +-- Store (Source, ): An error is generated for the +target method invocation, as this construct is not supported by the AML +interpreter. + +-- For all ASL math and logic operators, the target operand must be a +data object (Integer, String, Buffer, LocalX, ArgX, or Debug). This +includes the function return value also. + +-- External declarations are also included in the typechecking where +possible. External objects defined using the UnknownObj keyword cannot be +typechecked, however. + +iASL and Disassembler: Added symbolic (ASL+) support for the ASL Index +operator: +- Legacy code: Index(PKG1, 3) +- New ASL+ code: PKG1[3] +This completes the ACPI 6.0 ASL+ support as it was the only operator not +supported. + +iASL: Fixed the file suffix for the preprocessor output file (.i). Two +spaces were inadvertently appended to the filename, causing file access +and deletion problems on some systems. + +ASL Test Suite (ASLTS): Updated the master makefile to generate all +possible compiler output files when building the test suite -- thus +exercising these features of the compiler. These files are automatically +deleted when the test suite exits. + + +---------------------------------------- +18 August 2015. Summary of changes for version 20150818: 1) ACPICA kernel-resident subsystem: @@ -84,6 +681,7 @@ the command is entered with no arguments AcpiNames: Add -x option to specify debug level, similar to AcpiExec. + ---------------------------------------- 17 July 2015. Summary of changes for version 20150717: @@ -340,6 +938,7 @@ directives. AcpiHelp: Added a new option, -t, to display all known/supported ACPI tables. + ---------------------------------------- 10 April 2015. Summary of changes for version 20150410: @@ -347,6 +946,7 @@ Reverted a change introduced in version a regression in the disassembler where incorrect operator symbols could be emitted. + ---------------------------------------- 08 April 2015. Summary of changes for version 20150408: @@ -419,6 +1019,7 @@ Debugger: Removed some unused global var Tests: Updated the makefile for proper generation of the AAPITS suite. + ---------------------------------------- 04 February 2015. Summary of changes for version 20150204: @@ -459,7 +1060,8 @@ David Box Non-Debug Version: 101.7K Code, 27.9K Data, 129.6K Total Debug Version: 199.2K Code, 82.4K Data, 281.6K Total ----------------------------------------- +-- +-------------------------------------- 07 November 2014. Summary of changes for version 20141107: This release is available at https://acpica.org/downloads @@ -963,6 +1565,7 @@ Disassembler: Cleaned up a block of code object. Added a comment that explains that the parent is guaranteed to be valid in this case. ACPICA BZ 1069. + ---------------------------------------- 24 April 2014. Summary of changes for version 20140424: @@ -1030,6 +1633,7 @@ checking and take care not to reset term were never set. This should help guarantee that the terminal is always left in the previous state on program exit. + ---------------------------------------- 25 March 2014. Summary of changes for version 20140325: @@ -1130,6 +1734,7 @@ AcpiBin utility: is made obsolete by the AcpiXtract utility. 2) General cleanup of open files and allocated buffers. + ---------------------------------------- 14 February 2014. Summary of changes for version 20140214: @@ -1195,6 +1800,7 @@ iASL: Removed the obsolete -g option to Windows registry. This feature has been superseded by the acpidump utility. + ---------------------------------------- 14 January 2014. Summary of changes for version 20140114: @@ -1271,6 +1877,7 @@ Debugger: Added the "test predefined" co test public and puts it under the new "test" command. The test executes each and every predefined name within the current namespace. + ---------------------------------------- 18 December 2013. Summary of changes for version 20131218: @@ -1373,6 +1980,7 @@ that it builds to an actual working prog ACPI tables and execution of an example control method in the DSDT. Added makefile support for Unix generation. + ---------------------------------------- 15 November 2013. Summary of changes for version 20131115: Copied and modified: head/sys/contrib/dev/acpica/common/acfileio.c (from r291333, vendor-sys/acpica/dist/source/common/acfileio.c) ============================================================================== --- vendor-sys/acpica/dist/source/common/acfileio.c Wed Nov 25 21:04:42 2015 (r291333, copy source) +++ head/sys/contrib/dev/acpica/common/acfileio.c Wed Apr 27 19:09:21 2016 (r298714) @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,11 +41,11 @@ * POSSIBILITY OF SUCH DAMAGES. */ -#include "acpi.h" -#include "accommon.h" -#include "acapps.h" -#include "actables.h" -#include "acutils.h" +#include +#include +#include +#include +#include #include #define _COMPONENT ACPI_UTILITIES @@ -55,20 +55,20 @@ /* Local prototypes */ static ACPI_STATUS -AcpiAcGetOneTableFromFile ( +AcGetOneTableFromFile ( char *Filename, FILE *File, UINT8 GetOnlyAmlTables, ACPI_TABLE_HEADER **Table); static ACPI_STATUS -AcpiAcCheckTextModeCorruption ( +AcCheckTextModeCorruption ( ACPI_TABLE_HEADER *Table); /******************************************************************************* * - * FUNCTION: AcpiAcGetAllTablesFromFile + * FUNCTION: AcGetAllTablesFromFile * * PARAMETERS: Filename - Table filename * GetOnlyAmlTables - TRUE if the tables must be AML tables @@ -81,7 +81,7 @@ AcpiAcCheckTextModeCorruption ( ******************************************************************************/ ACPI_STATUS -AcpiAcGetAllTablesFromFile ( +AcGetAllTablesFromFile ( char *Filename, UINT8 GetOnlyAmlTables, ACPI_NEW_TABLE_DESC **ReturnListHead) @@ -112,12 +112,30 @@ AcpiAcGetAllTablesFromFile ( FileSize = CmGetFileSize (File); if (FileSize == ACPI_UINT32_MAX) { - return (AE_ERROR); + Status = AE_ERROR; + goto ErrorExit; } - if (FileSize < 4) + fprintf (stderr, + "Input file %s, Length 0x%X (%u) bytes\n", + Filename, FileSize, FileSize); + + /* We must have at least one ACPI table header */ + + if (FileSize < sizeof (ACPI_TABLE_HEADER)) { - return (AE_BAD_HEADER); + Status = AE_BAD_HEADER; + goto ErrorExit; + } + + /* Check for an non-binary file */ + + if (!AcIsFileBinary (File)) + { + fprintf (stderr, + " %s: File does not appear to contain a valid AML table\n", + Filename); + return (AE_TYPE); } /* Read all tables within the file */ @@ -126,8 +144,9 @@ AcpiAcGetAllTablesFromFile ( { /* Get one entire ACPI table */ - Status = AcpiAcGetOneTableFromFile ( + Status = AcGetOneTableFromFile ( Filename, File, GetOnlyAmlTables, &Table); + if (Status == AE_CTRL_TERMINATE) { Status = AE_OK; @@ -135,13 +154,20 @@ AcpiAcGetAllTablesFromFile ( } else if (Status == AE_TYPE) { - continue; + return (AE_OK); } else if (ACPI_FAILURE (Status)) { - return (Status); + goto ErrorExit; } + /* Print table header for iASL/disassembler only */ + +#ifdef ACPI_ASL_COMPILER + + AcpiTbPrintTableHeader (0, Table); +#endif + /* Allocate and link a table descriptor */ TableDesc = AcpiOsAllocate (sizeof (ACPI_NEW_TABLE_DESC)); @@ -179,6 +205,7 @@ AcpiAcGetAllTablesFromFile ( *ReturnListHead = ListHead; } +ErrorExit: fclose(File); return (Status); } @@ -186,7 +213,7 @@ AcpiAcGetAllTablesFromFile ( /******************************************************************************* * - * FUNCTION: AcpiAcGetOneTableFromFile + * FUNCTION: AcGetOneTableFromFile * * PARAMETERS: Filename - File where table is located * File - Open FILE pointer to Filename @@ -204,7 +231,7 @@ AcpiAcGetAllTablesFromFile ( ******************************************************************************/ static ACPI_STATUS -AcpiAcGetOneTableFromFile ( +AcGetOneTableFromFile ( char *Filename, FILE *File, UINT8 GetOnlyAmlTables, @@ -214,21 +241,28 @@ AcpiAcGetOneTableFromFile ( ACPI_TABLE_HEADER TableHeader; ACPI_TABLE_HEADER *Table; INT32 Count; - long Position; + long TableOffset; *ReturnTable = NULL; + /* Get the table header to examine signature and length */ - /* Get just the table header to get signature and length */ - - Position = ftell (File); + TableOffset = ftell (File); Count = fread (&TableHeader, 1, sizeof (ACPI_TABLE_HEADER), File); if (Count != sizeof (ACPI_TABLE_HEADER)) { return (AE_CTRL_TERMINATE); } + /* Validate the table signature/header (limited ASCII chars) */ + + Status = AcValidateTableHeader (File, TableOffset); + if (ACPI_FAILURE (Status)) + { + return (Status); + } + if (GetOnlyAmlTables) { /* Table must be an AML table (DSDT/SSDT) or FADT */ @@ -237,7 +271,7 @@ AcpiAcGetOneTableFromFile ( !AcpiUtIsAmlTable (&TableHeader)) { fprintf (stderr, - " %s: [%4.4s] is not an AML table - ignoring\n", + " %s: Table [%4.4s] is not an AML table - ignoring\n", Filename, TableHeader.Signature); return (AE_TYPE); @@ -252,9 +286,9 @@ AcpiAcGetOneTableFromFile ( return (AE_NO_MEMORY); } - /* Now read the entire table */ + /* Read the entire ACPI table, including header */ - fseek (File, Position, SEEK_SET); + fseek (File, TableOffset, SEEK_SET); Count = fread (Table, 1, TableHeader.Length, File); if (Count != (INT32) TableHeader.Length) @@ -268,18 +302,13 @@ AcpiAcGetOneTableFromFile ( Status = AcpiTbVerifyChecksum (Table, TableHeader.Length); if (ACPI_FAILURE (Status)) { - Status = AcpiAcCheckTextModeCorruption (Table); + Status = AcCheckTextModeCorruption (Table); if (ACPI_FAILURE (Status)) { goto ErrorExit; } } - fprintf (stderr, - "Loading ACPI table [%4.4s] from file %12s - Length 0x%06X (%u)\n", - TableHeader.Signature, Filename, - TableHeader.Length, TableHeader.Length); - *ReturnTable = Table; return (AE_OK); @@ -292,7 +321,159 @@ ErrorExit: /******************************************************************************* * - * FUNCTION: AcpiAcCheckTextModeCorruption + * FUNCTION: AcIsFileBinary + * + * PARAMETERS: File - Open input file + * + * RETURN: TRUE if file appears to be binary + * + * DESCRIPTION: Scan a file for any non-ASCII bytes. + * + * Note: Maintains current file position. + * + ******************************************************************************/ + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Apr 27 19:38:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50948B1FACC; Wed, 27 Apr 2016 19:38:26 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0FA4B1FFD; Wed, 27 Apr 2016 19:38:25 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3RJcP23086209; Wed, 27 Apr 2016 19:38:25 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RJcPI7086208; Wed, 27 Apr 2016 19:38:25 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201604271938.u3RJcPI7086208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 27 Apr 2016 19:38:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298716 - head/sys/modules/acpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 19:38:26 -0000 Author: jkim Date: Wed Apr 27 19:38:24 2016 New Revision: 298716 URL: https://svnweb.freebsd.org/changeset/base/298716 Log: Sort SUBDIR. Modified: head/sys/modules/acpi/Makefile Modified: head/sys/modules/acpi/Makefile ============================================================================== --- head/sys/modules/acpi/Makefile Wed Apr 27 19:12:49 2016 (r298715) +++ head/sys/modules/acpi/Makefile Wed Apr 27 19:38:24 2016 (r298716) @@ -1,7 +1,7 @@ # $FreeBSD$ -SUBDIR= acpi_asus acpi_asus_wmi acpi_fujitsu acpi_hp acpi_ibm \ - acpi_panasonic acpi_sony acpi_toshiba acpi_video \ - acpi_dock acpi_wmi aibs +SUBDIR= acpi_asus acpi_asus_wmi acpi_dock acpi_fujitsu acpi_hp \ + acpi_ibm acpi_panasonic acpi_sony acpi_toshiba \ + acpi_video acpi_wmi aibs .include From owner-svn-src-head@freebsd.org Wed Apr 27 19:43:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C80CB1FBEA; Wed, 27 Apr 2016 19:43:06 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "alchemy.franken.de", Issuer "alchemy.franken.de" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AFBA13C1; Wed, 27 Apr 2016 19:43:05 +0000 (UTC) (envelope-from marius@alchemy.franken.de) Received: from alchemy.franken.de (localhost [127.0.0.1]) by alchemy.franken.de (8.15.2/8.15.2/ALCHEMY.FRANKEN.DE) with ESMTPS id u3RJUZXJ094676 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 27 Apr 2016 21:30:35 +0200 (CEST) (envelope-from marius@alchemy.franken.de) Received: (from marius@localhost) by alchemy.franken.de (8.15.2/8.15.2/Submit) id u3RJUZ59094675; Wed, 27 Apr 2016 21:30:35 +0200 (CEST) (envelope-from marius) Date: Wed, 27 Apr 2016 21:30:35 +0200 From: Marius Strobl To: John Baldwin Cc: src-committers@freebsd.org, svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r298712 - in head/sys: dev/cardbus kern mips/nlm powerpc/ofw sparc64/pci sys Message-ID: <20160427193035.GA93595@alchemy.franken.de> References: <201604271749.u3RHngl6051451@repo.freebsd.org> <2789741.CjRGbn4rPl@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2789741.CjRGbn4rPl@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (alchemy.franken.de [0.0.0.0]); Wed, 27 Apr 2016 21:30:35 +0200 (CEST) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 19:43:06 -0000 On Wed, Apr 27, 2016 at 10:54:42AM -0700, John Baldwin wrote: > On Wednesday, April 27, 2016 05:49:42 PM John Baldwin wrote: > > Author: jhb > > Date: Wed Apr 27 17:49:42 2016 > > New Revision: 298712 > > URL: https://svnweb.freebsd.org/changeset/base/298712 > > > > Log: > > Add a bus_null_rescan() method that always fails with an error. > > > > Use this in place of kobj_error_method to disable BUS_RESCAN() on > > PCI drivers that do not use the "standard" scanning algorithm. > > This should fix the build. > > > Modified: > > head/sys/dev/cardbus/cardbus.c > > head/sys/kern/subr_bus.c > > head/sys/mips/nlm/xlp_pci.c > > head/sys/powerpc/ofw/ofw_pcibus.c > > head/sys/sparc64/pci/ofw_pcibus.c > > head/sys/sys/bus.h > > Note that some of these drivers could be changed to use the "standard" > scanning algorithm and support rescans if they moved some of their custom > scanning logic into a pci_child_added callback. This is generally true of > all but cardbus except that the OFW busses use the OFW tree to drive > scanning (so it seems they will add PCI devices that don't appear valid to > a PCI scan but are in the OFW tree). As for sparc64, the latter isn't true AFAICT, i. e. all PCI devices added based on information obtained from the device tree should also be found with the "standard" scanning method (apart from 2 or 3 known dupes with partially incomplete information in the known device trees; these nodes are skipped, though). Actually, IIRC "standard" PCI device scanning is how things worked before the OFW_NEWPCI code was added in r117119. However, OFW information is used for enumerating PCI busses and devices since then so the order within FreeBSD matches connector/ port markings on chassis and add-on cards (i. e. on-board MACs end up as bge[0-3], an add-on card gets bge4, analogous for multi-port cards, same for HBAs etc.), which previously wasn't the case with "standard" scanning. So what could work for sparc64 is to do a first pass still based on OFW information and then a second one using the "standard" scanning method, especially in the rescan case. However, given that at least some sun4u models support PCI hot-plug it's also not totally unthinkable that OFW nodes for PCI devices will be added/removed on the fly; so far I just wasn't adventurous enough to give that a try, though. Marius From owner-svn-src-head@freebsd.org Wed Apr 27 19:54:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3506EB1FFA2; Wed, 27 Apr 2016 19:54:58 +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 056221E74; Wed, 27 Apr 2016 19:54:57 +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 u3RJsvAA092164; Wed, 27 Apr 2016 19:54:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RJsvmO092163; Wed, 27 Apr 2016 19:54:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604271954.u3RJsvmO092163@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 19:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298717 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 19:54:58 -0000 Author: jhb Date: Wed Apr 27 19:54:56 2016 New Revision: 298717 URL: https://svnweb.freebsd.org/changeset/base/298717 Log: Fix build for systems without PCI_RES_BUS. Submitted by: vangyzen Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Apr 27 19:38:24 2016 (r298716) +++ head/sys/dev/pci/pci.c Wed Apr 27 19:54:56 2016 (r298717) @@ -4150,8 +4150,8 @@ pci_detach(device_t dev) error = bus_generic_detach(dev); if (error) return (error); - sc = device_get_softc(dev); #ifdef PCI_RES_BUS + sc = device_get_softc(dev); error = bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus); if (error) return (error); From owner-svn-src-head@freebsd.org Wed Apr 27 20:24:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39800B1E77C; Wed, 27 Apr 2016 20:24:21 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x233.google.com (mail-lf0-x233.google.com [IPv6:2a00:1450:4010:c07::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5AF5127A; Wed, 27 Apr 2016 20:24:20 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-lf0-x233.google.com with SMTP id u64so62706264lff.3; Wed, 27 Apr 2016 13:24:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=pjveRPyQgnzluIIc/CB2dcLs1VL8tpZ1Y4Eq7hVAqHk=; b=uWsrHVOLU/YiISV3rWLDvdZ79B2x06b/3bfSgkJyaW+i6flijmX7aA+FZXNL1p1kQn xKxsPZLMvI/o78IaI/KQYSp5M6CEwFJbbQJVBw/+CxqL3XPX+3lDIp95x+WcpXRXzb1D APE5/ZlRsXB+DqpU4mZEYVR7p6GVnA2ysDYlT/3zZ+8dVT+VrjNO42RIGRY0pM1hQr1L oJyOyA0Z9Js3UW1P9QySKAoH4lCBW4ASWHUKEoTI0/x6zXlYylLTsGtfsfwOWCzBp2sr FUsnqCM1tQOgFnZkjqPiWWDbcF/sXRMK6q3bhWyoGvzkXSmHt7jyglfJ62iiBb2/Xi6i DFmQ== 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; bh=pjveRPyQgnzluIIc/CB2dcLs1VL8tpZ1Y4Eq7hVAqHk=; b=bv6Sz7e+fRL1NEqTO2rn60/VJ2V8XD1e561vpTE4BzIR9aYoagUBkqW3PzAgZIF7Ns pSRDUhY15rWBbX9rGnGnXem9RYCJ5sEtSoQ0hz956gsRm/I9khaQAEnEcwk6OA8bWBVv R2+jVctSlPl36zf8tgeK2F3VTNhAaNvfolYCDMkdlt/LE5vrJ+kb6ktgkmk8bxxyCHhs ea/VegtaxJCk3lD7XJ0Ba1GBzaYFJkKos/tRJpR0UbUEWbnqQ3RhGx153h14ikPVBLHy oiFMedDIyFZPe8zAs5RvafeNeB9pQ67crQZvxRaizRJUim/mu8inq80swm/P4Ldw1jYK HNzA== X-Gm-Message-State: AOPr4FUvCqmOo+2yR63VdD8h+tP1TaGbzRhMzak1ur3KN+bmOozb90cCSo2UDhTTjm7hcyMjpC8JpBKBdIBZBg== MIME-Version: 1.0 X-Received: by 10.25.78.204 with SMTP id c195mr3734740lfb.21.1461788658949; Wed, 27 Apr 2016 13:24:18 -0700 (PDT) Received: by 10.112.175.8 with HTTP; Wed, 27 Apr 2016 13:24:18 -0700 (PDT) In-Reply-To: <201604271909.u3RJ9Mvf076972@repo.freebsd.org> References: <201604271909.u3RJ9Mvf076972@repo.freebsd.org> Date: Wed, 27 Apr 2016 13:24:18 -0700 Message-ID: Subject: Re: svn commit: r298714 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... From: Ngie Cooper To: Jung-uk Kim Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 20:24:21 -0000 On Wed, Apr 27, 2016 at 12:09 PM, Jung-uk Kim wrote: > Author: jkim > Date: Wed Apr 27 19:09:21 2016 > New Revision: 298714 > URL: https://svnweb.freebsd.org/changeset/base/298714 > > Log: > Merge ACPICA 20160422. This broke i386: https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/2980/console From owner-svn-src-head@freebsd.org Wed Apr 27 20:24:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B4D9B1E7C4; Wed, 27 Apr 2016 20:24:50 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCCFA13DF; Wed, 27 Apr 2016 20:24:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3RKOmcI001665; Wed, 27 Apr 2016 20:24:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RKOm1x001664; Wed, 27 Apr 2016 20:24:48 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201604272024.u3RKOm1x001664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Wed, 27 Apr 2016 20:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298720 - head/sys/contrib/dev/acpica/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 20:24:50 -0000 Author: jkim Date: Wed Apr 27 20:24:48 2016 New Revision: 298720 URL: https://svnweb.freebsd.org/changeset/base/298720 Log: Fix build without ACPI_DEBUG. Modified: head/sys/contrib/dev/acpica/include/acoutput.h Modified: head/sys/contrib/dev/acpica/include/acoutput.h ============================================================================== --- head/sys/contrib/dev/acpica/include/acoutput.h Wed Apr 27 20:12:16 2016 (r298719) +++ head/sys/contrib/dev/acpica/include/acoutput.h Wed Apr 27 20:24:48 2016 (r298720) @@ -489,6 +489,7 @@ #define return_VOID return #define return_ACPI_STATUS(s) return(s) #define return_PTR(s) return(s) +#define return_STR(s) return(s) #define return_VALUE(s) return(s) #define return_UINT8(s) return(s) #define return_UINT32(s) return(s) From owner-svn-src-head@freebsd.org Wed Apr 27 20:29:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A86EFB1E8DA; Wed, 27 Apr 2016 20:29:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 2D05117C6; Wed, 27 Apr 2016 20:29:29 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Subject: Re: svn commit: r298714 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... To: Ngie Cooper References: <201604271909.u3RJ9Mvf076972@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Jung-uk Kim Message-ID: Date: Wed, 27 Apr 2016 16:29:23 -0400 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FatLlEqiOpXMmEO8FelDMr4k1W1MTwADO" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 20:29:29 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FatLlEqiOpXMmEO8FelDMr4k1W1MTwADO Content-Type: multipart/mixed; boundary="DcmsUjpfueghlShH0wQj2XJ5sOctHpCsG" From: Jung-uk Kim To: Ngie Cooper Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r298714 - in head: sys/conf sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/compon... References: <201604271909.u3RJ9Mvf076972@repo.freebsd.org> In-Reply-To: --DcmsUjpfueghlShH0wQj2XJ5sOctHpCsG Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 04/27/16 04:24 PM, Ngie Cooper wrote: > On Wed, Apr 27, 2016 at 12:09 PM, Jung-uk Kim wrote:= >> Author: jkim >> Date: Wed Apr 27 19:09:21 2016 >> New Revision: 298714 >> URL: https://svnweb.freebsd.org/changeset/base/298714 >> >> Log: >> Merge ACPICA 20160422. >=20 > This broke i386: https://jenkins.freebsd.org/job/FreeBSD_HEAD_i386/2980= /console Fixed. Sorry. Jung-uk Kim --DcmsUjpfueghlShH0wQj2XJ5sOctHpCsG-- --FatLlEqiOpXMmEO8FelDMr4k1W1MTwADO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXISEoAAoJEHyflib82/FGQFwH/i3GPovFwJl1Kb4Oj3Tc1nsz QaEG2p8qGi9EdSvLgqIdixCx8mvLp+ZPFBe7EanRvXMbDZAjMp96I0LTnMha7rNj z+Fgsl2XVRUT8QiS50NCYJYCfue5NIQeX9YGorJ7vujFcrjtQgsBuLLELnqpaKws NJjo/Qo/axvVrWX/lx6xZLGrdrVuaqQH+xNaI+QKWUl2X7TJeKmm5faOStFhUOaL DMHW6GE9TG5G19NoRCpE+iqRNzy32udIkitiogZM/jKTpLi1jJUSf7u529jAhxSh LdiOD78ypKsJ6w7N+j9YS3m9KMUL+nKQMWwWc6TFbvOTFl9pVwYdOQ7x3lzhNuA= =h5KZ -----END PGP SIGNATURE----- --FatLlEqiOpXMmEO8FelDMr4k1W1MTwADO-- From owner-svn-src-head@freebsd.org Wed Apr 27 20:49:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 070CCB1EF68; Wed, 27 Apr 2016 20:49:59 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA956151A; Wed, 27 Apr 2016 20:49:58 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3RKnvfU007960; Wed, 27 Apr 2016 20:49:57 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RKnvT5007958; Wed, 27 Apr 2016 20:49:57 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201604272049.u3RKnvT5007958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 27 Apr 2016 20:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298721 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 20:49:59 -0000 Author: manu Date: Wed Apr 27 20:49:57 2016 New Revision: 298721 URL: https://svnweb.freebsd.org/changeset/base/298721 Log: Add support for the Non-maskable interrupt driver found in the Allwinner A20 and A31 SoCs. This is normally used for the PMU. Reviewed by: andrew Approved by: andrew (mentor) Differential Revision: https://reviews.freebsd.org/D5663 Added: head/sys/arm/allwinner/aw_nmi.c (contents, props changed) Modified: head/sys/arm/allwinner/files.allwinner Added: head/sys/arm/allwinner/aw_nmi.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/allwinner/aw_nmi.c Wed Apr 27 20:49:57 2016 (r298721) @@ -0,0 +1,396 @@ +/*- + * Copyright (c) 2016 Emmanuel Vadot + * 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 "opt_platform.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +#include "pic_if.h" + +#define NMI_IRQ_CTRL_REG 0x0 +#define NMI_IRQ_LOW_LEVEL 0x0 +#define NMI_IRQ_LOW_EDGE 0x1 +#define NMI_IRQ_HIGH_LEVEL 0x2 +#define NMI_IRQ_HIGH_EDGE 0x3 +#define NMI_IRQ_PENDING_REG 0x4 +#define NMI_IRQ_ACK (1U << 0) +#define A20_NMI_IRQ_ENABLE_REG 0x8 +#define A31_NMI_IRQ_ENABLE_REG 0x34 +#define NMI_IRQ_ENABLE (1U << 0) + +#define SC_NMI_READ(_sc, _reg) bus_read_4(_sc->res[0], _reg) +#define SC_NMI_WRITE(_sc, _reg, _val) bus_write_4(_sc->res[0], _reg, _val) + +static struct resource_spec aw_nmi_res_spec[] = { + { SYS_RES_MEMORY, 0, RF_ACTIVE }, + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0, 0 } +}; + +struct aw_nmi_intr { + struct intr_irqsrc isrc; + u_int irq; + enum intr_polarity pol; + enum intr_trigger tri; +}; + +struct aw_nmi_softc { + device_t dev; + struct resource * res[2]; + void * intrcookie; + struct aw_nmi_intr intr; + uint8_t enable_reg; +}; + +#define A20_NMI 1 +#define A31_NMI 2 + +static struct ofw_compat_data compat_data[] = { + {"allwinner,sun7i-a20-sc-nmi", A20_NMI}, + {"allwinner,sun6i-a31-sc-nmi", A31_NMI}, + + {NULL, 0}, +}; + +static int +aw_nmi_intr(void *arg) +{ + struct aw_nmi_softc *sc; + + sc = arg; + + if (SC_NMI_READ(sc, NMI_IRQ_PENDING_REG) == 0) { + device_printf(sc->dev, "Spurious interrupt\n"); + return (FILTER_HANDLED); + } + + if (intr_isrc_dispatch(&sc->intr.isrc, curthread->td_intr_frame) != 0) { + SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); + device_printf(sc->dev, "Stray interrupt, NMI disabled\n"); + } + + return (FILTER_HANDLED); +} + +static void +aw_nmi_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_nmi_softc *sc; + + sc = device_get_softc(dev); + + SC_NMI_WRITE(sc, sc->enable_reg, NMI_IRQ_ENABLE); +} + +static void +aw_nmi_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_nmi_softc *sc; + + sc = device_get_softc(dev); + + SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); +} + +static int +aw_nmi_map_fdt(device_t dev, u_int ncells, pcell_t *cells, u_int *irqp, + enum intr_polarity *polp, enum intr_trigger *trigp) +{ + u_int irq, tripol; + enum intr_polarity pol; + enum intr_trigger trig; + + if (ncells != 2) { + device_printf(dev, "Invalid #interrupt-cells\n"); + return (EINVAL); + } + + irq = cells[0]; + if (irq != 0) { + device_printf(dev, "Controller only support irq 0\n"); + return (EINVAL); + } + + tripol = cells[1]; + + switch (tripol) { + case IRQ_TYPE_EDGE_RISING: + trig = INTR_TRIGGER_EDGE; + pol = INTR_POLARITY_HIGH; + break; + case IRQ_TYPE_EDGE_FALLING: + trig = INTR_TRIGGER_EDGE; + pol = INTR_POLARITY_LOW; + break; + case IRQ_TYPE_LEVEL_HIGH: + trig = INTR_TRIGGER_LEVEL; + pol = INTR_POLARITY_HIGH; + break; + case IRQ_TYPE_LEVEL_LOW: + trig = INTR_TRIGGER_LEVEL; + pol = INTR_POLARITY_LOW; + break; + default: + device_printf(dev, "unsupported trigger/polarity 0x%2x\n", + tripol); + return (ENOTSUP); + } + + *irqp = irq; + if (polp != NULL) + *polp = pol; + if (trigp != NULL) + *trigp = trig; + return (0); +} + +static int +aw_nmi_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + struct aw_nmi_softc *sc; + int error; + u_int irq; + + sc = device_get_softc(dev); + if (data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); + + error = aw_nmi_map_fdt(dev, data->fdt.ncells, data->fdt.cells, &irq, + NULL, NULL); + if (error == 0) + *isrcp = &sc->intr.isrc; + + return (error); +} + +static int +aw_nmi_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct aw_nmi_softc *sc; + struct aw_nmi_intr *nmi_intr; + int error, icfg; + u_int irq; + enum intr_trigger trig; + enum intr_polarity pol; + + sc = device_get_softc(dev); + nmi_intr = (struct aw_nmi_intr *)isrc; + + /* Get config for interrupt. */ + if (data == NULL || data->type != INTR_MAP_DATA_FDT) + return (ENOTSUP); + error = aw_nmi_map_fdt(dev, data->fdt.ncells, data->fdt.cells, &irq, + &pol, &trig); + if (error != 0) + return (error); + if (nmi_intr->irq != irq) + return (EINVAL); + + /* Compare config if this is not first setup. */ + if (isrc->isrc_handlers != 0) { + if (pol != nmi_intr->pol || trig != nmi_intr->tri) + return (EINVAL); + else + return (0); + } + + nmi_intr->pol = pol; + nmi_intr->tri = trig; + + if (trig == INTR_TRIGGER_LEVEL) { + if (pol == INTR_POLARITY_LOW) + icfg = NMI_IRQ_LOW_LEVEL; + else + icfg = NMI_IRQ_HIGH_LEVEL; + } else { + if (pol == INTR_POLARITY_HIGH) + icfg = NMI_IRQ_HIGH_EDGE; + else + icfg = NMI_IRQ_LOW_EDGE; + } + + SC_NMI_WRITE(sc, NMI_IRQ_CTRL_REG, icfg); + + return (0); +} + +static int +aw_nmi_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct aw_nmi_softc *sc; + + sc = device_get_softc(dev); + + if (isrc->isrc_handlers == 0) { + sc->intr.pol = INTR_POLARITY_CONFORM; + sc->intr.tri = INTR_TRIGGER_CONFORM; + + SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); + } + + return (0); +} + +static void +aw_nmi_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + aw_nmi_disable_intr(dev, isrc); +} + +static void +aw_nmi_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + arm_irq_memory_barrier(0); + aw_nmi_enable_intr(dev, isrc); +} + +static void +aw_nmi_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct aw_nmi_softc *sc; + + sc = device_get_softc(dev); + + arm_irq_memory_barrier(0); + SC_NMI_WRITE(sc, NMI_IRQ_PENDING_REG, NMI_IRQ_ACK); +} + +static int +aw_nmi_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + device_set_desc(dev, "Allwinner NMI Controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +aw_nmi_attach(device_t dev) +{ + struct aw_nmi_softc *sc; + phandle_t xref; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, aw_nmi_res_spec, sc->res) != 0) { + device_printf(dev, "can't allocate device resources\n"); + return (ENXIO); + } + if ((bus_setup_intr(dev, sc->res[1], INTR_TYPE_MISC, + aw_nmi_intr, NULL, sc, &sc->intrcookie))) { + device_printf(dev, "unable to register interrupt handler\n"); + bus_release_resources(dev, aw_nmi_res_spec, sc->res); + return (ENXIO); + } + + switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) { + case A20_NMI: + sc->enable_reg = A20_NMI_IRQ_ENABLE_REG; + break; + case A31_NMI: + sc->enable_reg = A31_NMI_IRQ_ENABLE_REG; + break; + } + + /* Disable and clear interrupts */ + SC_NMI_WRITE(sc, sc->enable_reg, !NMI_IRQ_ENABLE); + SC_NMI_WRITE(sc, NMI_IRQ_PENDING_REG, NMI_IRQ_ACK); + + xref = OF_xref_from_node(ofw_bus_get_node(dev)); + /* Register our isrc */ + sc->intr.irq = 0; + sc->intr.pol = INTR_POLARITY_CONFORM; + sc->intr.tri = INTR_TRIGGER_CONFORM; + if (intr_isrc_register(&sc->intr.isrc, sc->dev, 0, "%s,%u", + device_get_nameunit(sc->dev), sc->intr.irq) != 0) + goto error; + + if (intr_pic_register(dev, (intptr_t)xref) != 0) { + device_printf(dev, "could not register pic\n"); + goto error; + } + return (0); + +error: + bus_teardown_intr(dev, sc->res[1], sc->intrcookie); + bus_release_resources(dev, aw_nmi_res_spec, sc->res); + return (ENXIO); +} + +static device_method_t aw_nmi_methods[] = { + DEVMETHOD(device_probe, aw_nmi_probe), + DEVMETHOD(device_attach, aw_nmi_attach), + + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, aw_nmi_disable_intr), + DEVMETHOD(pic_enable_intr, aw_nmi_enable_intr), + DEVMETHOD(pic_map_intr, aw_nmi_map_intr), + DEVMETHOD(pic_setup_intr, aw_nmi_setup_intr), + DEVMETHOD(pic_teardown_intr, aw_nmi_teardown_intr), + DEVMETHOD(pic_post_filter, aw_nmi_post_filter), + DEVMETHOD(pic_post_ithread, aw_nmi_post_ithread), + DEVMETHOD(pic_pre_ithread, aw_nmi_pre_ithread), + + {0, 0}, +}; + +static driver_t aw_nmi_driver = { + "aw_nmi", + aw_nmi_methods, + sizeof(struct aw_nmi_softc), +}; + +static devclass_t aw_nmi_devclass; + +EARLY_DRIVER_MODULE(aw_nmi, simplebus, aw_nmi_driver, + aw_nmi_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LAST); Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Wed Apr 27 20:24:48 2016 (r298720) +++ head/sys/arm/allwinner/files.allwinner Wed Apr 27 20:49:57 2016 (r298721) @@ -10,6 +10,7 @@ arm/allwinner/aw_usbphy.c optional ehci arm/allwinner/a10_gpio.c optional gpio arm/allwinner/a10_mmc.c optional mmc arm/allwinner/a10_sramc.c standard +arm/allwinner/aw_nmi.c optional intrng arm/allwinner/aw_if_dwc.c optional dwc arm/allwinner/aw_rtc.c standard arm/allwinner/aw_wdog.c standard From owner-svn-src-head@freebsd.org Wed Apr 27 21:12:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A9630B1F6B7; Wed, 27 Apr 2016 21:12:06 +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 7B5A51653; Wed, 27 Apr 2016 21:12:06 +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 u3RLC5Gv016782; Wed, 27 Apr 2016 21:12:05 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RLC5VB016781; Wed, 27 Apr 2016 21:12:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604272112.u3RLC5VB016781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 21:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298722 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 21:12:06 -0000 Author: jhb Date: Wed Apr 27 21:12:05 2016 New Revision: 298722 URL: https://svnweb.freebsd.org/changeset/base/298722 Log: Adjust prototypes for NUMA-related functions to match the style of the rest of this file. Modified: head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Apr 27 20:49:57 2016 (r298721) +++ head/sys/dev/acpica/acpivar.h Wed Apr 27 21:12:05 2016 (r298722) @@ -505,9 +505,9 @@ SYSCTL_DECL(_debug_acpi); * * Returns the VM domain ID if found, or -1 if not found / invalid. */ -extern int acpi_map_pxm_to_vm_domainid(int pxm); -extern int acpi_get_domain(device_t dev, device_t child, int *domain); -extern int acpi_parse_pxm(device_t dev, int *domain); +int acpi_map_pxm_to_vm_domainid(int pxm); +int acpi_get_domain(device_t dev, device_t child, int *domain); +int acpi_parse_pxm(device_t dev, int *domain); #endif /* _KERNEL */ #endif /* !_ACPIVAR_H_ */ From owner-svn-src-head@freebsd.org Wed Apr 27 21:51:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BCC0B1FD52; Wed, 27 Apr 2016 21:51:25 +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 5877719F2; Wed, 27 Apr 2016 21:51:25 +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 u3RLpOLa026880; Wed, 27 Apr 2016 21:51:24 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RLpOJ5026879; Wed, 27 Apr 2016 21:51:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604272151.u3RLpOJ5026879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 21:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298723 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 21:51:25 -0000 Author: jhb Date: Wed Apr 27 21:51:24 2016 New Revision: 298723 URL: https://svnweb.freebsd.org/changeset/base/298723 Log: Trim redundant message. WITNESS_WARN() appends "with non-sleepable lock" to the caller's message. Sponsored by: Chelsio Communications Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Wed Apr 27 21:12:05 2016 (r298722) +++ head/sys/vm/vm_map.c Wed Apr 27 21:51:24 2016 (r298723) @@ -345,7 +345,7 @@ vmspace_free(struct vmspace *vm) { WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, - "vmspace_free() called with non-sleepable lock held"); + "vmspace_free() called"); if (vm->vm_refcnt == 0) panic("vmspace_free: attempt to free already freed vmspace"); From owner-svn-src-head@freebsd.org Thu Apr 28 01:43:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B76BB1E19D; Thu, 28 Apr 2016 01:43:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 492A51085; Thu, 28 Apr 2016 01:43:19 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3S1hI69024742; Thu, 28 Apr 2016 01:43:18 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3S1hIeA024741; Thu, 28 Apr 2016 01:43:18 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604280143.u3S1hIeA024741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Thu, 28 Apr 2016 01:43:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298730 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 01:43:19 -0000 Author: sephe Date: Thu Apr 28 01:43:18 2016 New Revision: 298730 URL: https://svnweb.freebsd.org/changeset/base/298730 Log: tcp/lro: Fix more typo Noticed by: hiren MFC after: 1 week Sponsored by: Microsoft OSTC Modified: head/sys/netinet/tcp_lro.c Modified: head/sys/netinet/tcp_lro.c ============================================================================== --- head/sys/netinet/tcp_lro.c Thu Apr 28 01:40:47 2016 (r298729) +++ head/sys/netinet/tcp_lro.c Thu Apr 28 01:43:18 2016 (r298730) @@ -569,7 +569,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0) return (TCP_LRO_CANNOT); - /* XXX-BZ We lose a ACK|PUSH flag concatinating multiple segments. */ + /* XXX-BZ We lose a ACK|PUSH flag concatenating multiple segments. */ /* XXX-BZ Ideally we'd flush on PUSH? */ /* From owner-svn-src-head@freebsd.org Thu Apr 28 01:43:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27182B1E227; Thu, 28 Apr 2016 01:43:52 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: from mail-vk0-x241.google.com (mail-vk0-x241.google.com [IPv6:2607:f8b0:400c:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D700811E9; Thu, 28 Apr 2016 01:43:51 +0000 (UTC) (envelope-from sepherosa@gmail.com) Received: by mail-vk0-x241.google.com with SMTP id u23so2074873vkb.3; Wed, 27 Apr 2016 18:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=hpXtC77mCqvjUrbcN+IafAW+WN22QRoqYJT/tpU+vr0=; b=p4hzLSX8x/YCNXJzJ+U5JVJTUbQp77uMsUtjROVaPMTkhc6vebfUV7h61cxY+W+6FO drg10plUqgFeUA7i5caEdtXEH0MWyUsXdpNOpoxla7/iqftR5/ME8Yg0TWNYRPpeaYro M9inqppVo9ugFsFTt/0UfMb+JQeQfnjSbx3JmoyNR1gp70KlEYKnZTeVdnh3+RwIUuex 7OFdCw1PIsVAexIuANgpMDyNkmMJyhlaqbE/hmSZe6Iv8egg9tiV/67oKSOFiXNTR8Vs g3gtG2oASJ4HtphcQxj0DGS25QRa4bw7cEaBWkwKTzSFjmVc/VMadq9PNBTiGA/YPPgo 0oqQ== 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; bh=hpXtC77mCqvjUrbcN+IafAW+WN22QRoqYJT/tpU+vr0=; b=N6QnkwCAXZfhSGiGpqKk1Ui9bTEtASd0LC5d4TLMnMEn/dIp9x7CnepHG0o5qLQNWt QH1qZXYglezsqtTnCTqCO9DlsoTE7n1J7pL7uEjiyUUV5Ib+hr50aIfzFSwh4tL0Ntmv oLH+U9OR4nr6C1O20BGd29c1dZxNEyfo2+AxTsyUUkn5YDWWFpaTWhLk/4KVIuvN21bu MlsUBfbv0U4SDsb/WcENh74CxUChtR2ryBBNeyeTegfZ6ti5ZUaCdEDY7s30ZnfXuPWE V7jBJfYgj56XRtQE0XXl3ti3udlZ+XS/wZS6qD5564W+RT356Amlvhm90gy97+5DfQ7r jhgQ== X-Gm-Message-State: AOPr4FWtvGECRyx3P/ftpkhgt0x2SzMe/Uj85IgnfQ8ChgKDw6uvUNitaKq08hD0lS/I1Jome4ftwuCSd7gPKg== MIME-Version: 1.0 X-Received: by 10.31.142.202 with SMTP id q193mr1144955vkd.11.1461807830788; Wed, 27 Apr 2016 18:43:50 -0700 (PDT) Sender: sepherosa@gmail.com Received: by 10.176.65.99 with HTTP; Wed, 27 Apr 2016 18:43:50 -0700 (PDT) In-Reply-To: <20160427155645.GQ33164@strugglingcoder.info> References: <201604270940.u3R9ethr075834@repo.freebsd.org> <20160427155645.GQ33164@strugglingcoder.info> Date: Thu, 28 Apr 2016 09:43:50 +0800 X-Google-Sender-Auth: JbRenlMqrT-PI5D18d89XVHbDl8 Message-ID: Subject: Re: svn commit: r298696 - head/sys/netinet From: Sepherosa Ziehau To: hiren panchasara Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 01:43:52 -0000 On Wed, Apr 27, 2016 at 11:56 PM, hiren panchasara wrote: > On 04/27/16 at 09:40P, Sepherosa Ziehau wrote: >> Author: sephe >> Date: Wed Apr 27 09:40:55 2016 >> New Revision: 298696 >> URL: https://svnweb.freebsd.org/changeset/base/298696 >> >> Log: >> tcp/lro: Fix typo. >> >> MFC after: 1 week >> Sponsored by: Microsoft OSTC >> >> Modified: >> head/sys/netinet/tcp_lro.c >> >> Modified: head/sys/netinet/tcp_lro.c >> ============================================================================== >> --- head/sys/netinet/tcp_lro.c Wed Apr 27 07:46:38 2016 (r298695) >> +++ head/sys/netinet/tcp_lro.c Wed Apr 27 09:40:55 2016 (r298696) >> @@ -569,7 +569,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m >> if ((th->th_flags & ~(TH_ACK | TH_PUSH)) != 0) >> return (TCP_LRO_CANNOT); >> >> - /* XXX-BZ We lose a AKC|PUSH flag concatinating multiple segments. */ >> + /* XXX-BZ We lose a ACK|PUSH flag concatinating multiple segments. */ > > Also s/concatinating /concatenating / ? Fixed, thanks! -- Tomorrow Will Never Die From owner-svn-src-head@freebsd.org Thu Apr 28 01:58:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EAE6B1E64E; Thu, 28 Apr 2016 01:58:58 +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 D416019A3; Thu, 28 Apr 2016 01:58:57 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3S1wv7I027984; Thu, 28 Apr 2016 01:58:57 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3S1wv1l027983; Thu, 28 Apr 2016 01:58:57 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604280158.u3S1wv1l027983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Apr 2016 01:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298731 - head/sys/compat/ndis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 01:58:58 -0000 Author: pfg Date: Thu Apr 28 01:58:56 2016 New Revision: 298731 URL: https://svnweb.freebsd.org/changeset/base/298731 Log: ndis(4): unsign some indexes to prevent overflows. The "len" parameter is uint32_t, indexing it with an int may end up in a signed integer overflow. strlen(3) returns an integer of size_t so the corresponding index should have that size. MFC after: 1 week Modified: head/sys/compat/ndis/subr_ndis.c Modified: head/sys/compat/ndis/subr_ndis.c ============================================================================== --- head/sys/compat/ndis/subr_ndis.c Thu Apr 28 01:43:18 2016 (r298730) +++ head/sys/compat/ndis/subr_ndis.c Thu Apr 28 01:58:56 2016 (r298731) @@ -896,7 +896,7 @@ NdisReadPciSlotInformation(adapter, slot uint32_t len; { ndis_miniport_block *block; - int i; + uint32_t i; char *dest; device_t dev; @@ -939,7 +939,7 @@ NdisWritePciSlotInformation(adapter, slo uint32_t len; { ndis_miniport_block *block; - int i; + uint32_t i; char *dest; device_t dev; @@ -2432,7 +2432,7 @@ NdisReadPcmciaAttributeMemory(handle, of bus_space_handle_t bh; bus_space_tag_t bt; char *dest; - int i; + uint32_t i; if (handle == NULL) return (0); @@ -2462,7 +2462,7 @@ NdisWritePcmciaAttributeMemory(handle, o bus_space_handle_t bh; bus_space_tag_t bt; char *src; - int i; + uint32_t i; if (handle == NULL) return (0); @@ -2670,7 +2670,7 @@ ndis_find_sym(lf, filename, suffix, sym) { char *fullsym; char *suf; - int i; + size_t i; fullsym = ExAllocatePoolWithTag(NonPagedPool, MAXPATHLEN, 0); if (fullsym == NULL) From owner-svn-src-head@freebsd.org Thu Apr 28 02:39:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AEF0B1EE17; Thu, 28 Apr 2016 02:39:44 +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 5C6DF1974; Thu, 28 Apr 2016 02:39:44 +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 u3S2dhiR039926; Thu, 28 Apr 2016 02:39:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3S2dh9T039925; Thu, 28 Apr 2016 02:39:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604280239.u3S2dh9T039925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Apr 2016 02:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298732 - head/sys/fs/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 02:39:44 -0000 Author: pfg Date: Thu Apr 28 02:39:43 2016 New Revision: 298732 URL: https://svnweb.freebsd.org/changeset/base/298732 Log: sys/devfs: unsign an index to prevent signed integer overflow. cdp_maxdirent in struct:cdev_priv is of type u_int. Use the same type for the corresponding index in devfs_revoke(). 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 Thu Apr 28 01:58:56 2016 (r298731) +++ head/sys/fs/devfs/devfs_vnops.c Thu Apr 28 02:39:43 2016 (r298732) @@ -1444,7 +1444,7 @@ devfs_revoke(struct vop_revoke_args *ap) struct cdev *dev; struct cdev_priv *cdp; struct devfs_dirent *de; - int i; + u_int i; KASSERT((ap->a_flags & REVOKEALL) != 0, ("devfs_revoke !REVOKEALL")); From owner-svn-src-head@freebsd.org Thu Apr 28 02:46:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76A82B1F043; Thu, 28 Apr 2016 02:46: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 48CE91E66; Thu, 28 Apr 2016 02:46: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 u3S2k8mq042930; Thu, 28 Apr 2016 02:46:08 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3S2k8Nk042929; Thu, 28 Apr 2016 02:46:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604280246.u3S2k8Nk042929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Apr 2016 02:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298733 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 02:46:09 -0000 Author: pfg Date: Thu Apr 28 02:46:08 2016 New Revision: 298733 URL: https://svnweb.freebsd.org/changeset/base/298733 Log: ipdivert: Remove unnecessary and incorrectly typed variable. In principle n is only used to carry a copy of ipi_count, which is unsigned, in the non-VIMAGE case, however ipi_count can be used directly so it is not needed at all. Removing it makes things look cleaner. Modified: head/sys/netinet/ip_divert.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Thu Apr 28 02:39:43 2016 (r298732) +++ head/sys/netinet/ip_divert.c Thu Apr 28 02:46:08 2016 (r298733) @@ -765,9 +765,6 @@ static int div_modevent(module_t mod, int type, void *unused) { int err = 0; -#ifndef VIMAGE - int n; -#endif switch (type) { case MOD_LOAD: @@ -808,8 +805,7 @@ div_modevent(module_t mod, int type, voi * we destroy the lock. */ INP_INFO_WLOCK(&V_divcbinfo); - n = V_divcbinfo.ipi_count; - if (n != 0) { + if (V_divcbinfo.ipi_count != 0) { err = EBUSY; INP_INFO_WUNLOCK(&V_divcbinfo); break; From owner-svn-src-head@freebsd.org Thu Apr 28 03:19:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C932BB1F81D; Thu, 28 Apr 2016 03:19: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 9AD611023; Thu, 28 Apr 2016 03:19: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 u3S3Jro2052500; Thu, 28 Apr 2016 03:19:53 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3S3JrW0052499; Thu, 28 Apr 2016 03:19:53 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604280319.u3S3JrW0052499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Apr 2016 03:19:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298734 - head/sys/compat/ndis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 03:19:54 -0000 Author: pfg Date: Thu Apr 28 03:19:53 2016 New Revision: 298734 URL: https://svnweb.freebsd.org/changeset/base/298734 Log: ndis(4): it's rather unrealistic to expect a size_t here. int was actually OK, and u_int is more than enough. Modified: head/sys/compat/ndis/subr_ndis.c Modified: head/sys/compat/ndis/subr_ndis.c ============================================================================== --- head/sys/compat/ndis/subr_ndis.c Thu Apr 28 02:46:08 2016 (r298733) +++ head/sys/compat/ndis/subr_ndis.c Thu Apr 28 03:19:53 2016 (r298734) @@ -2670,7 +2670,7 @@ ndis_find_sym(lf, filename, suffix, sym) { char *fullsym; char *suf; - size_t i; + u_int i; fullsym = ExAllocatePoolWithTag(NonPagedPool, MAXPATHLEN, 0); if (fullsym == NULL) From owner-svn-src-head@freebsd.org Thu Apr 28 06:20:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2A96B1FAEE; Thu, 28 Apr 2016 06:20:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8F204114B; Thu, 28 Apr 2016 06:20:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3S6KhqA006144; Thu, 28 Apr 2016 06:20:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3S6Khr9006142; Thu, 28 Apr 2016 06:20:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201604280620.u3S6Khr9006142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 28 Apr 2016 06:20:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298735 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 06:20:44 -0000 Author: arybchik Date: Thu Apr 28 06:20:43 2016 New Revision: 298735 URL: https://svnweb.freebsd.org/changeset/base/298735 Log: sfxge(4): do not use RxQ index as label Labels are limitted by 32 on EF10. It is not sufficient on powerful hosts. Since only one RxQ is running over each EvQ, zero label may be used. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days PR: 208267 Differential Revision: https://reviews.freebsd.org/D6121 Modified: head/sys/dev/sfxge/sfxge_ev.c head/sys/dev/sfxge/sfxge_rx.c Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Thu Apr 28 03:19:53 2016 (r298734) +++ head/sys/dev/sfxge/sfxge_ev.c Thu Apr 28 06:20:43 2016 (r298735) @@ -84,6 +84,21 @@ sfxge_ev_qcomplete(struct sfxge_evq *evq sfxge_rx_qcomplete(rxq, eop); } +static struct sfxge_rxq * +sfxge_get_rxq_by_label(struct sfxge_evq *evq, uint32_t label) +{ + struct sfxge_rxq *rxq; + + KASSERT(label == 0, ("unexpected rxq label != 0")); + + rxq = evq->sc->rxq[evq->index]; + + KASSERT(rxq != NULL, ("rxq == NULL")); + KASSERT(evq->index == rxq->index, ("evq->index != rxq->index")); + + return (rxq); +} + static boolean_t sfxge_ev_rx(void *arg, uint32_t label, uint32_t id, uint32_t size, uint16_t flags) @@ -103,11 +118,7 @@ sfxge_ev_rx(void *arg, uint32_t label, u if (evq->exception) goto done; - rxq = sc->rxq[label]; - KASSERT(rxq != NULL, ("rxq == NULL")); - KASSERT(evq->index == rxq->index, - ("evq->index != rxq->index")); - + rxq = sfxge_get_rxq_by_label(evq, label); if (__predict_false(rxq->init_state != SFXGE_RXQ_STARTED)) goto done; @@ -216,7 +227,7 @@ sfxge_ev_rxq_flush_done(void *arg, uint3 evq = sc->evq[index]; - label = rxq_index; + label = 0; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != level")); magic = SFXGE_MAGIC_RX_QFLUSH_DONE | label; @@ -250,7 +261,7 @@ sfxge_ev_rxq_flush_failed(void *arg, uin index = rxq->index; evq = sc->evq[index]; - label = rxq_index; + label = 0; KASSERT((label & SFXGE_MAGIC_DMAQ_LABEL_MASK) == label, ("(label & SFXGE_MAGIC_DMAQ_LABEL_MASK) != label")); magic = SFXGE_MAGIC_RX_QFLUSH_FAILED | label; @@ -369,36 +380,18 @@ sfxge_ev_software(void *arg, uint16_t ma magic &= ~SFXGE_MAGIC_DMAQ_LABEL_MASK; switch (magic) { - case SFXGE_MAGIC_RX_QFLUSH_DONE: { - struct sfxge_rxq *rxq = sc->rxq[label]; - - KASSERT(rxq != NULL, ("rxq == NULL")); - KASSERT(evq->index == rxq->index, - ("evq->index != rxq->index")); - - sfxge_rx_qflush_done(rxq); + case SFXGE_MAGIC_RX_QFLUSH_DONE: + sfxge_rx_qflush_done(sfxge_get_rxq_by_label(evq, label)); break; - } - case SFXGE_MAGIC_RX_QFLUSH_FAILED: { - struct sfxge_rxq *rxq = sc->rxq[label]; - KASSERT(rxq != NULL, ("rxq == NULL")); - KASSERT(evq->index == rxq->index, - ("evq->index != rxq->index")); - - sfxge_rx_qflush_failed(rxq); + case SFXGE_MAGIC_RX_QFLUSH_FAILED: + sfxge_rx_qflush_failed(sfxge_get_rxq_by_label(evq, label)); break; - } - case SFXGE_MAGIC_RX_QREFILL: { - struct sfxge_rxq *rxq = sc->rxq[label]; - - KASSERT(rxq != NULL, ("rxq == NULL")); - KASSERT(evq->index == rxq->index, - ("evq->index != rxq->index")); - sfxge_rx_qrefill(rxq); + case SFXGE_MAGIC_RX_QREFILL: + sfxge_rx_qrefill(sfxge_get_rxq_by_label(evq, label)); break; - } + case SFXGE_MAGIC_TX_QFLUSH_DONE: { struct sfxge_txq *txq = sfxge_get_txq_by_label(evq, label); Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Thu Apr 28 03:19:53 2016 (r298734) +++ head/sys/dev/sfxge/sfxge_rx.c Thu Apr 28 06:20:43 2016 (r298735) @@ -1024,7 +1024,7 @@ sfxge_rx_qstart(struct sfxge_softc *sc, return (rc); /* Create the common code receive queue. */ - if ((rc = efx_rx_qcreate(sc->enp, index, index, EFX_RXQ_TYPE_DEFAULT, + if ((rc = efx_rx_qcreate(sc->enp, index, 0, EFX_RXQ_TYPE_DEFAULT, esmp, sc->rxq_entries, rxq->buf_base_id, evq->common, &rxq->common)) != 0) goto fail; From owner-svn-src-head@freebsd.org Thu Apr 28 08:29:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE40BB1FCA9; Thu, 28 Apr 2016 08:29:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A04061CC9; Thu, 28 Apr 2016 08:29:58 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3S8TvDe045203; Thu, 28 Apr 2016 08:29:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3S8Tvwl045202; Thu, 28 Apr 2016 08:29:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604280829.u3S8Tvwl045202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 28 Apr 2016 08:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298736 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 08:29:58 -0000 Author: avg Date: Thu Apr 28 08:29:57 2016 New Revision: 298736 URL: https://svnweb.freebsd.org/changeset/base/298736 Log: ensure that initial local apic id is sane on AMD 10h systems Summary: The Initial Local APIC ID is returned by CPUID function 1 (in EBX). On AMD Family 10h systems the way that ID is built is controlled by an MSR bit (InitApicIdCpuIdLo). BKDG instructs BIOS to set it in a certain way, but a BIOS can be buggy. In that case the ID can confuse tools that use it, e.g. hwloc. For example, on a system that I own real Local APIC IDs are configured as 0, 1, 2, 3, but IDs reported via CPUID.1 are 0, 0x40, 0x80, 0xc0. See: https://github.com/open-mpi/hwloc/issues/183 Reviewed by: kib MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6060 Modified: head/sys/amd64/amd64/initcpu.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Thu Apr 28 06:20:43 2016 (r298735) +++ head/sys/amd64/amd64/initcpu.c Thu Apr 28 08:29:57 2016 (r298736) @@ -80,6 +80,19 @@ init_amd(void) wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); break; } + + /* + * BIOS may fail to set InitApicIdCpuIdLo to 1 as it should per BKDG. + * So, do it here or otherwise some tools could be confused by + * Initial Local APIC ID reported with CPUID Function 1 in EBX. + */ + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { + if ((cpu_feature2 & CPUID2_HV) == 0) { + msr = rdmsr(MSR_NB_CFG1); + msr |= (uint64_t)1 << 54; + wrmsr(MSR_NB_CFG1, msr); + } + } } /* From owner-svn-src-head@freebsd.org Thu Apr 28 09:36:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B28F7B1E1C7; Thu, 28 Apr 2016 09:36:55 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78A041179; Thu, 28 Apr 2016 09:36:55 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=w6hCghoSaJBSXiv/bfyWn6Yx1J+rtIqUEh1NLneKQm8=; b=BX9aJ/muzC8SZhq6tqCOzC1cwoeP/M7Rfgd7G7upDECq/sXbZ0coP03B1viwBJs8d/VchPrbF+mydbDpZhpoOxTojsAfghcnSWXjEAWjxVEcskGNsAwzI60eo6sgNgmkEfykaCAdzexx8lL4+WfQkFkMZWTgFFgM8YwdrXMg0UY=; Received: from ns.budzona.com.ua ([195.95.232.193] helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1aviNK-000Glo-RK ; Thu, 28 Apr 2016 12:36:46 +0300 Date: Thu, 28 Apr 2016 12:36:46 +0300 From: Ivan Klymenko To: Andriy Gapon Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298736 - head/sys/amd64/amd64 Message-ID: <20160428123646.0993d51d@nonamehost.local> In-Reply-To: <201604280829.u3S8Tvwl045202@repo.freebsd.org> References: <201604280829.u3S8Tvwl045202@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=195.95.232.193; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 09:36:55 -0000 On Thu, 28 Apr 2016 08:29:57 +0000 (UTC) Andriy Gapon wrote: > Author: avg > Date: Thu Apr 28 08:29:57 2016 > New Revision: 298736 > URL: https://svnweb.freebsd.org/changeset/base/298736 > > Log: > ensure that initial local apic id is sane on AMD 10h systems > > Summary: > The Initial Local APIC ID is returned by CPUID function 1 (in EBX). > On AMD Family 10h systems the way that ID is built is controlled by > an MSR bit (InitApicIdCpuIdLo). BKDG instructs BIOS to set it in a > certain way, but a BIOS can be buggy. In that case the ID can > confuse tools that use it, e.g. hwloc. > For example, on a system that I own real Local APIC IDs are > configured as 0, 1, 2, 3, but IDs reported via CPUID.1 are 0, 0x40, > 0x80, 0xc0. See: https://github.com/open-mpi/hwloc/issues/183 > > Reviewed by: kib > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D6060 > > Modified: > head/sys/amd64/amd64/initcpu.c > > Modified: head/sys/amd64/amd64/initcpu.c > ============================================================================== > --- head/sys/amd64/amd64/initcpu.c Thu Apr 28 06:20:43 > 2016 (r298735) +++ head/sys/amd64/amd64/initcpu.c Thu > Apr 28 08:29:57 2016 (r298736) @@ -80,6 +80,19 @@ > init_amd(void) wrmsr(0xc0011029, rdmsr(0xc0011029) | 1); > break; > } > + > + /* > + * BIOS may fail to set InitApicIdCpuIdLo to 1 as it should > per BKDG. > + * So, do it here or otherwise some tools could be confused > by > + * Initial Local APIC ID reported with CPUID Function 1 in > EBX. > + */ > + if (CPUID_TO_FAMILY(cpu_id) == 0x10) { > + if ((cpu_feature2 & CPUID2_HV) == 0) { > + msr = rdmsr(MSR_NB_CFG1); > + msr |= (uint64_t)1 << 54; > + wrmsr(MSR_NB_CFG1, msr); > + } > + } > } > > /* > _______________________________________________ ... --- initcpu.o --- /usr/src/sys/amd64/amd64/initcpu.c:91:4: error: use of undeclared identifier 'msr' msr = rdmsr(MSR_NB_CFG1); ^ /usr/src/sys/amd64/amd64/initcpu.c:92:4: error: use of undeclared identifier 'msr' msr |= (uint64_t)1 << 54; ^ /usr/src/sys/amd64/amd64/initcpu.c:93:23: error: use of undeclared identifier 'msr' wrmsr(MSR_NB_CFG1, msr); ^ 3 errors generated. *** [initcpu.o] Error code 1 make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 1 error make[2]: stopped in /media/da0s1/obj/usr/src/sys/mk11 *** [buildkernel] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildkernel] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src From owner-svn-src-head@freebsd.org Thu Apr 28 09:40:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 555D4B1E357; Thu, 28 Apr 2016 09:40:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 231C91435; Thu, 28 Apr 2016 09:40:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3S9eOZA066662; Thu, 28 Apr 2016 09:40:24 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3S9eOOY066661; Thu, 28 Apr 2016 09:40:24 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604280940.u3S9eOOY066661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 28 Apr 2016 09:40:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298737 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 09:40:25 -0000 Author: avg Date: Thu Apr 28 09:40:24 2016 New Revision: 298737 URL: https://svnweb.freebsd.org/changeset/base/298737 Log: fix missing variable in r298736 Pointyhat to: avg Reported by: Ivan Klymenko MFC after: 2 weeks X-MFC with: r298736 Modified: head/sys/amd64/amd64/initcpu.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Thu Apr 28 08:29:57 2016 (r298736) +++ head/sys/amd64/amd64/initcpu.c Thu Apr 28 09:40:24 2016 (r298737) @@ -58,6 +58,7 @@ static int hw_clflush_disable = -1; static void init_amd(void) { + uint64_t msr; /* * Work around Erratum 721 for Family 10h and 12h processors. From owner-svn-src-head@freebsd.org Thu Apr 28 12:03:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A26A4B1D008; Thu, 28 Apr 2016 12:03:23 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F2DD1BAA; Thu, 28 Apr 2016 12:03:23 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3SC3MMW010985; Thu, 28 Apr 2016 12:03:22 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SC3MEG010980; Thu, 28 Apr 2016 12:03:22 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201604281203.u3SC3MEG010980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 28 Apr 2016 12:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298738 - in head/sys: dev/gpio kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 12:03:23 -0000 Author: mmel Date: Thu Apr 28 12:03:22 2016 New Revision: 298738 URL: https://svnweb.freebsd.org/changeset/base/298738 Log: GPIO: Add support for gpio pin interrupts. Add new function gpio_alloc_intr_resource(), which allows an allocation of interrupt resource associated to given gpio pin. It also allows to specify interrupt configuration. Note: This functionality is dependent on INTRNG, and must be implemented in each GPIO controller. Modified: head/sys/dev/gpio/gpiobus.c head/sys/dev/gpio/gpiobusvar.h head/sys/kern/subr_intr.c head/sys/sys/gpio.h head/sys/sys/intr.h Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu Apr 28 09:40:24 2016 (r298737) +++ head/sys/dev/gpio/gpiobus.c Thu Apr 28 12:03:22 2016 (r298738) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -72,6 +73,31 @@ static int gpiobus_pin_set(device_t, dev static int gpiobus_pin_get(device_t, device_t, uint32_t, unsigned int*); static int gpiobus_pin_toggle(device_t, device_t, uint32_t); +/* + * XXX -> Move me to better place - gpio_subr.c? + * Also, this function must be changed when interrupt configuration + * data will be moved into struct resource. + */ +#ifdef INTRNG +struct resource * +gpio_alloc_intr_resource(device_t consumer_dev, int *rid, u_int alloc_flags, + gpio_pin_t pin, uint32_t intr_mode) +{ + u_int irqnum; + + /* + * Allocate new fictitious interrupt number and store configuration + * into it. + */ + irqnum = intr_gpio_map_irq(pin->dev, pin->pin, pin->flags, intr_mode); + if (irqnum == 0xFFFFFFFF) + return (NULL); + + return (bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, + irqnum, irqnum, 1, alloc_flags)); +} +#endif + int gpio_check_flags(uint32_t caps, uint32_t flags) { Modified: head/sys/dev/gpio/gpiobusvar.h ============================================================================== --- head/sys/dev/gpio/gpiobusvar.h Thu Apr 28 09:40:24 2016 (r298737) +++ head/sys/dev/gpio/gpiobusvar.h Thu Apr 28 12:03:22 2016 (r298738) @@ -61,6 +61,9 @@ #define GPIOBUS_WAIT 1 #define GPIOBUS_DONTWAIT 2 +/* Use default interrupt mode - for gpio_alloc_intr_resource */ +#define GPIO_INTR_CONFORM GPIO_INTR_NONE + struct gpiobus_pin_data { int mapped; /* pin is mapped/reserved. */ @@ -122,6 +125,10 @@ int gpio_pin_is_active(gpio_pin_t pin, b int gpio_pin_set_active(gpio_pin_t pin, bool active); int gpio_pin_setflags(gpio_pin_t pin, uint32_t flags); #endif +#ifdef INTRNG +struct resource *gpio_alloc_intr_resource(device_t consumer_dev, int *rid, + u_int alloc_flags, gpio_pin_t pin, uint32_t intr_mode); +#endif int gpio_check_flags(uint32_t, uint32_t); device_t gpiobus_attach_bus(device_t); int gpiobus_detach_bus(device_t); Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Thu Apr 28 09:40:24 2016 (r298737) +++ head/sys/kern/subr_intr.c Thu Apr 28 12:03:22 2016 (r298738) @@ -596,6 +596,27 @@ intr_fdt_map_irq(phandle_t node, pcell_t } #endif +/* + * Store GPIO interrupt decription in framework and return unique interrupt + * number (resource handle) associated with it. + */ +u_int +intr_gpio_map_irq(device_t dev, u_int pin_num, u_int pin_flags, u_int intr_mode) +{ + struct intr_dev_data *ddata; + + ddata = intr_ddata_alloc(0); + if (ddata == NULL) + return (0xFFFFFFFF); /* no space left */ + + ddata->idd_dev = dev; + ddata->idd_data.type = INTR_MAP_DATA_GPIO; + ddata->idd_data.gpio.gpio_pin_num = pin_num; + ddata->idd_data.gpio.gpio_pin_flags = pin_flags; + ddata->idd_data.gpio.gpio_intr_mode = intr_mode; + return (ddata->idd_irq); +} + #ifdef INTR_SOLO /* * Setup filter into interrupt source. Modified: head/sys/sys/gpio.h ============================================================================== --- head/sys/sys/gpio.h Thu Apr 28 09:40:24 2016 (r298737) +++ head/sys/sys/gpio.h Thu Apr 28 12:03:22 2016 (r298738) @@ -60,16 +60,26 @@ #define GPIOMAXNAME 64 /* GPIO pin configuration flags */ -#define GPIO_PIN_INPUT 0x0001 /* input direction */ -#define GPIO_PIN_OUTPUT 0x0002 /* output direction */ -#define GPIO_PIN_OPENDRAIN 0x0004 /* open-drain output */ -#define GPIO_PIN_PUSHPULL 0x0008 /* push-pull output */ -#define GPIO_PIN_TRISTATE 0x0010 /* output disabled */ -#define GPIO_PIN_PULLUP 0x0020 /* internal pull-up enabled */ -#define GPIO_PIN_PULLDOWN 0x0040 /* internal pull-down enabled */ -#define GPIO_PIN_INVIN 0x0080 /* invert input */ -#define GPIO_PIN_INVOUT 0x0100 /* invert output */ -#define GPIO_PIN_PULSATE 0x0200 /* pulsate in hardware */ +#define GPIO_PIN_INPUT 0x00000001 /* input direction */ +#define GPIO_PIN_OUTPUT 0x00000002 /* output direction */ +#define GPIO_PIN_OPENDRAIN 0x00000004 /* open-drain output */ +#define GPIO_PIN_PUSHPULL 0x00000008 /* push-pull output */ +#define GPIO_PIN_TRISTATE 0x00000010 /* output disabled */ +#define GPIO_PIN_PULLUP 0x00000020 /* internal pull-up enabled */ +#define GPIO_PIN_PULLDOWN 0x00000040 /* internal pull-down enabled */ +#define GPIO_PIN_INVIN 0x00000080 /* invert input */ +#define GPIO_PIN_INVOUT 0x00000100 /* invert output */ +#define GPIO_PIN_PULSATE 0x00000200 /* pulsate in hardware */ +/* GPIO interrupt capabilities */ +#define GPIO_INTR_NONE 0x00000000 /* no interrupt support */ +#define GPIO_INTR_LEVEL_LOW 0x00010000 /* level trigger, low */ +#define GPIO_INTR_LEVEL_HIGH 0x00020000 /* level trigger, high */ +#define GPIO_INTR_EDGE_RISING 0x00040000 /* edge trigger, rising */ +#define GPIO_INTR_EDGE_FALLING 0x00080000 /* edge trigger, falling */ +#define GPIO_INTR_EDGE_BOTH 0x00100000 /* edge trigger, both */ +#define GPIO_INTR_MASK (GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | \ + GPIO_INTR_EDGE_RISING | \ + GPIO_INTR_EDGE_FALLING | GPIO_INTR_EDGE_BOTH) struct gpio_pin { uint32_t gp_pin; /* pin number */ Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Thu Apr 28 09:40:24 2016 (r298737) +++ head/sys/sys/intr.h Thu Apr 28 12:03:22 2016 (r298738) @@ -35,6 +35,7 @@ enum intr_map_data_type { INTR_MAP_DATA_ACPI, INTR_MAP_DATA_FDT, + INTR_MAP_DATA_GPIO, }; #ifdef DEV_ACPI @@ -51,6 +52,12 @@ struct intr_map_data_fdt { }; #endif +struct intr_map_data_gpio { + u_int gpio_pin_num; + u_int gpio_pin_flags; + u_int gpio_intr_mode; +}; + struct intr_map_data { enum intr_map_data_type type; union { @@ -60,6 +67,7 @@ struct intr_map_data { #ifdef FDT struct intr_map_data_fdt fdt; #endif + struct intr_map_data_gpio gpio; }; }; @@ -130,6 +138,8 @@ u_int intr_acpi_map_irq(device_t, u_int, #ifdef FDT u_int intr_fdt_map_irq(phandle_t, pcell_t *, u_int); #endif +u_int intr_gpio_map_irq(device_t dev, u_int pin_num, u_int pin_flags, + u_int intr_mode); #ifdef SMP int intr_bind_irq(device_t, struct resource *, int); From owner-svn-src-head@freebsd.org Thu Apr 28 12:04:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55D74B1D163; Thu, 28 Apr 2016 12:04:14 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31CFA1E6B; Thu, 28 Apr 2016 12:04:14 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3SC4DBB011074; Thu, 28 Apr 2016 12:04:13 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SC4Dsc011071; Thu, 28 Apr 2016 12:04:13 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201604281204.u3SC4Dsc011071@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 28 Apr 2016 12:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298739 - in head/sys: dev/gpio kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 12:04:14 -0000 Author: mmel Date: Thu Apr 28 12:04:12 2016 New Revision: 298739 URL: https://svnweb.freebsd.org/changeset/base/298739 Log: INTRNG: Define 'INTR_IRQ_INVALID' constant and use it consistently as error indicator. Modified: head/sys/dev/gpio/gpiobus.c head/sys/kern/subr_intr.c head/sys/sys/intr.h Modified: head/sys/dev/gpio/gpiobus.c ============================================================================== --- head/sys/dev/gpio/gpiobus.c Thu Apr 28 12:03:22 2016 (r298738) +++ head/sys/dev/gpio/gpiobus.c Thu Apr 28 12:04:12 2016 (r298739) @@ -90,7 +90,7 @@ gpio_alloc_intr_resource(device_t consum * into it. */ irqnum = intr_gpio_map_irq(pin->dev, pin->pin, pin->flags, intr_mode); - if (irqnum == 0xFFFFFFFF) + if (irqnum == INTR_IRQ_INVALID) return (NULL); return (bus_alloc_resource(consumer_dev, SYS_RES_IRQ, rid, Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Thu Apr 28 12:03:22 2016 (r298738) +++ head/sys/kern/subr_intr.c Thu Apr 28 12:04:12 2016 (r298739) @@ -109,8 +109,6 @@ static struct mtx isrc_table_lock; static struct intr_irqsrc *irq_sources[NIRQ]; u_int irq_next_free; -#define IRQ_INVALID nitems(irq_sources) - /* * XXX - All stuff around struct intr_dev_data is considered as temporary * until better place for storing struct intr_map_data will be find. @@ -138,7 +136,7 @@ static struct intr_dev_data *intr_ddata_ static u_int intr_ddata_first_unused; #define IRQ_DDATA_BASE 10000 -CTASSERT(IRQ_DDATA_BASE > IRQ_INVALID); +CTASSERT(IRQ_DDATA_BASE > nitems(irq_sources)); #ifdef SMP static boolean_t irq_assign_cpu = FALSE; @@ -399,7 +397,7 @@ isrc_free_irq(struct intr_irqsrc *isrc) return (EINVAL); irq_sources[isrc->isrc_irq] = NULL; - isrc->isrc_irq = IRQ_INVALID; /* just to be safe */ + isrc->isrc_irq = INTR_IRQ_INVALID; /* just to be safe */ return (0); } @@ -427,7 +425,7 @@ intr_isrc_register(struct intr_irqsrc *i bzero(isrc, sizeof(struct intr_irqsrc)); isrc->isrc_dev = dev; - isrc->isrc_irq = IRQ_INVALID; /* just to be safe */ + isrc->isrc_irq = INTR_IRQ_INVALID; /* just to be safe */ isrc->isrc_flags = flags; va_start(ap, fmt); @@ -560,7 +558,7 @@ intr_acpi_map_irq(device_t dev, u_int ir ddata = intr_ddata_alloc(0); if (ddata == NULL) - return (0xFFFFFFFF); /* no space left */ + return (INTR_IRQ_INVALID); /* no space left */ ddata->idd_dev = dev; ddata->idd_data.type = INTR_MAP_DATA_ACPI; @@ -585,7 +583,7 @@ intr_fdt_map_irq(phandle_t node, pcell_t cellsize = ncells * sizeof(*cells); ddata = intr_ddata_alloc(cellsize); if (ddata == NULL) - return (0xFFFFFFFF); /* no space left */ + return (INTR_IRQ_INVALID); /* no space left */ ddata->idd_xref = (intptr_t)node; ddata->idd_data.type = INTR_MAP_DATA_FDT; @@ -607,7 +605,7 @@ intr_gpio_map_irq(device_t dev, u_int pi ddata = intr_ddata_alloc(0); if (ddata == NULL) - return (0xFFFFFFFF); /* no space left */ + return (INTR_IRQ_INVALID); /* no space left */ ddata->idd_dev = dev; ddata->idd_data.type = INTR_MAP_DATA_GPIO; Modified: head/sys/sys/intr.h ============================================================================== --- head/sys/sys/intr.h Thu Apr 28 12:03:22 2016 (r298738) +++ head/sys/sys/intr.h Thu Apr 28 12:04:12 2016 (r298739) @@ -32,6 +32,8 @@ #include +#define INTR_IRQ_INVALID 0xFFFFFFFF + enum intr_map_data_type { INTR_MAP_DATA_ACPI, INTR_MAP_DATA_FDT, From owner-svn-src-head@freebsd.org Thu Apr 28 12:05:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0510EB1D1F0; Thu, 28 Apr 2016 12:05:09 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6FA11FFF; Thu, 28 Apr 2016 12:05:08 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3SC57G3011166; Thu, 28 Apr 2016 12:05:07 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SC57G9011165; Thu, 28 Apr 2016 12:05:07 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201604281205.u3SC57G9011165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 28 Apr 2016 12:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298740 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 12:05:09 -0000 Author: mmel Date: Thu Apr 28 12:05:07 2016 New Revision: 298740 URL: https://svnweb.freebsd.org/changeset/base/298740 Log: ARM: Use kernel pmap as intermediate mapping in context switch. On ARM, we can directly switch between translation tables only when the size of the mapping for any given virtual address is the same in the old and new translation tables. The load of new TTB and subsequent TLB flush is not atomic operation. So speculative page table walk can load TLB entry from new mapping while rest of TLB entries are still the old ones. In worst case, this can lead to situation when TLB cache can contain multiple matching TLB entries. One (from old mapping) L2 entry for VA + 4k and one (from new mapping) L1 entry for VA. Thus, we must switch to kernel pmap translation table as intermediate mapping because all sizes of these (old pmap and kernel pmap) mappings are same (or unmapped). The same is true for switch from kernel pmap translation table to new pmap one. Modified: head/sys/arm/arm/swtch-v6.S Modified: head/sys/arm/arm/swtch-v6.S ============================================================================== --- head/sys/arm/arm/swtch-v6.S Thu Apr 28 12:04:12 2016 (r298739) +++ head/sys/arm/arm/swtch-v6.S Thu Apr 28 12:05:07 2016 (r298740) @@ -114,25 +114,37 @@ __FBSDID("$FreeBSD$"); .Lblocked_lock: .word _C_LABEL(blocked_lock) -ENTRY(cpu_context_switch) /* QQQ: What about macro instead of function? */ +ENTRY(cpu_context_switch) DSB - mcr CP15_TTBR0(r0) /* set the new TTB */ + /* + * We can directly switch between translation tables only when the + * size of the mapping for any given virtual address is the same + * in the old and new translation tables. + * Thus, we must switch to kernel pmap translation table as + * intermediate mapping because all sizes of these mappings are same + * (or unmapped). The same is true for switch from kernel pmap + * translation table to new pmap one. + */ + mov r2, #(CPU_ASID_KERNEL) + ldr r1, =(_C_LABEL(pmap_kern_ttb)) + ldr r1, [r1] + mcr CP15_TTBR0(r1) /* switch to kernel TTB */ + ISB + mcr CP15_TLBIASID(r2) /* flush not global TLBs */ + DSB + mcr CP15_TTBR0(r0) /* switch to new TTB */ ISB - mov r0, #(CPU_ASID_KERNEL) - mcr CP15_TLBIASID(r0) /* flush not global TLBs */ + /* + * We must flush not global TLBs again because PT2MAP mapping + * is different. + */ + mcr CP15_TLBIASID(r2) /* flush not global TLBs */ /* * Flush entire Branch Target Cache because of the branch predictor * is not architecturally invisible. See ARM Architecture Reference * Manual ARMv7-A and ARMv7-R edition, page B2-1264(65), Branch * predictors and Requirements for branch predictor maintenance * operations sections. - * - * QQQ: The predictor is virtually addressed and holds virtual target - * addresses. Therefore, if mapping is changed, the predictor cache - * must be flushed.The flush is part of entire i-cache invalidation - * what is always called when code mapping is changed. So herein, - * it's the only place where standalone predictor flush must be - * executed in kernel (except self modifying code case). */ mcr CP15_BPIALL /* flush entire Branch Target Cache */ DSB From owner-svn-src-head@freebsd.org Thu Apr 28 12:25:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F14E0B1D6DC; Thu, 28 Apr 2016 12:24:59 +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 C1C161CB6; Thu, 28 Apr 2016 12:24:59 +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 u3SCOwja017656; Thu, 28 Apr 2016 12:24:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SCOwBQ017655; Thu, 28 Apr 2016 12:24:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604281224.u3SCOwBQ017655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 28 Apr 2016 12:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298741 - head/contrib/jemalloc/include/jemalloc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 12:25:00 -0000 Author: andrew Date: Thu Apr 28 12:24:58 2016 New Revision: 298741 URL: https://svnweb.freebsd.org/changeset/base/298741 Log: Stop using sbrk(2) with malloc. This helps reduce the number of places within the tree where we call this legacy interface. Reviewed by: jasone Obtained from: brooks Sponsored by: ABT Systems Ltd Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Modified: head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Apr 28 12:05:07 2016 (r298740) +++ head/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Apr 28 12:24:58 2016 (r298741) @@ -8,6 +8,8 @@ #define JEMALLOC_DEBUG #endif +#undef JEMALLOC_DSS + /* * The following are architecture-dependent, so conditionally define them for * each supported architecture. From owner-svn-src-head@freebsd.org Thu Apr 28 13:00:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A42FB1DD2F; Thu, 28 Apr 2016 13:00:41 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FE5C19CD; Thu, 28 Apr 2016 13:00:41 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3SD0ebb026869; Thu, 28 Apr 2016 13:00:40 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SD0eDR026868; Thu, 28 Apr 2016 13:00:40 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201604281300.u3SD0eDR026868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 28 Apr 2016 13:00:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298742 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 13:00:41 -0000 Author: mmel Date: Thu Apr 28 13:00:40 2016 New Revision: 298742 URL: https://svnweb.freebsd.org/changeset/base/298742 Log: TEGRA: Add interrupt support for Tegra GPIO controller. Modified: head/sys/arm/nvidia/tegra_gpio.c Modified: head/sys/arm/nvidia/tegra_gpio.c ============================================================================== --- head/sys/arm/nvidia/tegra_gpio.c Thu Apr 28 12:24:58 2016 (r298741) +++ head/sys/arm/nvidia/tegra_gpio.c Thu Apr 28 13:00:40 2016 (r298742) @@ -30,21 +30,20 @@ __FBSDID("$FreeBSD$"); /* * Tegra GPIO driver. */ -#include -__FBSDID("$FreeBSD$"); - +#include "opt_platform.h" #include #include #include - +#include #include -#include +#include #include #include +#include #include -#include #include +#include #include #include @@ -53,14 +52,15 @@ __FBSDID("$FreeBSD$"); #include #include +#include "pic_if.h" -#define GPIO_LOCK(_sc) mtx_lock(&(_sc)->sc_mtx) -#define GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_mtx) -#define GPIO_LOCK_INIT(_sc) mtx_init(&_sc->sc_mtx, \ - device_get_nameunit(_sc->sc_dev), "tegra_gpio", MTX_DEF) -#define GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->sc_mtx); -#define GPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_OWNED); -#define GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->sc_mtx, MA_NOTOWNED); +#define GPIO_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define GPIO_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define GPIO_LOCK_INIT(_sc) mtx_init(&_sc->mtx, \ + device_get_nameunit(_sc->dev), "tegra_gpio", MTX_DEF) +#define GPIO_LOCK_DESTROY(_sc) mtx_destroy(&_sc->mtx); +#define GPIO_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED); +#define GPIO_ASSERT_UNLOCKED(_sc) mtx_assert(&_sc->mtx, MA_NOTOWNED); #define WR4(_sc, _r, _v) bus_write_4((_sc)->mem_res, (_r), (_v)) #define RD4(_sc, _r) bus_read_4((_sc)->mem_res, (_r)) @@ -87,6 +87,11 @@ __FBSDID("$FreeBSD$"); #define GPIO_INT_STA 0x40 #define GPIO_INT_ENB 0x50 #define GPIO_INT_LVL 0x60 +#define GPIO_INT_LVL_DELTA (1 << 16) +#define GPIO_INT_LVL_EDGE (1 << 8) +#define GPIO_INT_LVL_HIGH (1 << 0) +#define GPIO_INT_LVL_MASK (GPIO_INT_LVL_DELTA | \ + GPIO_INT_LVL_EDGE | GPIO_INT_LVL_HIGH) #define GPIO_INT_CLR 0x70 #define GPIO_MSK_CNF 0x80 #define GPIO_MSK_OE 0x90 @@ -102,19 +107,33 @@ char *tegra_gpio_port_names[] = { "M", "N", "O", "P", /* Bank 3 */ "Q", "R", "S", "T", /* Bank 4 */ "U", "V", "W", "X", /* Bank 5 */ - "Y", "Z", "AA", "BB", /* Bank 5 */ - "CC", "DD", "EE" /* Bank 5 */ + "Y", "Z", "AA", "BB", /* Bank 6 */ + "CC", "DD", "EE" /* Bank 7 */ +}; + +struct tegra_gpio_irqsrc { + struct intr_irqsrc isrc; + u_int irq; + uint32_t cfgreg; +}; + +struct tegra_gpio_softc; +struct tegra_gpio_irq_cookie { + struct tegra_gpio_softc *sc; + int bank_num; }; struct tegra_gpio_softc { device_t dev; - device_t sc_busdev; - struct mtx sc_mtx; + device_t busdev; + struct mtx mtx; struct resource *mem_res; - struct resource *irq_res; - void *gpio_ih; + struct resource *irq_res[GPIO_NUM_BANKS]; + void *irq_ih[GPIO_NUM_BANKS]; + struct tegra_gpio_irq_cookie irq_cookies[GPIO_NUM_BANKS]; int gpio_npins; struct gpio_pin gpio_pins[NGPIO]; + struct tegra_gpio_irqsrc *isrcs; }; static struct ofw_compat_data compat_data[] = { @@ -122,6 +141,11 @@ static struct ofw_compat_data compat_dat {NULL, 0} }; +/* -------------------------------------------------------------------------- + * + * GPIO + * + */ static inline void gpio_write_masked(struct tegra_gpio_softc *sc, bus_size_t reg, struct gpio_pin *pin, uint32_t val) @@ -134,6 +158,7 @@ gpio_write_masked(struct tegra_gpio_soft tmp |= (val & 1) << bit; /* value */ bus_write_4(sc->mem_res, reg + GPIO_REGNUM(pin->gp_pin), tmp); } + static inline uint32_t gpio_read(struct tegra_gpio_softc *sc, bus_size_t reg, struct gpio_pin *pin) { @@ -170,7 +195,7 @@ tegra_gpio_get_bus(device_t dev) struct tegra_gpio_softc *sc; sc = device_get_softc(dev); - return (sc->sc_busdev); + return (sc->busdev); } static int @@ -308,32 +333,363 @@ tegra_gpio_pin_toggle(device_t dev, uint return (0); } +/* -------------------------------------------------------------------------- + * + * Interrupts + * + */ +static inline void +intr_write_masked(struct tegra_gpio_softc *sc, bus_addr_t reg, + struct tegra_gpio_irqsrc *tgi, uint32_t val) +{ + uint32_t tmp; + int bit; + + bit = GPIO_BIT(tgi->irq); + tmp = 0x100 << bit; /* mask */ + tmp |= (val & 1) << bit; /* value */ + bus_write_4(sc->mem_res, reg + GPIO_REGNUM(tgi->irq), tmp); +} + +static inline void +intr_write_modify(struct tegra_gpio_softc *sc, bus_addr_t reg, + struct tegra_gpio_irqsrc *tgi, uint32_t val, uint32_t mask) +{ + uint32_t tmp; + int bit; + + bit = GPIO_BIT(tgi->irq); + GPIO_LOCK(sc); + tmp = bus_read_4(sc->mem_res, reg + GPIO_REGNUM(tgi->irq)); + tmp &= ~(mask << bit); + tmp |= val << bit; + bus_write_4(sc->mem_res, reg + GPIO_REGNUM(tgi->irq), tmp); + GPIO_UNLOCK(sc); +} + +static inline void +tegra_gpio_isrc_mask(struct tegra_gpio_softc *sc, + struct tegra_gpio_irqsrc *tgi, uint32_t val) +{ + + intr_write_masked(sc, GPIO_MSK_INT_ENB, tgi, val); +} + +static inline void +tegra_gpio_isrc_eoi(struct tegra_gpio_softc *sc, + struct tegra_gpio_irqsrc *tgi) +{ + + intr_write_masked(sc, GPIO_INT_CLR, tgi, 1); +} + +static inline bool +tegra_gpio_isrc_is_level(struct tegra_gpio_irqsrc *tgi) +{ + + return (tgi->cfgreg & GPIO_INT_LVL_EDGE); +} + static int tegra_gpio_intr(void *arg) { + u_int irq, i, j, val, basepin; struct tegra_gpio_softc *sc; - uint32_t val; - int i; - - sc = arg; - for (i = 0; i < NGPIO; i += GPIO_PINS_IN_REG) { - /* Clear interrupt */ - val = bus_read_4(sc->mem_res, GPIO_INT_STA + GPIO_REGNUM(i)); - val &= bus_read_4(sc->mem_res, GPIO_INT_ENB + GPIO_REGNUM(i)); - bus_write_4(sc->mem_res, GPIO_INT_CLR + GPIO_REGNUM(i), val); + struct trapframe *tf; + struct tegra_gpio_irqsrc *tgi; + struct tegra_gpio_irq_cookie *cookie; + + cookie = (struct tegra_gpio_irq_cookie *)arg; + sc = cookie->sc; + tf = curthread->td_intr_frame; + + for (i = 0; i < GPIO_REGS_IN_BANK; i++) { + basepin = cookie->bank_num * GPIO_REGS_IN_BANK * + GPIO_PINS_IN_REG + i * GPIO_PINS_IN_REG; + + val = bus_read_4(sc->mem_res, GPIO_INT_STA + + GPIO_REGNUM(basepin)); + val &= bus_read_4(sc->mem_res, GPIO_INT_ENB + + GPIO_REGNUM(basepin)); /* Interrupt handling */ -#ifdef not_yet for (j = 0; j < GPIO_PINS_IN_REG; j++) { - if (val & (1 << j)) - handle_irq(i + j); + if ((val & (1 << j)) == 0) + continue; + irq = basepin + j; + tgi = &sc->isrcs[irq]; + if (!tegra_gpio_isrc_is_level(tgi)) + tegra_gpio_isrc_eoi(sc, tgi); + if (intr_isrc_dispatch(&tgi->isrc, tf) != 0) { + tegra_gpio_isrc_mask(sc, tgi, 0); + if (tegra_gpio_isrc_is_level(tgi)) + tegra_gpio_isrc_eoi(sc, tgi); + device_printf(sc->dev, + "Stray irq %u disabled\n", irq); + } + } - */ -#endif } + return (FILTER_HANDLED); } static int +tegra_gpio_pic_attach(struct tegra_gpio_softc *sc) +{ + int error; + uint32_t irq; + const char *name; + + sc->isrcs = malloc(sizeof(*sc->isrcs) * sc->gpio_npins, M_DEVBUF, + M_WAITOK | M_ZERO); + + name = device_get_nameunit(sc->dev); + for (irq = 0; irq < sc->gpio_npins; irq++) { + sc->isrcs[irq].irq = irq; + sc->isrcs[irq].cfgreg = 0; + error = intr_isrc_register(&sc->isrcs[irq].isrc, + sc->dev, 0, "%s,%u", name, irq); + if (error != 0) + return (error); /* XXX deregister ISRCs */ + } + return (intr_pic_register(sc->dev, + OF_xref_from_node(ofw_bus_get_node(sc->dev)))); +} + +static int +tegra_gpio_pic_detach(struct tegra_gpio_softc *sc) +{ + + /* + * There has not been established any procedure yet + * how to detach PIC from living system correctly. + */ + device_printf(sc->dev, "%s: not implemented yet\n", __func__); + return (EBUSY); +} + + +static void +tegra_gpio_pic_disable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct tegra_gpio_softc *sc; + struct tegra_gpio_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_gpio_irqsrc *)isrc; + tegra_gpio_isrc_mask(sc, tgi, 0); +} + +static void +tegra_gpio_pic_enable_intr(device_t dev, struct intr_irqsrc *isrc) +{ + struct tegra_gpio_softc *sc; + struct tegra_gpio_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_gpio_irqsrc *)isrc; + tegra_gpio_isrc_mask(sc, tgi, 1); +} + +static int +tegra_gpio_pic_map_fdt(struct tegra_gpio_softc *sc, u_int ncells, + pcell_t *cells, u_int *irqp, uint32_t *regp) +{ + uint32_t reg; + + /* + * The first cell is the interrupt number. + * The second cell is used to specify flags: + * bits[3:0] trigger type and level flags: + * 1 = low-to-high edge triggered. + * 2 = high-to-low edge triggered. + * 4 = active high level-sensitive. + * 8 = active low level-sensitive. + */ + if (ncells != 2 || cells[0] >= sc->gpio_npins) + return (EINVAL); + + /* + * All interrupt types could be set for an interrupt at one moment. + * At least, the combination of 'low-to-high' and 'high-to-low' edge + * triggered interrupt types can make a sense. + */ + if (cells[1] == 1) + reg = GPIO_INT_LVL_EDGE | GPIO_INT_LVL_HIGH; + else if (cells[1] == 2) + reg = GPIO_INT_LVL_EDGE; + else if (cells[1] == 3) + reg = GPIO_INT_LVL_EDGE | GPIO_INT_LVL_DELTA; + else if (cells[1] == 4) + reg = GPIO_INT_LVL_HIGH; + else if (cells[1] == 8) + reg = 0; + else + return (EINVAL); + + *irqp = cells[0]; + if (regp != NULL) + *regp = reg; + return (0); +} + + +static int +tegra_gpio_pic_map_gpio(struct tegra_gpio_softc *sc, u_int gpio_pin_num, + u_int gpio_pin_flags, u_int intr_mode, u_int *irqp, uint32_t *regp) +{ + + uint32_t reg; + + if (gpio_pin_num >= sc->gpio_npins) + return (EINVAL); + switch (intr_mode) { + case GPIO_INTR_CONFORM: + case GPIO_INTR_LEVEL_LOW: + reg = 0; + break; + case GPIO_INTR_LEVEL_HIGH: + reg = GPIO_INT_LVL_HIGH; + break; + case GPIO_INTR_EDGE_RISING: + reg = GPIO_INT_LVL_EDGE | GPIO_INT_LVL_HIGH; + break; + case GPIO_INTR_EDGE_FALLING: + reg = GPIO_INT_LVL_EDGE; + break; + case GPIO_INTR_EDGE_BOTH: + reg = GPIO_INT_LVL_EDGE | GPIO_INT_LVL_DELTA; + break; + default: + return (EINVAL); + } + *irqp = gpio_pin_num; + if (regp != NULL) + *regp = reg; + return (0); +} + +static int +tegra_gpio_pic_map_intr(device_t dev, struct intr_map_data *data, + struct intr_irqsrc **isrcp) +{ + int rv; + u_int irq; + struct tegra_gpio_softc *sc; + + sc = device_get_softc(dev); + + if (data->type == INTR_MAP_DATA_FDT) + rv = tegra_gpio_pic_map_fdt(sc, data->fdt.ncells, + data->fdt.cells, &irq, NULL); + else if (data->type == INTR_MAP_DATA_GPIO) + rv = tegra_gpio_pic_map_gpio(sc, data->gpio.gpio_pin_num, + data->gpio.gpio_pin_flags, data->gpio.gpio_intr_mode, + &irq, NULL); + else + return (ENOTSUP); + + if (rv == 0) + *isrcp = &sc->isrcs[irq].isrc; + return (rv); +} + +static void +tegra_gpio_pic_post_filter(device_t dev, struct intr_irqsrc *isrc) +{ + struct tegra_gpio_softc *sc; + struct tegra_gpio_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_gpio_irqsrc *)isrc; + if (tegra_gpio_isrc_is_level(tgi)) + tegra_gpio_isrc_eoi(sc, tgi); +} + +static void +tegra_gpio_pic_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct tegra_gpio_softc *sc; + struct tegra_gpio_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_gpio_irqsrc *)isrc; + tegra_gpio_isrc_mask(sc, tgi, 1); +} + +static void +tegra_gpio_pic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + struct tegra_gpio_softc *sc; + struct tegra_gpio_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_gpio_irqsrc *)isrc; + + tegra_gpio_isrc_mask(sc, tgi, 0); + if (tegra_gpio_isrc_is_level(tgi)) + tegra_gpio_isrc_eoi(sc, tgi); +} + +static int +tegra_gpio_pic_setup_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + u_int irq; + uint32_t cfgreg; + int rv; + struct tegra_gpio_softc *sc; + struct tegra_gpio_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_gpio_irqsrc *)isrc; + + if (data == NULL) + return (ENOTSUP); + + /* Get and check config for an interrupt. */ + if (data->type == INTR_MAP_DATA_FDT) + rv = tegra_gpio_pic_map_fdt(sc, data->fdt.ncells, + data->fdt.cells, &irq, &cfgreg); + else if (data->type == INTR_MAP_DATA_GPIO) + rv = tegra_gpio_pic_map_gpio(sc, data->gpio.gpio_pin_num, + data->gpio.gpio_pin_flags, data->gpio.gpio_intr_mode, + &irq, &cfgreg); + else + return (ENOTSUP); + if (rv != 0) + return (EINVAL); + + /* + * If this is a setup for another handler, + * only check that its configuration match. + */ + if (isrc->isrc_handlers != 0) + return (tgi->cfgreg == cfgreg ? 0 : EINVAL); + + tgi->cfgreg = cfgreg; + intr_write_modify(sc, GPIO_INT_LVL, tgi, cfgreg, GPIO_INT_LVL_MASK); + tegra_gpio_pic_enable_intr(dev, isrc); + + return (0); +} + +static int +tegra_gpio_pic_teardown_intr(device_t dev, struct intr_irqsrc *isrc, + struct resource *res, struct intr_map_data *data) +{ + struct tegra_gpio_softc *sc; + struct tegra_gpio_irqsrc *tgi; + + sc = device_get_softc(dev); + tgi = (struct tegra_gpio_irqsrc *)isrc; + + if (isrc->isrc_handlers == 0) + tegra_gpio_isrc_mask(sc, tgi, 0); + return (0); +} + +static int tegra_gpio_probe(device_t dev) { @@ -347,23 +703,39 @@ tegra_gpio_probe(device_t dev) return (ENXIO); } +/* -------------------------------------------------------------------------- + * + * Bus + * + */ static int tegra_gpio_detach(device_t dev) { struct tegra_gpio_softc *sc; + int i; sc = device_get_softc(dev); - KASSERT(mtx_initialized(&sc->sc_mtx), ("gpio mutex not initialized")); + KASSERT(mtx_initialized(&sc->mtx), ("gpio mutex not initialized")); + + for (i = 0; i < GPIO_NUM_BANKS; i++) { + if (sc->irq_ih[i] != NULL) + bus_teardown_intr(dev, sc->irq_res[i], sc->irq_ih[i]); + } + + if (sc->isrcs != NULL) + tegra_gpio_pic_detach(sc); gpiobus_detach_bus(dev); - if (sc->gpio_ih != NULL) - bus_teardown_intr(dev, sc->irq_res, sc->gpio_ih); - if (sc->irq_res != NULL) - bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); + + for (i = 0; i < GPIO_NUM_BANKS; i++) { + if (sc->irq_res[i] != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, + sc->irq_res[i]); + } if (sc->mem_res != NULL) bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); - mtx_destroy(&sc->sc_mtx); + GPIO_LOCK_DESTROY(sc); return(0); } @@ -375,7 +747,8 @@ tegra_gpio_attach(device_t dev) int i, rid; sc = device_get_softc(dev); - mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + sc->dev = dev; + GPIO_LOCK_INIT(sc); /* Allocate bus_space resources. */ rid = 0; @@ -387,28 +760,13 @@ tegra_gpio_attach(device_t dev) return (ENXIO); } - rid = 0; - sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); - if (sc->irq_res == NULL) { - device_printf(dev, "Cannot allocate IRQ resources\n"); - tegra_gpio_detach(dev); - return (ENXIO); - } - - sc->dev = dev; sc->gpio_npins = NGPIO; - - if ((bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC, - tegra_gpio_intr, NULL, sc, &sc->gpio_ih))) { - device_printf(dev, - "WARNING: unable to register interrupt handler\n"); - tegra_gpio_detach(dev); - return (ENXIO); - } - for (i = 0; i < sc->gpio_npins; i++) { sc->gpio_pins[i].gp_pin = i; - sc->gpio_pins[i].gp_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT; + sc->gpio_pins[i].gp_caps = GPIO_PIN_INPUT | GPIO_PIN_OUTPUT | + GPIO_INTR_LEVEL_LOW | GPIO_INTR_LEVEL_HIGH | + GPIO_INTR_EDGE_RISING | GPIO_INTR_EDGE_FALLING | + GPIO_INTR_EDGE_BOTH; snprintf(sc->gpio_pins[i].gp_name, GPIOMAXNAME, "gpio_%s.%d", tegra_gpio_port_names[ i / GPIO_PINS_IN_REG], i % GPIO_PINS_IN_REG); @@ -417,8 +775,43 @@ tegra_gpio_attach(device_t dev) GPIO_PIN_OUTPUT : GPIO_PIN_INPUT; } - sc->sc_busdev = gpiobus_attach_bus(dev); - if (sc->sc_busdev == NULL) { + /* Init interrupt related registes. */ + for (i = 0; i < sc->gpio_npins; i += GPIO_PINS_IN_REG) { + bus_write_4(sc->mem_res, GPIO_INT_ENB + GPIO_REGNUM(i), 0); + bus_write_4(sc->mem_res, GPIO_INT_STA + GPIO_REGNUM(i), 0xFF); + bus_write_4(sc->mem_res, GPIO_INT_CLR + GPIO_REGNUM(i), 0xFF); + } + + /* Allocate interrupts. */ + for (i = 0; i < GPIO_NUM_BANKS; i++) { + sc->irq_cookies[i].sc = sc; + sc->irq_cookies[i].bank_num = i; + rid = i; + sc->irq_res[i] = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_ACTIVE); + if (sc->irq_res[i] == NULL) { + device_printf(dev, "Cannot allocate IRQ resources\n"); + tegra_gpio_detach(dev); + return (ENXIO); + } + if ((bus_setup_intr(dev, sc->irq_res[i], + INTR_TYPE_MISC | INTR_MPSAFE, tegra_gpio_intr, NULL, + &sc->irq_cookies[i], &sc->irq_ih[i]))) { + device_printf(dev, + "WARNING: unable to register interrupt handler\n"); + tegra_gpio_detach(dev); + return (ENXIO); + } + } + + if (tegra_gpio_pic_attach(sc) != 0) { + device_printf(dev, "WARNING: unable to attach PIC\n"); + tegra_gpio_detach(dev); + return (ENXIO); + } + + sc->busdev = gpiobus_attach_bus(dev); + if (sc->busdev == NULL) { tegra_gpio_detach(dev); return (ENXIO); } @@ -451,6 +844,16 @@ static device_method_t tegra_gpio_method DEVMETHOD(device_attach, tegra_gpio_attach), DEVMETHOD(device_detach, tegra_gpio_detach), + /* Interrupt controller interface */ + DEVMETHOD(pic_disable_intr, tegra_gpio_pic_disable_intr), + DEVMETHOD(pic_enable_intr, tegra_gpio_pic_enable_intr), + DEVMETHOD(pic_map_intr, tegra_gpio_pic_map_intr), + DEVMETHOD(pic_setup_intr, tegra_gpio_pic_setup_intr), + DEVMETHOD(pic_teardown_intr, tegra_gpio_pic_teardown_intr), + DEVMETHOD(pic_post_filter, tegra_gpio_pic_post_filter), + DEVMETHOD(pic_post_ithread, tegra_gpio_pic_post_ithread), + DEVMETHOD(pic_pre_ithread, tegra_gpio_pic_pre_ithread), + /* GPIO protocol */ DEVMETHOD(gpio_get_bus, tegra_gpio_get_bus), DEVMETHOD(gpio_pin_max, tegra_gpio_pin_max), From owner-svn-src-head@freebsd.org Thu Apr 28 13:27:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4248B1F265; Thu, 28 Apr 2016 13:27:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8173B171B; Thu, 28 Apr 2016 13:27:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3SDRCDv035712; Thu, 28 Apr 2016 13:27:12 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SDRCIa035707; Thu, 28 Apr 2016 13:27:12 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201604281327.u3SDRCIa035707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 28 Apr 2016 13:27:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298743 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 13:27:13 -0000 Author: rrs Date: Thu Apr 28 13:27:12 2016 New Revision: 298743 URL: https://svnweb.freebsd.org/changeset/base/298743 Log: This cleans up the timers code in TCP to start using the new async_drain functionality. This as been tested in NF as well as by Verisign. Still to do in here is to remove all the old flags. They are currently left being maintained but probably are no longer needed. Sponsored by: Netflix Inc. Differential Revision: http://reviews.freebsd.org/D5924 Modified: head/sys/netinet/tcp_stacks/fastpath.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Thu Apr 28 13:00:40 2016 (r298742) +++ head/sys/netinet/tcp_stacks/fastpath.c Thu Apr 28 13:27:12 2016 (r298743) @@ -2386,7 +2386,6 @@ struct tcp_function_block __tcp_fastslow NULL, NULL, NULL, - NULL, 0, 0 @@ -2403,7 +2402,6 @@ struct tcp_function_block __tcp_fastack NULL, NULL, NULL, - NULL, 0, 0 }; Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Apr 28 13:00:40 2016 (r298742) +++ head/sys/netinet/tcp_subr.c Thu Apr 28 13:27:12 2016 (r298743) @@ -244,7 +244,6 @@ static struct inpcb *tcp_mtudisc_notify( static void tcp_mtudisc(struct inpcb *, int); static char * tcp_log_addr(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, const void *ip6hdr); -static void tcp_timer_discard(struct tcpcb *, uint32_t); static struct tcp_function_block tcp_def_funcblk = { @@ -258,7 +257,6 @@ static struct tcp_function_block tcp_def NULL, NULL, NULL, - NULL, 0, 0 }; @@ -528,7 +526,6 @@ register_tcp_functions(struct tcp_functi return (EINVAL); } if (blk->tfb_tcp_timer_stop_all || - blk->tfb_tcp_timers_left || blk->tfb_tcp_timer_activate || blk->tfb_tcp_timer_active || blk->tfb_tcp_timer_stop) { @@ -537,7 +534,6 @@ register_tcp_functions(struct tcp_functi * must have them all. */ if ((blk->tfb_tcp_timer_stop_all == NULL) || - (blk->tfb_tcp_timers_left == NULL) || (blk->tfb_tcp_timer_activate == NULL) || (blk->tfb_tcp_timer_active == NULL) || (blk->tfb_tcp_timer_stop == NULL)) { @@ -1343,13 +1339,21 @@ tcp_discardcb(struct tcpcb *tp) * callout, and the last discard function called will take care of * deleting the tcpcb. */ + tp->t_timers->tt_draincnt = 0; tcp_timer_stop(tp, TT_REXMT); tcp_timer_stop(tp, TT_PERSIST); tcp_timer_stop(tp, TT_KEEP); tcp_timer_stop(tp, TT_2MSL); tcp_timer_stop(tp, TT_DELACK); if (tp->t_fb->tfb_tcp_timer_stop_all) { - /* Call the stop-all function of the methods */ + /* + * Call the stop-all function of the methods, + * this function should call the tcp_timer_stop() + * method with each of the function specific timeouts. + * That stop will be called via the tfb_tcp_timer_stop() + * which should use the async drain function of the + * callout system (see tcp_var.h). + */ tp->t_fb->tfb_tcp_timer_stop_all(tp); } @@ -1434,13 +1438,8 @@ tcp_discardcb(struct tcpcb *tp) CC_ALGO(tp) = NULL; inp->inp_ppcb = NULL; - if ((tp->t_timers->tt_flags & TT_MASK) == 0) { + if (tp->t_timers->tt_draincnt == 0) { /* We own the last reference on tcpcb, let's free it. */ - if ((tp->t_fb->tfb_tcp_timers_left) && - (tp->t_fb->tfb_tcp_timers_left(tp))) { - /* Some fb timers left running! */ - return; - } if (tp->t_fb->tfb_tcp_fb_fini) (*tp->t_fb->tfb_tcp_fb_fini)(tp); refcount_release(&tp->t_fb->tfb_refcnt); @@ -1453,45 +1452,12 @@ tcp_discardcb(struct tcpcb *tp) } void -tcp_timer_2msl_discard(void *xtp) -{ - - tcp_timer_discard((struct tcpcb *)xtp, TT_2MSL); -} - -void -tcp_timer_keep_discard(void *xtp) -{ - - tcp_timer_discard((struct tcpcb *)xtp, TT_KEEP); -} - -void -tcp_timer_persist_discard(void *xtp) -{ - - tcp_timer_discard((struct tcpcb *)xtp, TT_PERSIST); -} - -void -tcp_timer_rexmt_discard(void *xtp) -{ - - tcp_timer_discard((struct tcpcb *)xtp, TT_REXMT); -} - -void -tcp_timer_delack_discard(void *xtp) -{ - - tcp_timer_discard((struct tcpcb *)xtp, TT_DELACK); -} - -void -tcp_timer_discard(struct tcpcb *tp, uint32_t timer_type) +tcp_timer_discard(void *ptp) { struct inpcb *inp; - + struct tcpcb *tp; + + tp = (struct tcpcb *)ptp; CURVNET_SET(tp->t_vnet); INP_INFO_RLOCK(&V_tcbinfo); inp = tp->t_inpcb; @@ -1500,16 +1466,9 @@ tcp_timer_discard(struct tcpcb *tp, uint INP_WLOCK(inp); KASSERT((tp->t_timers->tt_flags & TT_STOPPED) != 0, ("%s: tcpcb has to be stopped here", __func__)); - KASSERT((tp->t_timers->tt_flags & timer_type) != 0, - ("%s: discard callout should be running", __func__)); - tp->t_timers->tt_flags &= ~timer_type; - if ((tp->t_timers->tt_flags & TT_MASK) == 0) { + tp->t_timers->tt_draincnt--; + if (tp->t_timers->tt_draincnt == 0) { /* We own the last reference on this tcpcb, let's free it. */ - if ((tp->t_fb->tfb_tcp_timers_left) && - (tp->t_fb->tfb_tcp_timers_left(tp))) { - /* Some fb timers left running! */ - goto leave; - } if (tp->t_fb->tfb_tcp_fb_fini) (*tp->t_fb->tfb_tcp_fb_fini)(tp); refcount_release(&tp->t_fb->tfb_refcnt); @@ -1521,7 +1480,6 @@ tcp_timer_discard(struct tcpcb *tp, uint return; } } -leave: INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Thu Apr 28 13:00:40 2016 (r298742) +++ head/sys/netinet/tcp_timer.c Thu Apr 28 13:27:12 2016 (r298743) @@ -927,7 +927,6 @@ void tcp_timer_stop(struct tcpcb *tp, uint32_t timer_type) { struct callout *t_callout; - timeout_t *f_callout; uint32_t f_reset; tp->t_timers->tt_flags |= TT_STOPPED; @@ -935,27 +934,22 @@ tcp_timer_stop(struct tcpcb *tp, uint32_ switch (timer_type) { case TT_DELACK: t_callout = &tp->t_timers->tt_delack; - f_callout = tcp_timer_delack_discard; f_reset = TT_DELACK_RST; break; case TT_REXMT: t_callout = &tp->t_timers->tt_rexmt; - f_callout = tcp_timer_rexmt_discard; f_reset = TT_REXMT_RST; break; case TT_PERSIST: t_callout = &tp->t_timers->tt_persist; - f_callout = tcp_timer_persist_discard; f_reset = TT_PERSIST_RST; break; case TT_KEEP: t_callout = &tp->t_timers->tt_keep; - f_callout = tcp_timer_keep_discard; f_reset = TT_KEEP_RST; break; case TT_2MSL: t_callout = &tp->t_timers->tt_2msl; - f_callout = tcp_timer_2msl_discard; f_reset = TT_2MSL_RST; break; default: @@ -971,21 +965,13 @@ tcp_timer_stop(struct tcpcb *tp, uint32_ } if (tp->t_timers->tt_flags & timer_type) { - if ((callout_stop(t_callout) > 0) && - (tp->t_timers->tt_flags & f_reset)) { - tp->t_timers->tt_flags &= ~(timer_type | f_reset); - } else { + if (callout_async_drain(t_callout, tcp_timer_discard) == 0) { /* * Can't stop the callout, defer tcpcb actual deletion - * to the last tcp timer discard callout. - * The TT_STOPPED flag will ensure that no tcp timer - * callouts can be restarted on our behalf, and - * past this point currently running callouts waiting - * on inp lock will return right away after the - * classical check for callout reset/stop events: - * callout_pending() || !callout_active() + * to the last one. We do this using the async drain + * function and incrementing the count in */ - callout_reset(t_callout, 1, f_callout, tp); + tp->t_timers->tt_draincnt++; } } } Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Thu Apr 28 13:00:40 2016 (r298742) +++ head/sys/netinet/tcp_timer.h Thu Apr 28 13:27:12 2016 (r298743) @@ -146,7 +146,7 @@ struct tcp_timer { struct callout tt_2msl; /* 2*msl TIME_WAIT timer */ struct callout tt_delack; /* delayed ACK timer */ uint32_t tt_flags; /* Timers flags */ - uint32_t tt_spare; /* TDB */ + uint32_t tt_draincnt; /* Count being drained */ }; /* @@ -193,17 +193,13 @@ extern int tcp_fast_finwait2_recycle; void tcp_timer_init(void); void tcp_timer_2msl(void *xtp); +void tcp_timer_discard(void *); struct tcptw * tcp_tw_2msl_scan(int reuse); /* XXX temporary? */ void tcp_timer_keep(void *xtp); void tcp_timer_persist(void *xtp); void tcp_timer_rexmt(void *xtp); void tcp_timer_delack(void *xtp); -void tcp_timer_2msl_discard(void *xtp); -void tcp_timer_keep_discard(void *xtp); -void tcp_timer_persist_discard(void *xtp); -void tcp_timer_rexmt_discard(void *xtp); -void tcp_timer_delack_discard(void *xtp); void tcp_timer_to_xtimer(struct tcpcb *tp, struct tcp_timer *timer, struct xtcp_timer *xtimer); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Apr 28 13:00:40 2016 (r298742) +++ head/sys/netinet/tcp_var.h Thu Apr 28 13:27:12 2016 (r298743) @@ -106,6 +106,17 @@ struct inpcb; struct sockopt; struct socket; +/* + * If defining the optional tcp_timers, in the + * tfb_tcp_timer_stop call you must use the + * callout_async_drain() function with the + * tcp_timer_discard callback. You should check + * the return of callout_async_drain() and if 0 + * increment tt_draincnt. Since the timer sub-system + * does not know your callbacks you must provide a + * stop_all function that loops through and calls + * tcp_timer_stop() with each of your defined timers. + */ struct tcp_function_block { char tfb_tcp_block_name[TCP_FUNCTION_NAME_LEN_MAX]; int (*tfb_tcp_output)(struct tcpcb *); @@ -120,7 +131,6 @@ struct tcp_function_block { void (*tfb_tcp_fb_fini)(struct tcpcb *); /* Optional timers, must define all if you define one */ int (*tfb_tcp_timer_stop_all)(struct tcpcb *); - int (*tfb_tcp_timers_left)(struct tcpcb *); void (*tfb_tcp_timer_activate)(struct tcpcb *, uint32_t, u_int); int (*tfb_tcp_timer_active)(struct tcpcb *, uint32_t); From owner-svn-src-head@freebsd.org Thu Apr 28 15:13:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B551B1FBD9; Thu, 28 Apr 2016 15:13:51 +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 5BD301158; Thu, 28 Apr 2016 15:13:51 +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 u3SFDoga069464; Thu, 28 Apr 2016 15:13:50 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SFDos4069463; Thu, 28 Apr 2016 15:13:50 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604281513.u3SFDos4069463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 28 Apr 2016 15:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298744 - head/usr.sbin/extattr/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 15:13:51 -0000 Author: asomers Date: Thu Apr 28 15:13:50 2016 New Revision: 298744 URL: https://svnweb.freebsd.org/changeset/base/298744 Log: Add PACKAGE fields to usr.sbin/extattr/tests/Makefile usr.sbin/extattr/tests/Makefile Add boiler plate required by 298107 but omitted by 298483. These two changes passed through CR in parallel. I think this should get the full test suite running in Jenkins again. MFC after: 22 days X-MFC-with: 298483 Sponsored by: Spectra Logic Corp Modified: head/usr.sbin/extattr/tests/Makefile Modified: head/usr.sbin/extattr/tests/Makefile ============================================================================== --- head/usr.sbin/extattr/tests/Makefile Thu Apr 28 13:27:12 2016 (r298743) +++ head/usr.sbin/extattr/tests/Makefile Thu Apr 28 15:13:50 2016 (r298744) @@ -1,5 +1,9 @@ # $FreeBSD$ +PACKAGE= tests +FILESGROUPS= TESTS +TESTSPACKAGE= ${PACKAGE} + ATF_TESTS_SH= extattr_test .include From owner-svn-src-head@freebsd.org Thu Apr 28 15:18:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88D6DB1FD04; Thu, 28 Apr 2016 15:18:29 +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 4B5271518; Thu, 28 Apr 2016 15:18:29 +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 u3SFISKE070094; Thu, 28 Apr 2016 15:18:28 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SFISU2070093; Thu, 28 Apr 2016 15:18:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604281518.u3SFISU2070093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Apr 2016 15:18:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298745 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 15:18:29 -0000 Author: pfg Date: Thu Apr 28 15:18:28 2016 New Revision: 298745 URL: https://svnweb.freebsd.org/changeset/base/298745 Log: Small typos. Modified: head/sys/cam/scsi/scsi_all.c Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Apr 28 15:13:50 2016 (r298744) +++ head/sys/cam/scsi/scsi_all.c Thu Apr 28 15:18:28 2016 (r298745) @@ -5505,7 +5505,7 @@ scsi_calc_syncsrate(u_int period_factor) } /* - * Return the SCSI sync parameter that corresponsd to + * Return the SCSI sync parameter that corresponds to * the passed in period in 10ths of ns. */ u_int @@ -5956,7 +5956,7 @@ scsi_parse_transportid_64bit(int proto_i break; default: if (error_str != NULL) { - snprintf(error_str, error_str_len, "%s: unsupoprted " + snprintf(error_str, error_str_len, "%s: unsupported " "protocol %d", __func__, proto_id); } retval = 1; From owner-svn-src-head@freebsd.org Thu Apr 28 15:20:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD318B1FDBF; Thu, 28 Apr 2016 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 7F69318CE; Thu, 28 Apr 2016 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 u3SFK804070202; Thu, 28 Apr 2016 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 u3SFK8aB070201; Thu, 28 Apr 2016 15:20:08 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604281520.u3SFK8aB070201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Apr 2016 15:20:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298746 - head/usr.bin/localedef X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 15:20:09 -0000 Author: pfg Date: Thu Apr 28 15:20:08 2016 New Revision: 298746 URL: https://svnweb.freebsd.org/changeset/base/298746 Log: Small typo. Modified: head/usr.bin/localedef/wide.c Modified: head/usr.bin/localedef/wide.c ============================================================================== --- head/usr.bin/localedef/wide.c Thu Apr 28 15:18:28 2016 (r298745) +++ head/usr.bin/localedef/wide.c Thu Apr 28 15:20:08 2016 (r298746) @@ -92,7 +92,7 @@ static struct { { "EUC-CN", "EUC-CN", 16, towide_euccn, tomb_mbs }, { "eucCN", "EUC-CN", 16, towide_euccn, tomb_mbs }, /* - * Becuase the 3-byte form of EUC-JP use the same leading byte, + * Because the 3-byte form of EUC-JP use the same leading byte, * only 17 bits required to provide unique priorities. (The low * bit of that first byte is set.) By setting this value low, * we can get by with only 3 bytes in the strxfrm expansion. From owner-svn-src-head@freebsd.org Thu Apr 28 15:53:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D4FFB1F766; Thu, 28 Apr 2016 15:53:12 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E21D1CE5; Thu, 28 Apr 2016 15:53:12 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3SFrBRx081873; Thu, 28 Apr 2016 15:53:11 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SFrAIA081868; Thu, 28 Apr 2016 15:53:10 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201604281553.u3SFrAIA081868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 28 Apr 2016 15:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298747 - in head/sys: net netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 15:53:12 -0000 Author: rrs Date: Thu Apr 28 15:53:10 2016 New Revision: 298747 URL: https://svnweb.freebsd.org/changeset/base/298747 Log: Complete the UDP tunneling of ICMP msgs to those protocols interested in having tunneled UDP and finding out about the ICMP (tested by Michael Tuexen with SCTP.. soon to be using this feature). Differential Revision: http://reviews.freebsd.org/D5875 Modified: head/sys/net/if_vxlan.c head/sys/netinet/sctputil.c head/sys/netinet/udp_usrreq.c head/sys/netinet/udp_var.h head/sys/netinet6/udp6_usrreq.c Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Thu Apr 28 15:20:08 2016 (r298746) +++ head/sys/net/if_vxlan.c Thu Apr 28 15:53:10 2016 (r298747) @@ -930,7 +930,7 @@ vxlan_socket_init(struct vxlan_socket *v } error = udp_set_kernel_tunneling(vso->vxlso_sock, - vxlan_rcv_udp_packet, vso); + vxlan_rcv_udp_packet, NULL, vso); if (error) { if_printf(ifp, "cannot set tunneling function: %d\n", error); return (error); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Thu Apr 28 15:20:08 2016 (r298746) +++ head/sys/netinet/sctputil.c Thu Apr 28 15:53:10 2016 (r298747) @@ -6945,7 +6945,7 @@ sctp_over_udp_start(void) } /* Call the special UDP hook. */ if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp4_tun_socket), - sctp_recv_udp_tunneled_packet, NULL))) { + sctp_recv_udp_tunneled_packet, NULL, NULL))) { sctp_over_udp_stop(); return (ret); } @@ -6969,7 +6969,7 @@ sctp_over_udp_start(void) } /* Call the special UDP hook. */ if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp6_tun_socket), - sctp_recv_udp_tunneled_packet, NULL))) { + sctp_recv_udp_tunneled_packet, NULL, NULL))) { sctp_over_udp_stop(); return (ret); } Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Apr 28 15:20:08 2016 (r298746) +++ head/sys/netinet/udp_usrreq.c Thu Apr 28 15:53:10 2016 (r298747) @@ -792,6 +792,21 @@ udp_common_ctlinput(int cmd, struct sock udp_notify(inp, inetctlerrmap[cmd]); } INP_RUNLOCK(inp); + } else { + inp = in_pcblookup(pcbinfo, faddr, uh->uh_dport, + ip->ip_src, uh->uh_sport, + INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, NULL); + if (inp != NULL) { + struct udpcb *up; + + up = intoudpcb(inp); + if (up->u_icmp_func != NULL) { + INP_RUNLOCK(inp); + (*up->u_icmp_func)(cmd, sa, vip, up->u_tun_ctx); + } else { + INP_RUNLOCK(inp); + } + } } } else in_pcbnotifyall(pcbinfo, faddr, inetctlerrmap[cmd], @@ -1748,7 +1763,7 @@ udp_attach(struct socket *so, int proto, #endif /* INET */ int -udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, void *ctx) +udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, udp_tun_icmp_t i, void *ctx) { struct inpcb *inp; struct udpcb *up; @@ -1759,11 +1774,13 @@ udp_set_kernel_tunneling(struct socket * KASSERT(inp != NULL, ("udp_set_kernel_tunneling: inp == NULL")); INP_WLOCK(inp); up = intoudpcb(inp); - if (up->u_tun_func != NULL) { + if ((up->u_tun_func != NULL) || + (up->u_icmp_func != NULL)) { INP_WUNLOCK(inp); return (EBUSY); } up->u_tun_func = f; + up->u_icmp_func = i; up->u_tun_ctx = ctx; INP_WUNLOCK(inp); return (0); Modified: head/sys/netinet/udp_var.h ============================================================================== --- head/sys/netinet/udp_var.h Thu Apr 28 15:20:08 2016 (r298746) +++ head/sys/netinet/udp_var.h Thu Apr 28 15:53:10 2016 (r298747) @@ -55,14 +55,16 @@ struct udpiphdr { struct inpcb; struct mbuf; -typedef void(*udp_tun_func_t)(struct mbuf *, int off, struct inpcb *, +typedef void(*udp_tun_func_t)(struct mbuf *, int, struct inpcb *, const struct sockaddr *, void *); - +typedef void(*udp_tun_icmp_t)(int, struct sockaddr *, void *, void *); + /* * UDP control block; one per udp. */ struct udpcb { udp_tun_func_t u_tun_func; /* UDP kernel tunneling callback. */ + udp_tun_icmp_t u_icmp_func; /* UDP kernel tunneling icmp callback */ u_int u_flags; /* Generic UDP flags. */ uint16_t u_rxcslen; /* Coverage for incoming datagrams. */ uint16_t u_txcslen; /* Coverage for outgoing datagrams. */ @@ -179,7 +181,7 @@ struct inpcb *udp_notify(struct inpcb *i int udp_shutdown(struct socket *so); int udp_set_kernel_tunneling(struct socket *so, udp_tun_func_t f, - void *ctx); + udp_tun_icmp_t i, void *ctx); #endif /* _KERNEL */ Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Thu Apr 28 15:20:08 2016 (r298746) +++ head/sys/netinet6/udp6_usrreq.c Thu Apr 28 15:53:10 2016 (r298747) @@ -553,6 +553,29 @@ udp6_common_ctlinput(int cmd, struct soc bzero(&uh, sizeof(uh)); m_copydata(m, off, sizeof(*uhp), (caddr_t)&uh); + if (!PRC_IS_REDIRECT(cmd)) { + /* Check to see if its tunneled */ + struct inpcb *inp; + inp = in6_pcblookup_mbuf(pcbinfo, &ip6->ip6_src, + uh.uh_sport, &ip6->ip6_dst, uh.uh_dport, + INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, + m->m_pkthdr.rcvif, m); + if (inp != NULL) { + struct udpcb *up; + + up = intoudpcb(inp); + if (up->u_icmp_func) { + /* Yes it is. */ + INP_RUNLOCK(inp); + (*up->u_icmp_func)(cmd, (struct sockaddr *)ip6cp->ip6c_src, + d, up->u_tun_ctx); + return; + } else { + /* Can't find it. */ + INP_RUNLOCK(inp); + } + } + } (void)in6_pcbnotify(pcbinfo, sa, uh.uh_dport, (struct sockaddr *)ip6cp->ip6c_src, uh.uh_sport, cmd, cmdarg, notify); From owner-svn-src-head@freebsd.org Thu Apr 28 17:48:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB40FB1FFA0; Thu, 28 Apr 2016 17:48:53 +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 7C73710ED; Thu, 28 Apr 2016 17:48:53 +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 u3SHmqCC015672; Thu, 28 Apr 2016 17:48:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SHmqpj015671; Thu, 28 Apr 2016 17:48:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604281748.u3SHmqpj015671@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Apr 2016 17:48:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298748 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 17:48:53 -0000 Author: jhb Date: Thu Apr 28 17:48:52 2016 New Revision: 298748 URL: https://svnweb.freebsd.org/changeset/base/298748 Log: Remove a stale reference to the removed RF_TIMESHARE flag. Modified: head/share/man/man9/bus_alloc_resource.9 Modified: head/share/man/man9/bus_alloc_resource.9 ============================================================================== --- head/share/man/man9/bus_alloc_resource.9 Thu Apr 28 15:53:10 2016 (r298747) +++ head/share/man/man9/bus_alloc_resource.9 Thu Apr 28 17:48:52 2016 (r298748) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 23, 2016 +.Dd April 28, 2016 .Dt BUS_ALLOC_RESOURCE 9 .Os .Sh NAME @@ -162,8 +162,6 @@ For example, cannot share IRQs while .Xr cardbus 4 can. -.It Dv RF_TIMESHARE -resource permits time-division sharing. .El .El .Sh RETURN VALUES From owner-svn-src-head@freebsd.org Thu Apr 28 17:50:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 639F3B1F033; Thu, 28 Apr 2016 17:50:17 +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 1CEF2126C; Thu, 28 Apr 2016 17:50:17 +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 u3SHoGsn015775; Thu, 28 Apr 2016 17:50:16 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SHoG1x015773; Thu, 28 Apr 2016 17:50:16 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604281750.u3SHoG1x015773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Apr 2016 17:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298749 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 17:50:17 -0000 Author: jhb Date: Thu Apr 28 17:50:16 2016 New Revision: 298749 URL: https://svnweb.freebsd.org/changeset/base/298749 Log: Document PCI_RES_BUS as a possible resource type. Modified: head/share/man/man9/bus_activate_resource.9 head/share/man/man9/bus_alloc_resource.9 Modified: head/share/man/man9/bus_activate_resource.9 ============================================================================== --- head/share/man/man9/bus_activate_resource.9 Thu Apr 28 17:48:52 2016 (r298748) +++ head/share/man/man9/bus_activate_resource.9 Thu Apr 28 17:50:16 2016 (r298749) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 28, 2003 +.Dd April 28, 2016 .Dt BUS_ACTIVATE_RESOURCE 9 .Os .Sh NAME @@ -65,6 +65,8 @@ The type of resource you want to allocat It is one of: .Pp .Bl -tag -width ".Dv SYS_RES_MEMORY" -compact +.It Dv PCI_RES_BUS +for PCI bus numbers .It Dv SYS_RES_IRQ for IRQs .It Dv SYS_RES_DRQ Modified: head/share/man/man9/bus_alloc_resource.9 ============================================================================== --- head/share/man/man9/bus_alloc_resource.9 Thu Apr 28 17:48:52 2016 (r298748) +++ head/share/man/man9/bus_alloc_resource.9 Thu Apr 28 17:50:16 2016 (r298749) @@ -95,6 +95,8 @@ Before allocation, the resource is owned is the type of resource you want to allocate. It is one of: .Bl -tag -width SYS_RES_MEMORY +.It Dv PCI_RES_BUS +for PCI bus numbers .It Dv SYS_RES_IRQ for IRQs .It Dv SYS_RES_DRQ @@ -111,7 +113,7 @@ For ISA this is an index into an array o for this device by either the PnP mechanism, or via the hints mechanism. For PCCARD, this is an index into the array of resources described by the PC Card's CIS entry. -For PCI, the offset into pci config space which has the BAR to use to access +For PCI, the offset into PCI config space which has the BAR to use to access the resource. The bus methods are free to change the RIDs that they are given as a parameter. You must not depend on the value you gave it earlier. From owner-svn-src-head@freebsd.org Thu Apr 28 17:57:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 823D1B1F21E; Thu, 28 Apr 2016 17:57:18 +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 52DDC181D; Thu, 28 Apr 2016 17:57: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 u3SHvHsm018637; Thu, 28 Apr 2016 17:57:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SHvHeU018636; Thu, 28 Apr 2016 17:57:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604281757.u3SHvHeU018636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 28 Apr 2016 17:57:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298750 - head/usr.sbin/bsnmpd/tools/libbsnmptools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 17:57:18 -0000 Author: ngie Date: Thu Apr 28 17:57:17 2016 New Revision: 298750 URL: https://svnweb.freebsd.org/changeset/base/298750 Log: Use a better idiom for finding UTC prefixed timezones Instead of copy-pasting the string literal for "UTC" 3 times and using strlen, use a static char[3] buffer and sizeof(..). MFC after: 3 days X-MFC with: r298507 Submitted by: kib Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Modified: head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c ============================================================================== --- head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Thu Apr 28 17:50:16 2016 (r298749) +++ head/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c Thu Apr 28 17:57:17 2016 (r298750) @@ -338,8 +338,9 @@ static char * snmp_date2asn_oid(char *str, struct asn_oid *oid) { char *endptr, *ptr; - uint32_t v; + static const char UTC[3] = "UTC"; int32_t saved_errno; + uint32_t v; if (snmp_suboid_append(oid, (asn_subid_t) SNMP_DATETIME_OCTETS) < 0) return (NULL); @@ -440,8 +441,8 @@ snmp_date2asn_oid(char *str, struct asn_ /* 'UTC' - optional */ ptr = endptr + 1; - if (strncmp(ptr, "UTC", strlen("UTC")) == 0) - ptr += strlen("UTC"); + if (strncmp(ptr, UTC, sizeof(UTC)) == 0) + ptr += sizeof(UTC); /* '+/-' */ if (*ptr == '-' || *ptr == '+') { From owner-svn-src-head@freebsd.org Thu Apr 28 18:01:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88AB6B1F3D1; Thu, 28 Apr 2016 18:01:26 +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 52CA61BA0; Thu, 28 Apr 2016 18:01:26 +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 u3SI1PIk021435; Thu, 28 Apr 2016 18:01:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SI1P2Y021434; Thu, 28 Apr 2016 18:01:25 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604281801.u3SI1P2Y021434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Apr 2016 18:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298751 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 18:01:26 -0000 Author: jhb Date: Thu Apr 28 18:01:25 2016 New Revision: 298751 URL: https://svnweb.freebsd.org/changeset/base/298751 Log: Document RF_PREFETCHABLE. Modified: head/share/man/man9/bus_alloc_resource.9 Modified: head/share/man/man9/bus_alloc_resource.9 ============================================================================== --- head/share/man/man9/bus_alloc_resource.9 Thu Apr 28 17:57:17 2016 (r298750) +++ head/share/man/man9/bus_alloc_resource.9 Thu Apr 28 18:01:25 2016 (r298751) @@ -154,6 +154,8 @@ The resource still needs to be activated .Xr bus_activate_resource 9 . .It Dv RF_ACTIVE activate resource atomically. +.It Dv RF_PREFETCHABLE +resource is prefetchable. .It Dv RF_SHAREABLE resource permits contemporaneous sharing. It should always be set unless you know that the resource cannot be shared. From owner-svn-src-head@freebsd.org Thu Apr 28 18:23:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2D53B1F802; Thu, 28 Apr 2016 18:23:19 +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 9AC23187B; Thu, 28 Apr 2016 18:23:19 +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 u3SINI9a027505; Thu, 28 Apr 2016 18:23:18 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SINIE2027504; Thu, 28 Apr 2016 18:23:18 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604281823.u3SINIE2027504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Apr 2016 18:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298752 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 18:23:20 -0000 Author: jhb Date: Thu Apr 28 18:23:18 2016 New Revision: 298752 URL: https://svnweb.freebsd.org/changeset/base/298752 Log: Add some notes about the implicit resource mapping for activated resources. Specifically, mention that rman_get_bustag/handle/virtual are valid after a resource is activated. Also, mention the wrapper API that accepts a struct resource instead of a bus tag and handle. Modified: head/share/man/man9/bus_activate_resource.9 Modified: head/share/man/man9/bus_activate_resource.9 ============================================================================== --- head/share/man/man9/bus_activate_resource.9 Thu Apr 28 18:01:25 2016 (r298751) +++ head/share/man/man9/bus_activate_resource.9 Thu Apr 28 18:23:18 2016 (r298752) @@ -52,8 +52,12 @@ .Sh DESCRIPTION These functions activate or deactivate a previously allocated resource. In general, resources must be activated before they can be accessed by -the driver so that the bus driver can map the resource into the -devices space. +the driver. +Bus drivers may perform additional actions to ensure that the resource is +ready to be accessed. +For example, +the PCI bus driver enables memory decoding in a PCI device's command register +when activating a memory resource. .Pp The arguments are as follows: .Bl -tag -width indent @@ -84,6 +88,47 @@ A pointer to the returned by .Xr bus_alloc_resource 9 . .El +.Ss Resource Mapping +Resources which can be mapped for CPU access by a +.Xr bus_space +tag and handle will create a mapping of the entire resource when activated. +The tag and handle for this mapping are stored in +.Fa r +and can be retrieved via +.Xr rman_get_bustag 9 +and +.Xr rman_get_bushandle 9 . +These can be used with the +.Xr bus_space 9 +API to access device registers or memory described by +.Fa r . +If the mapping is associated with a virtual address, +the virtual address can be retrieved via +.Xr rman_get_virtual 9 . +.Pp +A wrapper API for +.Xr bus_space 9 +is also provided that accepts the associated resource as the first argument +in place of the +.Xr bus_space 9 +tag and handle. +The functions in this wrapper API are named similarly to the +.Xr bus_space 9 +API except that +.Dq _space +is removed from their name. +For example, +.Fn bus_read_4 +can be used in place of +.Fn bus_space_read_4 . +The wrapper API is preferred in new drivers. +.Pp +These two statements both read a 32-bit register at the start of a +resource: +.Bd -literal + bus_space_read_4(rman_get_bustag(res), rman_get_bushandle(res), 0); + bus_read_4(res, 0); +.Ed .Sh RETURN VALUES Zero is returned on success, otherwise an error is returned. .Sh SEE ALSO From owner-svn-src-head@freebsd.org Thu Apr 28 18:41:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5767B1FE1C; Thu, 28 Apr 2016 18:41: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 895B2124E; Thu, 28 Apr 2016 18:41: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 u3SIftMQ032792; Thu, 28 Apr 2016 18:41:55 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SIftC2032791; Thu, 28 Apr 2016 18:41:55 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604281841.u3SIftC2032791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 28 Apr 2016 18:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298753 - head/lib/libcam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 18:41:56 -0000 Author: ngie Date: Thu Apr 28 18:41:55 2016 New Revision: 298753 URL: https://svnweb.freebsd.org/changeset/base/298753 Log: Fix va_list handling - Add missing va_end's after corresponding va_start's to cleanup state - Eliminate questionable bzero'ing of va_list passed in to do_buff_decode(..) and do_encode(..) from buff_{de,en}code_visit(..) and csio_{de,en}code_visit(..). Make va_list a pointer instead and pass NULL into the underlying functions to handler this in a portable way. - Do some minor style(9) clean up in affected functions. Differential Revision: https://reviews.freebsd.org/D6072 MFC after: 3 days Reported by: cppcheck, Coverity CID: 1018500-1018503 Reviewed by: cem Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libcam/scsi_cmdparse.c Modified: head/lib/libcam/scsi_cmdparse.c ============================================================================== --- head/lib/libcam/scsi_cmdparse.c Thu Apr 28 18:23:18 2016 (r298752) +++ head/lib/libcam/scsi_cmdparse.c Thu Apr 28 18:41:55 2016 (r298753) @@ -102,7 +102,7 @@ __FBSDID("$FreeBSD$"); static int do_buff_decode(u_int8_t *databuf, size_t len, void (*arg_put)(void *, int , void *, int, char *), - void *puthook, const char *fmt, va_list ap) + void *puthook, const char *fmt, va_list *ap) { int assigned = 0; int width; @@ -128,7 +128,7 @@ do_buff_decode(u_int8_t *databuf, size_t (void *)((long)(ARG)), width, \ field_name); \ else \ - *(va_arg(ap, int *)) = (ARG); \ + *(va_arg(*ap, int *)) = (ARG); \ assigned++; \ } \ field_name[0] = 0; \ @@ -255,7 +255,7 @@ do_buff_decode(u_int8_t *databuf, size_t databuf, width, field_name); else { char *dest; - dest = va_arg(ap, char *); + dest = va_arg(*ap, char *); bcopy(databuf, dest, width); if (letter == 'z') { char *p; @@ -287,7 +287,7 @@ do_buff_decode(u_int8_t *databuf, size_t * can't have a variable seek when you are using * "arg_put". */ - width = (arg_put) ? 0 : va_arg(ap, int); + width = (arg_put) ? 0 : va_arg(*ap, int); fmt++; } else { width = strtol(fmt, &intendp, 10); @@ -539,7 +539,7 @@ next_field(const char **pp, char *fmt, i static int do_encode(u_char *buff, size_t vec_max, size_t *used, int (*arg_get)(void *, char *), void *gethook, const char *fmt, - va_list ap) + va_list *ap) { int ind; int shift; @@ -564,7 +564,7 @@ do_encode(u_char *buff, size_t vec_max, else value = arg_get ? (*arg_get)(gethook, field_name) : - va_arg(ap, int); + va_arg(*ap, int); } #if 0 @@ -662,11 +662,16 @@ int csio_decode(struct ccb_scsiio *csio, const char *fmt, ...) { va_list ap; + int retval; va_start(ap, fmt); - return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, - 0, 0, fmt, ap)); + retval = do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, 0, 0, + fmt, &ap); + + va_end(ap); + + return (retval); } int @@ -674,29 +679,31 @@ csio_decode_visit(struct ccb_scsiio *csi void (*arg_put)(void *, int, void *, int, char *), void *puthook) { - va_list ap; /* * We need some way to output things; we can't do it without * the arg_put function. */ if (arg_put == NULL) - return(-1); - - bzero(&ap, sizeof(ap)); + return (-1); - return(do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, - arg_put, puthook, fmt, ap)); + return (do_buff_decode(csio->data_ptr, (size_t)csio->dxfer_len, + arg_put, puthook, fmt, NULL)); } int buff_decode(u_int8_t *buff, size_t len, const char *fmt, ...) { va_list ap; + int retval; va_start(ap, fmt); - return(do_buff_decode(buff, len, 0, 0, fmt, ap)); + retval = do_buff_decode(buff, len, 0, 0, fmt, &ap); + + va_end(ap); + + return (retval); } int @@ -704,7 +711,6 @@ buff_decode_visit(u_int8_t *buff, size_t void (*arg_put)(void *, int, void *, int, char *), void *puthook) { - va_list ap; /* * We need some way to output things; we can't do it without @@ -713,9 +719,7 @@ buff_decode_visit(u_int8_t *buff, size_t if (arg_put == NULL) return(-1); - bzero(&ap, sizeof(ap)); - - return(do_buff_decode(buff, len, arg_put, puthook, fmt, ap)); + return (do_buff_decode(buff, len, arg_put, puthook, fmt, NULL)); } /* @@ -732,15 +736,15 @@ csio_build(struct ccb_scsiio *csio, u_in va_list ap; if (csio == NULL) - return(0); + return (0); bzero(csio, sizeof(struct ccb_scsiio)); va_start(ap, cmd_spec); if ((retval = do_encode(csio->cdb_io.cdb_bytes, SCSI_MAX_CDBLEN, - &cmdlen, NULL, NULL, cmd_spec, ap)) == -1) - return(retval); + &cmdlen, NULL, NULL, cmd_spec, &ap)) == -1) + goto done; cam_fill_csio(csio, /* retries */ retry_count, @@ -753,7 +757,10 @@ csio_build(struct ccb_scsiio *csio, u_in /* cdb_len */ cmdlen, /* timeout */ timeout ? timeout : 5000); - return(retval); +done: + va_end(ap); + + return (retval); } int @@ -762,7 +769,6 @@ csio_build_visit(struct ccb_scsiio *csio int timeout, const char *cmd_spec, int (*arg_get)(void *hook, char *field_name), void *gethook) { - va_list ap; size_t cmdlen; int retval; @@ -776,12 +782,10 @@ csio_build_visit(struct ccb_scsiio *csio if (arg_get == NULL) return(-1); - bzero(&ap, sizeof(ap)); - bzero(csio, sizeof(struct ccb_scsiio)); if ((retval = do_encode(csio->cdb_io.cdb_bytes, SCSI_MAX_CDBLEN, - &cmdlen, arg_get, gethook, cmd_spec, ap)) == -1) + &cmdlen, arg_get, gethook, cmd_spec, NULL)) == -1) return(retval); cam_fill_csio(csio, @@ -802,20 +806,24 @@ int csio_encode(struct ccb_scsiio *csio, const char *fmt, ...) { va_list ap; + int retval; if (csio == NULL) - return(0); + return (0); va_start(ap, fmt); - return(do_encode(csio->data_ptr, csio->dxfer_len, 0, 0, 0, fmt, ap)); + retval = do_encode(csio->data_ptr, csio->dxfer_len, 0, 0, 0, fmt, &ap); + + va_end(ap); + + return (retval); } int buff_encode_visit(u_int8_t *buff, size_t len, const char *fmt, int (*arg_get)(void *hook, char *field_name), void *gethook) { - va_list ap; /* * We need something to encode, but we can't get it without the @@ -824,16 +832,13 @@ buff_encode_visit(u_int8_t *buff, size_t if (arg_get == NULL) return(-1); - bzero(&ap, sizeof(ap)); - - return(do_encode(buff, len, 0, arg_get, gethook, fmt, ap)); + return (do_encode(buff, len, 0, arg_get, gethook, fmt, NULL)); } int csio_encode_visit(struct ccb_scsiio *csio, const char *fmt, int (*arg_get)(void *hook, char *field_name), void *gethook) { - va_list ap; /* * We need something to encode, but we can't get it without the @@ -842,8 +847,6 @@ csio_encode_visit(struct ccb_scsiio *csi if (arg_get == NULL) return(-1); - bzero(&ap, sizeof(ap)); - - return(do_encode(csio->data_ptr, csio->dxfer_len, 0, arg_get, - gethook, fmt, ap)); + return (do_encode(csio->data_ptr, csio->dxfer_len, 0, arg_get, + gethook, fmt, NULL)); } From owner-svn-src-head@freebsd.org Thu Apr 28 18:53:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E83E3B1F17D; Thu, 28 Apr 2016 18:53:15 +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 B903519C8; Thu, 28 Apr 2016 18:53:15 +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 u3SIrEgV036590; Thu, 28 Apr 2016 18:53:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SIrEMG036589; Thu, 28 Apr 2016 18:53:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604281853.u3SIrEMG036589@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 28 Apr 2016 18:53:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298754 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 18:53:16 -0000 Author: jhb Date: Thu Apr 28 18:53:14 2016 New Revision: 298754 URL: https://svnweb.freebsd.org/changeset/base/298754 Log: Only count CPU devices that are using the ACPI CPU driver. Arguably we should only be doing the probe/attach to children of these devices as well. Tested by: Michal Stanek (arm64) Differential Revision: https://reviews.freebsd.org/D6133 Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Thu Apr 28 18:41:55 2016 (r298753) +++ head/sys/dev/acpica/acpi_cpu.c Thu Apr 28 18:53:14 2016 (r298754) @@ -429,7 +429,8 @@ acpi_cpu_postattach(void *unused __unuse } attached = 0; for (i = 0; i < n; i++) - if (device_is_attached(devices[i])) + if (device_is_attached(devices[i]) && + device_get_driver(devices[i]) == &acpi_cpu_driver) attached = 1; for (i = 0; i < n; i++) bus_generic_probe(devices[i]); From owner-svn-src-head@freebsd.org Thu Apr 28 19:26:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF37FB20714; Thu, 28 Apr 2016 19:26:47 +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 AD1AC1AEB; Thu, 28 Apr 2016 19:26:47 +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 u3SJQkg2051080; Thu, 28 Apr 2016 19:26:46 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SJQkbV051077; Thu, 28 Apr 2016 19:26:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604281926.u3SJQkbV051077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 28 Apr 2016 19:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298755 - in head/sys/geom: journal raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 19:26:48 -0000 Author: pfg Date: Thu Apr 28 19:26:46 2016 New Revision: 298755 URL: https://svnweb.freebsd.org/changeset/base/298755 Log: sys/geom: spelling fixes. These affect debugging messages. MFC after: 2 weeks Modified: head/sys/geom/journal/g_journal.h head/sys/geom/raid/g_raid_ctl.c head/sys/geom/raid/md_ddf.c Modified: head/sys/geom/journal/g_journal.h ============================================================================== --- head/sys/geom/journal/g_journal.h Thu Apr 28 18:53:14 2016 (r298754) +++ head/sys/geom/journal/g_journal.h Thu Apr 28 19:26:46 2016 (r298755) @@ -224,7 +224,7 @@ struct g_journal_entry { #define GJ_VALIDATE_OFFSET(offset, sc) do { \ if ((offset) + GJ_RECORD_MAX_SIZE(sc) >= (sc)->sc_jend) { \ (offset) = (sc)->sc_jstart; \ - GJ_DEBUG(2, "Starting from the begining (%s).", \ + GJ_DEBUG(2, "Starting from the beginning (%s).", \ (sc)->sc_name); \ } \ } while (0) Modified: head/sys/geom/raid/g_raid_ctl.c ============================================================================== --- head/sys/geom/raid/g_raid_ctl.c Thu Apr 28 18:53:14 2016 (r298754) +++ head/sys/geom/raid/g_raid_ctl.c Thu Apr 28 19:26:46 2016 (r298755) @@ -117,7 +117,7 @@ g_raid_ctl_label(struct gctl_req *req, s } format = gctl_get_asciiparam(req, "arg0"); if (format == NULL) { - gctl_error(req, "No format recieved."); + gctl_error(req, "No format received."); return; } crstatus = g_raid_create_node_format(format, req, &geom); @@ -164,7 +164,7 @@ g_raid_ctl_stop(struct gctl_req *req, st } nodename = gctl_get_asciiparam(req, "arg0"); if (nodename == NULL) { - gctl_error(req, "No array name recieved."); + gctl_error(req, "No array name received."); return; } sc = g_raid_find_node(mp, nodename); @@ -204,7 +204,7 @@ g_raid_ctl_other(struct gctl_req *req, s } nodename = gctl_get_asciiparam(req, "arg0"); if (nodename == NULL) { - gctl_error(req, "No array name recieved."); + gctl_error(req, "No array name received."); return; } sc = g_raid_find_node(mp, nodename); Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Thu Apr 28 18:53:14 2016 (r298754) +++ head/sys/geom/raid/md_ddf.c Thu Apr 28 19:26:46 2016 (r298755) @@ -257,7 +257,7 @@ g_raid_md_ddf_print(struct ddf_meta *met printf("BBM Log %u:%u\n", GET32(meta, hdr->bbmlog_section), GET32(meta, hdr->bbmlog_length)); printf("Diagnostic Space %u:%u\n", GET32(meta, hdr->Diagnostic_Space), GET32(meta, hdr->Diagnostic_Space_Length)); printf("Vendor_Specific_Logs %u:%u\n", GET32(meta, hdr->Vendor_Specific_Logs), GET32(meta, hdr->Vendor_Specific_Logs_Length)); - printf("**** Controler Data ****\n"); + printf("**** Controller Data ****\n"); printf("Controller_GUID "); print_guid(meta->cdr->Controller_GUID); printf("\n"); From owner-svn-src-head@freebsd.org Thu Apr 28 20:29:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53A56B1F506; Thu, 28 Apr 2016 20:29:51 +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 138A41CCB; Thu, 28 Apr 2016 20:29:50 +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 u3SKTorm070021; Thu, 28 Apr 2016 20:29:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SKToRo070020; Thu, 28 Apr 2016 20:29:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604282029.u3SKToRo070020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 28 Apr 2016 20:29:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298756 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 20:29:51 -0000 Author: adrian Date: Thu Apr 28 20:29:49 2016 New Revision: 298756 URL: https://svnweb.freebsd.org/changeset/base/298756 Log: [net80211] handle action frames in adhoc mode from the node that created the BSS. We don't have a separate bss node; instead we dup the first node we saw and turn that into the BSS node. This means that action frames from that node would be rejected. So, check that the node is the bss node /and/ the MAC doesn't match ni_macaddr. That's the "right" way for now to verify it's an unknown node. This fixes handling action frames in adhoc mode, which includes negotiating 11n aggregation via ADDBA/DELBA. This by itself isn't enough to correctly create 11n adhoc networks; but it is required for aggregation to be negotiated. Tested: * AR9380, 11n adhoc mode * broadcom 11ac adhoc (vendor platform) Sponsored by: Eva Automation, Inc. Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Thu Apr 28 19:26:46 2016 (r298755) +++ head/sys/net80211/ieee80211_adhoc.c Thu Apr 28 20:29:49 2016 (r298756) @@ -854,7 +854,8 @@ adhoc_recv_mgmt(struct ieee80211_node *n case IEEE80211_FC0_SUBTYPE_ACTION: case IEEE80211_FC0_SUBTYPE_ACTION_NOACK: - if (ni == vap->iv_bss) { + if ((ni == vap->iv_bss) && + !IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "unknown node"); vap->iv_stats.is_rx_mgtdiscard++; From owner-svn-src-head@freebsd.org Thu Apr 28 20:30:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BDAAB1F56F; Thu, 28 Apr 2016 20:30:51 +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 CDA3C1E5B; Thu, 28 Apr 2016 20:30:50 +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 u3SKUo2u072075; Thu, 28 Apr 2016 20:30:50 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SKUoon072074; Thu, 28 Apr 2016 20:30:50 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604282030.u3SKUoon072074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 28 Apr 2016 20:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298757 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 20:30:51 -0000 Author: adrian Date: Thu Apr 28 20:30:49 2016 New Revision: 298757 URL: https://svnweb.freebsd.org/changeset/base/298757 Log: [net80211] fix indenting. Sponsored by: Eva Automation, Inc. Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Thu Apr 28 20:29:49 2016 (r298756) +++ head/sys/net80211/ieee80211_adhoc.c Thu Apr 28 20:30:49 2016 (r298757) @@ -854,8 +854,8 @@ adhoc_recv_mgmt(struct ieee80211_node *n case IEEE80211_FC0_SUBTYPE_ACTION: case IEEE80211_FC0_SUBTYPE_ACTION_NOACK: - if ((ni == vap->iv_bss) && - !IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { + if ((ni == vap->iv_bss) && + !IEEE80211_ADDR_EQ(wh->i_addr2, ni->ni_macaddr)) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "unknown node"); vap->iv_stats.is_rx_mgtdiscard++; From owner-svn-src-head@freebsd.org Thu Apr 28 21:17:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86DB2B2017A; Thu, 28 Apr 2016 21:17: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 571C51779; Thu, 28 Apr 2016 21:17: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 u3SLHNHr085062; Thu, 28 Apr 2016 21:17:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SLHNAw085061; Thu, 28 Apr 2016 21:17:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604282117.u3SLHNAw085061@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 28 Apr 2016 21:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298758 - head/sbin/camcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 21:17:24 -0000 Author: ngie Date: Thu Apr 28 21:17:23 2016 New Revision: 298758 URL: https://svnweb.freebsd.org/changeset/base/298758 Log: Remove logically impossible test in scsidoinquiry(..) It was already done 4 lines prior and the value of error didn't change MFC after: 3 days Reported by: Coverity CID: 1011236 Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/camcontrol/camcontrol.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Apr 28 20:30:49 2016 (r298757) +++ head/sbin/camcontrol/camcontrol.c Thu Apr 28 21:17:23 2016 (r298758) @@ -814,9 +814,6 @@ scsidoinquiry(struct cam_device *device, if (arglist & CAM_ARG_GET_SERIAL) scsiserial(device, retry_count, timeout); - if (error != 0) - return(error); - if (arglist & CAM_ARG_GET_XFERRATE) error = camxferrate(device); From owner-svn-src-head@freebsd.org Thu Apr 28 22:14:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 70A12B20D8D; Thu, 28 Apr 2016 22:14:10 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 24DA016D6; Thu, 28 Apr 2016 22:14:10 +0000 (UTC) (envelope-from wblock@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3SME94Y003315; Thu, 28 Apr 2016 22:14:09 GMT (envelope-from wblock@FreeBSD.org) Received: (from wblock@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3SME9Hg003314; Thu, 28 Apr 2016 22:14:09 GMT (envelope-from wblock@FreeBSD.org) Message-Id: <201604282214.u3SME9Hg003314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wblock set sender to wblock@FreeBSD.org using -f From: Warren Block Date: Thu, 28 Apr 2016 22:14:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298759 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2016 22:14:10 -0000 Author: wblock (doc committer) Date: Thu Apr 28 22:14:09 2016 New Revision: 298759 URL: https://svnweb.freebsd.org/changeset/base/298759 Log: Clarify build(7) instructions for alternate object directory. PR: 209062 Submitted by: Shawn Debnath MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6106 Modified: head/share/man/man7/build.7 Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Thu Apr 28 21:17:23 2016 (r298758) +++ head/share/man/man7/build.7 Thu Apr 28 22:14:09 2016 (r298759) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 14, 2016 +.Dd April 28, 2016 .Dt BUILD 7 .Os .Sh NAME @@ -195,6 +195,12 @@ Build everything but the kernel, configu .Pa etc , and .Pa release . +The object directory can be changed from the default +.Pa /usr/obj +by setting the +.Pa MAKEOBJDIRPREFIX +.Xr make 1 +variable. The actual build location prefix used is .Pa ${MAKEOBJDIRPREFIX}${.CURDIR} for native builds, and @@ -278,6 +284,12 @@ are: .Bl -tag -width ".Cm distributekernel" .It Cm buildkernel Rebuild the kernel and the kernel modules. +The object directory can be changed from the default +.Pa /usr/obj +by setting the +.Pa MAKEOBJDIRPREFIX +.Xr make 1 +variable. .It Cm installkernel Install the kernel and the kernel modules to directory .Pa ${DESTDIR}/boot/kernel , @@ -347,7 +359,7 @@ should be set as with .Dq Li "make installworld" . .It Cm delete-old-libs Delete obsolete base system libraries interactively. -This target should only be used if no 3rd party software uses these +This target should only be used if no third party software uses these libraries. When .Li -DBATCH_DELETE_OLD_FILES @@ -560,7 +572,7 @@ on built objects. .It Va NO_SHARE If set, the build does not descend into the .Pa /usr/src/share -subdirectory (i.e., manpages, locale data files, timezone data files and +subdirectory (i.e., manual pages, locale data files, timezone data files and other .Pa /usr/src/share files will not be rebuild from their sources). From owner-svn-src-head@freebsd.org Fri Apr 29 01:51:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BC4BB20911; Fri, 29 Apr 2016 01:51:29 +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 D965E1ABD; Fri, 29 Apr 2016 01:51:28 +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 u3T1pSuZ066682; Fri, 29 Apr 2016 01:51:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3T1pRWI066680; Fri, 29 Apr 2016 01:51:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604290151.u3T1pRWI066680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 29 Apr 2016 01:51:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298760 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 01:51:29 -0000 Author: adrian Date: Fri Apr 29 01:51:27 2016 New Revision: 298760 URL: https://svnweb.freebsd.org/changeset/base/298760 Log: [ath] Add counters for STBC TX and LDPC TX. This is a big no-op until the TX path changes to enable LDPC TX are added. Modified: head/sys/dev/ath/if_ath_sysctl.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_sysctl.c ============================================================================== --- head/sys/dev/ath/if_ath_sysctl.c Thu Apr 28 22:14:09 2016 (r298759) +++ head/sys/dev/ath/if_ath_sysctl.c Fri Apr 29 01:51:27 2016 (r298760) @@ -1285,6 +1285,12 @@ ath_sysctl_stats_attach(struct ath_softc SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_rx_stbc", CTLFLAG_RD, &sc->sc_stats.ast_rx_stbc, 0, "Number of STBC frames received"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_stbc", + CTLFLAG_RD, &sc->sc_stats.ast_tx_stbc, 0, + "Number of STBC frames transmitted"); + SYSCTL_ADD_UINT(ctx, child, OID_AUTO, "ast_tx_ldpc", + CTLFLAG_RD, &sc->sc_stats.ast_tx_ldpc, 0, + "Number of LDPC frames transmitted"); /* Attach the RX phy error array */ ath_sysctl_stats_attach_rxphyerr(sc, child); Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Thu Apr 28 22:14:09 2016 (r298759) +++ head/sys/dev/ath/if_athioctl.h Fri Apr 29 01:51:27 2016 (r298760) @@ -166,7 +166,9 @@ struct ath_stats { u_int32_t ast_tx_node_psq_overflow; u_int32_t ast_rx_stbc; /* RX STBC frame */ u_int32_t ast_tx_nodeq_overflow; /* node sw queue overflow */ - u_int32_t ast_pad[12]; + u_int32_t ast_tx_ldpc; /* TX LDPC frame */ + u_int32_t ast_tx_stbc; /* TX STBC frame */ + u_int32_t ast_pad[10]; }; #define SIOCGATHSTATS _IOWR('i', 137, struct ifreq) From owner-svn-src-head@freebsd.org Fri Apr 29 01:52:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F191B20A34; Fri, 29 Apr 2016 01:52:07 +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 4867E1CF5; Fri, 29 Apr 2016 01:52:07 +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 u3T1q6j3068891; Fri, 29 Apr 2016 01:52:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3T1q6Jt068890; Fri, 29 Apr 2016 01:52:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604290152.u3T1q6Jt068890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 29 Apr 2016 01:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298761 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 01:52:07 -0000 Author: adrian Date: Fri Apr 29 01:52:06 2016 New Revision: 298761 URL: https://svnweb.freebsd.org/changeset/base/298761 Log: [ath] turn the BA hardware bug back into a printf(). I saw this happen a couple of times and all I saw was a dump of the transmit descriptors. Log the message for now so I can see whta happened. Modified: head/sys/dev/ath/if_ath_tx.c Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Fri Apr 29 01:51:27 2016 (r298760) +++ head/sys/dev/ath/if_ath_tx.c Fri Apr 29 01:52:06 2016 (r298761) @@ -4876,7 +4876,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc * /* AR5416 BA bug; this requires an interface reset */ if (isaggr && tx_ok && (! hasba)) { - DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, + device_printf(sc->sc_dev, "%s: AR5416 bug: hasba=%d; txok=%d, isaggr=%d, " "seq_st=%d\n", __func__, hasba, tx_ok, isaggr, seq_st); From owner-svn-src-head@freebsd.org Fri Apr 29 01:53:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83830B20AAC; Fri, 29 Apr 2016 01:53:46 +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 3A2051ED0; Fri, 29 Apr 2016 01:53:46 +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 u3T1rjoC069607; Fri, 29 Apr 2016 01:53:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3T1rjUG069606; Fri, 29 Apr 2016 01:53:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604290153.u3T1rjUG069606@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 29 Apr 2016 01:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298762 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 01:53:46 -0000 Author: adrian Date: Fri Apr 29 01:53:45 2016 New Revision: 298762 URL: https://svnweb.freebsd.org/changeset/base/298762 Log: [ath] Add LDPC transmit support. LDPC adds better transmit reliability if both ends support it. You in theory can do both STBC and LDPC at the same time. If I see issues I'll disable it. * Only enable it if both ends of a connection negotiate it. * Disable it if any rate is non-11n. * Count both LDPC TX and STBC TX. Tested: * AR9380, STA mode Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Fri Apr 29 01:52:06 2016 (r298761) +++ head/sys/dev/ath/if_ath_tx_ht.c Fri Apr 29 01:53:45 2016 (r298762) @@ -227,6 +227,20 @@ ath_tx_rate_fill_rcflags(struct ath_soft struct ath_rc_series *rc = bf->bf_state.bfs_rc; uint8_t rate; int i; + int do_ldpc; + int do_stbc; + + /* + * We only do LDPC if the rate is 11n, both we and the + * receiver support LDPC and it's enabled. + * + * It's a global flag, not a per-try flag, so we clear + * it if any of the rate entries aren't 11n. + */ + if ((ni->ni_vap->iv_htcaps & IEEE80211_HTCAP_LDPC) && + (ni->ni_htcap & IEEE80211_HTCAP_LDPC)) + do_ldpc = 1; + do_stbc = 0; for (i = 0; i < ATH_RC_NUM; i++) { rc[i].flags = 0; @@ -250,6 +264,12 @@ ath_tx_rate_fill_rcflags(struct ath_soft (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) rc[i].flags |= ATH_RC_RTSCTS_FLAG; + /* + * If we can't do LDPC, don't. + */ + if (! IS_HT_RATE(rate)) + do_ldpc = 0; + /* Only enable shortgi, 2040, dual-stream if HT is set */ if (IS_HT_RATE(rate)) { rc[i].flags |= ATH_RC_HT_FLAG; @@ -281,6 +301,7 @@ ath_tx_rate_fill_rcflags(struct ath_soft (sc->sc_cur_txchainmask > 1) && HT_RC_2_STREAMS(rate) == 1) { rc[i].flags |= ATH_RC_STBC_FLAG; + do_stbc = 1; } /* @@ -324,6 +345,18 @@ ath_tx_rate_fill_rcflags(struct ath_soft "%s: i=%d, rate=0x%x, flags=0x%x, max4ms=%d\n", __func__, i, rate, rc[i].flags, rc[i].max4msframelen); } + + /* + * LDPC is a global flag, so ... + */ + if (do_ldpc) { + bf->bf_state.bfs_txflags |= HAL_TXDESC_LDPC; + sc->sc_stats.ast_tx_ldpc++; + } + + if (do_stbc) { + sc->sc_stats.ast_tx_stbc++; + } } /* From owner-svn-src-head@freebsd.org Fri Apr 29 05:28:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F913B200DC; Fri, 29 Apr 2016 05:28:45 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C25801226; Fri, 29 Apr 2016 05:28:44 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3T5SihH034322; Fri, 29 Apr 2016 05:28:44 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3T5SfoH034290; Fri, 29 Apr 2016 05:28:41 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201604290528.u3T5SfoH034290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 29 Apr 2016 05:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298768 - in head: bin/tests cddl/lib/tests cddl/sbin/tests cddl/tests cddl/usr.bin/tests cddl/usr.sbin/tests gnu/lib/tests gnu/tests gnu/usr.bin/tests lib/atf/libatf-c/tests/detail lib... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 05:28:45 -0000 Author: gjb Date: Fri Apr 29 05:28:40 2016 New Revision: 298768 URL: https://svnweb.freebsd.org/changeset/base/298768 Log: Fix including Kyuafile in packaged base system. Fix a related typo while here. Note, this change results in the Kyuafile inclusion in the runtime package, which needs to be fixed, however addresses the PR as far as I can tell in my tests. PR: 209114 Submitted by: ngie Sponsored by: The FreeBSD Foundation Modified: head/bin/tests/Makefile head/cddl/lib/tests/Makefile head/cddl/sbin/tests/Makefile head/cddl/tests/Makefile head/cddl/usr.bin/tests/Makefile head/cddl/usr.sbin/tests/Makefile head/gnu/lib/tests/Makefile head/gnu/tests/Makefile head/gnu/usr.bin/tests/Makefile head/lib/atf/libatf-c/tests/detail/Makefile head/lib/atf/tests/Makefile head/lib/atf/tests/test-programs/Makefile head/lib/tests/Makefile head/libexec/atf/atf-sh/tests/Makefile head/libexec/atf/tests/Makefile head/libexec/tests/Makefile head/sbin/tests/Makefile head/secure/lib/tests/Makefile head/secure/libexec/tests/Makefile head/secure/tests/Makefile head/secure/usr.bin/tests/Makefile head/secure/usr.sbin/tests/Makefile head/share/examples/tests/Makefile head/share/examples/tests/tests/Makefile head/share/examples/tests/tests/atf/Makefile head/share/examples/tests/tests/plain/Makefile head/share/tests/Makefile head/tests/Makefile head/tests/etc/Makefile head/usr.bin/tests/Makefile head/usr.sbin/tests/Makefile Modified: head/bin/tests/Makefile ============================================================================== --- head/bin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/bin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/cddl/lib/tests/Makefile ============================================================================== --- head/cddl/lib/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/cddl/lib/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/cddl/sbin/tests/Makefile ============================================================================== --- head/cddl/sbin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/cddl/sbin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/cddl/tests/Makefile ============================================================================== --- head/cddl/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/cddl/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/cddl/usr.bin/tests/Makefile ============================================================================== --- head/cddl/usr.bin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/cddl/usr.bin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/cddl/usr.sbin/tests/Makefile ============================================================================== --- head/cddl/usr.sbin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/cddl/usr.sbin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/gnu/lib/tests/Makefile ============================================================================== --- head/gnu/lib/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/gnu/lib/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/gnu/tests/Makefile ============================================================================== --- head/gnu/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/gnu/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/gnu/usr.bin/tests/Makefile ============================================================================== --- head/gnu/usr.bin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/gnu/usr.bin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/lib/atf/libatf-c/tests/detail/Makefile ============================================================================== --- head/lib/atf/libatf-c/tests/detail/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/lib/atf/libatf-c/tests/detail/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/lib/atf/tests/Makefile ============================================================================== --- head/lib/atf/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/lib/atf/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTSDIR= ${TESTSBASE}/lib/atf TESTS+= Kyuafile Modified: head/lib/atf/tests/test-programs/Makefile ============================================================================== --- head/lib/atf/tests/test-programs/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/lib/atf/tests/test-programs/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTSDIR= ${TESTSBASE}/lib/atf/test-programs TESTS+= Kyuafile Modified: head/lib/tests/Makefile ============================================================================== --- head/lib/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/lib/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/libexec/atf/atf-sh/tests/Makefile ============================================================================== --- head/libexec/atf/atf-sh/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/libexec/atf/atf-sh/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/libexec/atf/tests/Makefile ============================================================================== --- head/libexec/atf/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/libexec/atf/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/libexec/tests/Makefile ============================================================================== --- head/libexec/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/libexec/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,10 +2,11 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} -TEST+= Kyuafile +TESTS+= Kyuafile .PATH: ${SRCTOP}/tests KYUAFILE= yes Modified: head/sbin/tests/Makefile ============================================================================== --- head/sbin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/sbin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/secure/lib/tests/Makefile ============================================================================== --- head/secure/lib/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/secure/lib/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/secure/libexec/tests/Makefile ============================================================================== --- head/secure/libexec/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/secure/libexec/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/secure/tests/Makefile ============================================================================== --- head/secure/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/secure/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/secure/usr.bin/tests/Makefile ============================================================================== --- head/secure/usr.bin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/secure/usr.bin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/secure/usr.sbin/tests/Makefile ============================================================================== --- head/secure/usr.sbin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/secure/usr.sbin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/share/examples/tests/Makefile ============================================================================== --- head/share/examples/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/share/examples/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/share/examples/tests/tests/Makefile ============================================================================== --- head/share/examples/tests/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/share/examples/tests/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} # Directory into which the Kyuafile provided by this directory will be Modified: head/share/examples/tests/tests/atf/Makefile ============================================================================== --- head/share/examples/tests/tests/atf/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/share/examples/tests/tests/atf/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/share/examples/tests/tests/plain/Makefile ============================================================================== --- head/share/examples/tests/tests/plain/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/share/examples/tests/tests/plain/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/share/tests/Makefile ============================================================================== --- head/share/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/share/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile TESTSDIR= ${TESTSBASE}/share Modified: head/tests/Makefile ============================================================================== --- head/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/tests/etc/Makefile ============================================================================== --- head/tests/etc/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/tests/etc/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/usr.bin/tests/Makefile ============================================================================== --- head/usr.bin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/usr.bin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile Modified: head/usr.sbin/tests/Makefile ============================================================================== --- head/usr.sbin/tests/Makefile Fri Apr 29 03:13:18 2016 (r298767) +++ head/usr.sbin/tests/Makefile Fri Apr 29 05:28:40 2016 (r298768) @@ -2,8 +2,9 @@ .include +FILESGROUPS= FILES PACKAGE= tests -FILESGROUPS= TESTS +FILESGROUPS+= TESTS TESTSPACKAGE= ${PACKAGE} TESTS+= Kyuafile From owner-svn-src-head@freebsd.org Fri Apr 29 07:23:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8DD8B20B4E; Fri, 29 Apr 2016 07:23:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96E8716D8; Fri, 29 Apr 2016 07:23:09 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3T7N8FX070163; Fri, 29 Apr 2016 07:23:08 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3T7N8Ph070162; Fri, 29 Apr 2016 07:23:08 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604290723.u3T7N8Ph070162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 29 Apr 2016 07:23:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298769 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 07:23:10 -0000 Author: sephe Date: Fri Apr 29 07:23:08 2016 New Revision: 298769 URL: https://svnweb.freebsd.org/changeset/base/298769 Log: tcp/syncache: Set flowid and hash type properly for SYN|ACK So the underlying drivers can use it to select the sending queue properly for SYN|ACK instead of rolling their own hash. Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D6120 Modified: head/sys/netinet/tcp_syncache.c Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Fri Apr 29 05:28:40 2016 (r298768) +++ head/sys/netinet/tcp_syncache.c Fri Apr 29 07:23:08 2016 (r298769) @@ -127,7 +127,8 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, sync static void syncache_drop(struct syncache *, struct syncache_head *); static void syncache_free(struct syncache *); static void syncache_insert(struct syncache *, struct syncache_head *); -static int syncache_respond(struct syncache *, struct syncache_head *, int); +static int syncache_respond(struct syncache *, struct syncache_head *, int, + const struct mbuf *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, @@ -457,7 +458,7 @@ syncache_timer(void *xsch) free(s, M_TCPLOG); } - syncache_respond(sc, sch, 1); + syncache_respond(sc, sch, 1, NULL); TCPSTAT_INC(tcps_sc_retransmitted); syncache_timeout(sc, sch, 0); } @@ -1307,7 +1308,7 @@ syncache_add(struct in_conninfo *inc, st s, __func__); free(s, M_TCPLOG); } - if (syncache_respond(sc, sch, 1) == 0) { + if (syncache_respond(sc, sch, 1, m) == 0) { sc->sc_rxmits = 0; syncache_timeout(sc, sch, 1); TCPSTAT_INC(tcps_sndacks); @@ -1474,7 +1475,7 @@ skip_alloc: /* * Do a standard 3-way handshake. */ - if (syncache_respond(sc, sch, 0) == 0) { + if (syncache_respond(sc, sch, 0, m) == 0) { if (V_tcp_syncookies && V_tcp_syncookiesonly && sc != &scs) syncache_free(sc); else if (sc != &scs) @@ -1505,7 +1506,8 @@ tfo_done: } static int -syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked) +syncache_respond(struct syncache *sc, struct syncache_head *sch, int locked, + const struct mbuf *m0) { struct ip *ip = NULL; struct mbuf *m; @@ -1686,6 +1688,10 @@ syncache_respond(struct syncache *sc, st M_SETFIB(m, sc->sc_inc.inc_fibnum); m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum); + if (m0 != NULL && M_HASHTYPE_GET(m0) != M_HASHTYPE_NONE) { + m->m_pkthdr.flowid = m0->m_pkthdr.flowid; + M_HASHTYPE_SET(m, M_HASHTYPE_GET(m0)); + } #ifdef INET6 if (sc->sc_inc.inc_flags & INC_ISIPV6) { m->m_pkthdr.csum_flags = CSUM_TCP_IPV6; From owner-svn-src-head@freebsd.org Fri Apr 29 11:00:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4987B204AC; Fri, 29 Apr 2016 11:00:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9026A1721; Fri, 29 Apr 2016 11:00: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 u3TB0Cdt034059; Fri, 29 Apr 2016 11:00:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TB0COG034056; Fri, 29 Apr 2016 11:00:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604291100.u3TB0COG034056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 29 Apr 2016 11:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298771 - in head/sys/dev/mlx5: . mlx5_core mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 11:00:13 -0000 Author: hselasky Date: Fri Apr 29 11:00:12 2016 New Revision: 298771 URL: https://svnweb.freebsd.org/changeset/base/298771 Log: Add function to detect the presence of a port module and use this function to error out early when no port module is present and doing eeprom access. This also prevents error codes from filling up in dmesg. Sponsored by: Mellanox Technologies Tested by: Netflix MFC after: 1 week Modified: head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Fri Apr 29 08:02:31 2016 (r298770) +++ head/sys/dev/mlx5/driver.h Fri Apr 29 11:00:12 2016 (r298771) @@ -542,6 +542,7 @@ struct mlx5_core_dev { atomic_t num_qps; u32 issi; struct mlx5_special_contexts special_contexts; + unsigned int module_status[MLX5_MAX_PORTS]; }; enum { @@ -835,6 +836,7 @@ int mlx5_set_port_mtu(struct mlx5_core_d int mlx5_query_port_max_mtu(struct mlx5_core_dev *dev, int *max_mtu); int mlx5_query_port_oper_mtu(struct mlx5_core_dev *dev, int *oper_mtu); +unsigned int mlx5_query_module_status(struct mlx5_core_dev *dev, int module_num); int mlx5_query_module_num(struct mlx5_core_dev *dev, int *module_num); int mlx5_query_eeprom(struct mlx5_core_dev *dev, int i2c_addr, int page_num, int device_addr, int size, int module_num, u32 *data, Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Apr 29 08:02:31 2016 (r298770) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Fri Apr 29 11:00:12 2016 (r298771) @@ -579,6 +579,13 @@ static const char *mlx5_port_module_even } } +unsigned int mlx5_query_module_status(struct mlx5_core_dev *dev, int module_num) +{ + if (module_num < 0 || module_num >= MLX5_MAX_PORTS) + return 0; /* undefined */ + return dev->module_status[module_num]; +} + static void mlx5_port_module_event(struct mlx5_core_dev *dev, struct mlx5_eqe *eqe) { @@ -612,5 +619,8 @@ static void mlx5_port_module_event(struc default: device_printf((&pdev->dev)->bsddev, "INFO: ""Module %u, unknown status", module_num); } + /* store module status */ + if (module_num < MLX5_MAX_PORTS) + dev->module_status[module_num] = module_status; } Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Apr 29 08:02:31 2016 (r298770) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Apr 29 11:00:12 2016 (r298771) @@ -2561,7 +2561,12 @@ out: "reading is not supported\n"); goto err_i2c; } - + /* Check if module is present before doing an access */ + if (mlx5_query_module_status(priv->mdev, module_num) != + MLX5_MODULE_STATUS_PLUGGED) { + error = EINVAL; + goto err_i2c; + } /* * Currently 0XA0 and 0xA2 are the only addresses permitted. * The internal conversion is as follows: From owner-svn-src-head@freebsd.org Fri Apr 29 11:01:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1300B205FC; Fri, 29 Apr 2016 11:01:07 +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 825E31956; Fri, 29 Apr 2016 11:01:07 +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 u3TB167G034133; Fri, 29 Apr 2016 11:01:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TB16lg034132; Fri, 29 Apr 2016 11:01:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604291101.u3TB16lg034132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 29 Apr 2016 11:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298772 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 11:01:07 -0000 Author: hselasky Date: Fri Apr 29 11:01:06 2016 New Revision: 298772 URL: https://svnweb.freebsd.org/changeset/base/298772 Log: Correct some error codes to native FreeBSD ones. Sponsored by: Mellanox Technologies Tested by: Netflix MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Apr 29 11:00:12 2016 (r298771) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Fri Apr 29 11:01:06 2016 (r298772) @@ -2559,6 +2559,7 @@ out: if (error) { if_printf(ifp, "Query module num failed, eeprom " "reading is not supported\n"); + error = EINVAL; goto err_i2c; } /* Check if module is present before doing an access */ @@ -2588,6 +2589,7 @@ out: if (error) { if_printf(ifp, "Query eeprom failed, eeprom " "reading is not supported\n"); + error = EINVAL; goto err_i2c; } @@ -2601,6 +2603,7 @@ out: if (error) { if_printf(ifp, "Query eeprom failed, eeprom " "reading is not supported\n"); + error = EINVAL; goto err_i2c; } From owner-svn-src-head@freebsd.org Fri Apr 29 12:00:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61A2DB20FDC; Fri, 29 Apr 2016 12:00:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3341D19B7; Fri, 29 Apr 2016 12:00:37 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TC0abo052824; Fri, 29 Apr 2016 12:00:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TC0an9052823; Fri, 29 Apr 2016 12:00:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201604291200.u3TC0an9052823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 29 Apr 2016 12:00:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298783 - head/etc/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 12:00:37 -0000 Author: hselasky Date: Fri Apr 29 12:00:36 2016 New Revision: 298783 URL: https://svnweb.freebsd.org/changeset/base/298783 Log: Regenerate usb.conf . MFC after: 1 week Modified: head/etc/devd/usb.conf Modified: head/etc/devd/usb.conf ============================================================================== --- head/etc/devd/usb.conf Fri Apr 29 11:38:45 2016 (r298782) +++ head/etc/devd/usb.conf Fri Apr 29 12:00:36 2016 (r298783) @@ -1721,7 +1721,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x07b8"; - match "product" "(0x8178|0x8188|0x8189)"; + match "product" "(0x8178|0x8179|0x8188|0x8189)"; action "kldload -n if_urtwn"; }; @@ -3161,7 +3161,23 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x0df6"; - match "product" "(0x0052|0x005c|0x0061)"; + match "product" "0x0052"; + action "kldload -n if_urtwn"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "0x0056"; + action "kldload -n if_axe"; +}; + +nomatch 32 { + match "bus" "uhub[0-9]+"; + match "mode" "host"; + match "vendor" "0x0df6"; + match "product" "(0x005c|0x0061)"; action "kldload -n if_urtwn"; }; @@ -4633,7 +4649,7 @@ nomatch 32 { match "bus" "uhub[0-9]+"; match "mode" "host"; match "vendor" "0x17e9"; - match "product" "(0x0059|0x0100|0x0117|0x0136|0x0138|0x0141|0x015a|0x0198|0x019b|0x01ba|0x01bb|0x01d4|0x01d7|0x01e2|0x0215|0x024c|0x02a9|0x0377|0x03e0|0x401a)"; + match "product" "(0x0059|0x0100|0x0117|0x0136|0x0138|0x0141|0x015a|0x0198|0x019b|0x01ba|0x01bb|0x01d4|0x01d7|0x01e2|0x0215|0x024c|0x02a9|0x02e9|0x0377|0x03e0|0x401a)"; action "kldload -n udl"; }; @@ -5801,5 +5817,5 @@ nomatch 32 { action "kldload -n umass"; }; -# 2719 USB entries processed +# 2722 USB entries processed From owner-svn-src-head@freebsd.org Fri Apr 29 12:23:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AA2FB1FB26; Fri, 29 Apr 2016 12:23:58 +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 0F8EA1985; Fri, 29 Apr 2016 12:23:57 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TCNvJT061379; Fri, 29 Apr 2016 12:23:57 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TCNu6X061376; Fri, 29 Apr 2016 12:23:56 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604291223.u3TCNu6X061376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 29 Apr 2016 12:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298784 - in head: etc/defaults etc/rc.d 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 12:23:58 -0000 Author: bapt Date: Fri Apr 29 12:23:56 2016 New Revision: 298784 URL: https://svnweb.freebsd.org/changeset/base/298784 Log: Add a savecore_enable variable support for the savecore rc script By default set to 'YES' so it does not change the current behaviour for users, this variable allows to decide to not extract crach dumps from the dump device at boot time by setting it to "NO" in rc.conf. Sponsored by: Gandi.net Modified: head/etc/defaults/rc.conf head/etc/rc.d/savecore head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Fri Apr 29 12:00:36 2016 (r298783) +++ head/etc/defaults/rc.conf Fri Apr 29 12:23:56 2016 (r298784) @@ -603,6 +603,7 @@ chkprintcap_enable="NO" # Run chkprintca chkprintcap_flags="-d" # Create missing directories by default. dumpdev="AUTO" # Device to crashdump to (device name, AUTO, or NO). dumpdir="/var/crash" # Directory where crash dumps are to be stored +savecore_enable="YES" # Extract core from dump devices if any savecore_flags="-m 10" # Used if dumpdev is enabled above, and present. # By default, only the 10 most recent kernel dumps # are saved. Modified: head/etc/rc.d/savecore ============================================================================== --- head/etc/rc.d/savecore Fri Apr 29 12:00:36 2016 (r298783) +++ head/etc/rc.d/savecore Fri Apr 29 12:23:56 2016 (r298784) @@ -10,6 +10,7 @@ . /etc/rc.subr name="savecore" +rcvar="savecore_enable" desc="Save a core dump of the operating system" start_cmd="savecore_start" start_precmd="savecore_prestart" Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Fri Apr 29 12:00:36 2016 (r298783) +++ head/share/man/man5/rc.conf.5 Fri Apr 29 12:23:56 2016 (r298784) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2016 +.Dd April 29, 2016 .Dt RC.CONF 5 .Os .Sh NAME @@ -3511,6 +3511,12 @@ to not run at boot time when .Va dumpdir is set. +.It Va savecore_enable +.Pq Vt bool +If set to +.Dq Li NO , +disable automatic extraction of the crash dump from the +.Va dumpdev . .It Va savecore_flags .Pq Vt str If crash dumps are enabled, these are the flags to pass to the From owner-svn-src-head@freebsd.org Fri Apr 29 15:23:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C4E4EB20BDD; Fri, 29 Apr 2016 15:23:52 +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 A02821731; Fri, 29 Apr 2016 15:23:52 +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 u3TFNp9R017967; Fri, 29 Apr 2016 15:23:51 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TFNppo017966; Fri, 29 Apr 2016 15:23:51 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604291523.u3TFNppo017966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 29 Apr 2016 15:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298786 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 15:23:52 -0000 Author: asomers Date: Fri Apr 29 15:23:51 2016 New Revision: 298786 URL: https://svnweb.freebsd.org/changeset/base/298786 Log: Refactor vdev_geom_attach and friends to reduce code duplication sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Move checks for provider's sectorsize and mediasize into a single location in vdev_geom_attach. Remove the zfs::vdev::taste class; it's ok to use the regular vdev class for tasting. Consolidate guid checks into a single location in vdev_attach_ok. Consolidate some error handling code from vdev_geom_attach into vdev_geom_detach, closing a resource leak of geom consumers in the process. Reviewed by: avg MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D5974 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Apr 29 13:58:01 2016 (r298785) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Apr 29 15:23:51 2016 (r298786) @@ -61,6 +61,9 @@ static int vdev_geom_bio_delete_disable; SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RWTUN, &vdev_geom_bio_delete_disable, 0, "Disable BIO_DELETE"); +/* Declare local functions */ +static void vdev_geom_detach(struct g_consumer *cp, boolean_t open_for_read); + /* * Thread local storage used to indicate when a thread is probing geoms * for their guids. If NULL, this thread is not tasting geoms. If non NULL, @@ -168,6 +171,17 @@ vdev_geom_attach(struct g_provider *pp, g_topology_assert(); ZFS_LOG(1, "Attaching to %s.", pp->name); + + if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) { + ZFS_LOG(1, "Failing attach of %s. Incompatible sectorsize %d\n", + pp->name, pp->sectorsize); + return (NULL); + } else if (pp->mediasize < SPA_MINDEVSIZE) { + ZFS_LOG(1, "Failing attach of %s. Incompatible mediasize %ju\n", + pp->name, pp->mediasize); + return (NULL); + } + /* Do we have geom already? No? Create one. */ LIST_FOREACH(gp, &zfs_vdev_class.geom, geom) { if (gp->flags & G_GEOM_WITHER) @@ -185,14 +199,14 @@ vdev_geom_attach(struct g_provider *pp, if (error != 0) { ZFS_LOG(1, "%s(%d): g_attach failed: %d\n", __func__, __LINE__, error); - g_wither_geom(gp, ENXIO); + vdev_geom_detach(cp, B_FALSE); return (NULL); } error = g_access(cp, 1, 0, 1); if (error != 0) { ZFS_LOG(1, "%s(%d): g_access failed: %d\n", __func__, __LINE__, error); - g_wither_geom(gp, ENXIO); + vdev_geom_detach(cp, B_FALSE); return (NULL); } ZFS_LOG(1, "Created geom and consumer for %s.", pp->name); @@ -210,15 +224,14 @@ vdev_geom_attach(struct g_provider *pp, if (error != 0) { ZFS_LOG(1, "%s(%d): g_attach failed: %d\n", __func__, __LINE__, error); - g_destroy_consumer(cp); + vdev_geom_detach(cp, B_FALSE); return (NULL); } error = g_access(cp, 1, 0, 1); if (error != 0) { ZFS_LOG(1, "%s(%d): g_access failed: %d\n", __func__, __LINE__, error); - g_detach(cp); - g_destroy_consumer(cp); + vdev_geom_detach(cp, B_FALSE); return (NULL); } ZFS_LOG(1, "Created consumer for %s.", pp->name); @@ -244,39 +257,41 @@ vdev_geom_attach(struct g_provider *pp, * 2) Set it to a linked list of vdevs, not just a single vdev */ cp->private = vd; - vd->vdev_tsd = cp; + if (vd != NULL) + vd->vdev_tsd = cp; cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; return (cp); } static void -vdev_geom_close_locked(vdev_t *vd) +vdev_geom_detach(struct g_consumer *cp, boolean_t open_for_read) { struct g_geom *gp; - struct g_consumer *cp; + vdev_t *vd; g_topology_assert(); - cp = vd->vdev_tsd; - if (cp == NULL) - return; + ZFS_LOG(1, "Detaching consumer. Provider %s.", + cp->provider && cp->provider->name ? cp->provider->name : "NULL"); - ZFS_LOG(1, "Closing access to %s.", cp->provider->name); - KASSERT(vd->vdev_tsd == cp, ("%s: vdev_tsd is not cp", __func__)); - vd->vdev_tsd = NULL; - vd->vdev_delayed_close = B_FALSE; + vd = cp->private; + if (vd != NULL) { + vd->vdev_tsd = NULL; + vd->vdev_delayed_close = B_FALSE; + } cp->private = NULL; gp = cp->geom; - g_access(cp, -1, 0, -1); + if (open_for_read) + g_access(cp, -1, 0, -1); /* Destroy consumer on last close. */ if (cp->acr == 0 && cp->ace == 0) { if (cp->acw > 0) g_access(cp, 0, -cp->acw, 0); if (cp->provider != NULL) { - ZFS_LOG(1, "Destroyed consumer to %s.", - cp->provider->name); + ZFS_LOG(1, "Destroying consumer to %s.", + cp->provider->name ? cp->provider->name : "NULL"); g_detach(cp); } g_destroy_consumer(cp); @@ -289,6 +304,22 @@ vdev_geom_close_locked(vdev_t *vd) } static void +vdev_geom_close_locked(vdev_t *vd) +{ + struct g_consumer *cp; + + g_topology_assert(); + + cp = vd->vdev_tsd; + if (cp == NULL) + return; + + ZFS_LOG(1, "Closing access to %s.", cp->provider->name); + + vdev_geom_detach(cp, B_TRUE); +} + +static void nvlist_get_guids(nvlist_t *list, uint64_t *pguid, uint64_t *vguid) { @@ -331,13 +362,6 @@ vdev_geom_io(struct g_consumer *cp, int return (error); } -static void -vdev_geom_taste_orphan(struct g_consumer *cp) -{ - ZFS_LOG(0, "WARNING: Orphan %s while tasting its VDev GUID.", - cp->provider->name); -} - static int vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) { @@ -470,41 +494,12 @@ ignore: nvlist_free(cfg); } -static int -vdev_geom_attach_taster(struct g_consumer *cp, struct g_provider *pp) -{ - int error; - - if (pp->flags & G_PF_WITHER) - return (EINVAL); - g_attach(cp, pp); - error = g_access(cp, 1, 0, 0); - if (error == 0) { - if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) - error = EINVAL; - else if (pp->mediasize < SPA_MINDEVSIZE) - error = EINVAL; - if (error != 0) - g_access(cp, -1, 0, 0); - } - if (error != 0) - g_detach(cp); - return (error); -} - -static void -vdev_geom_detach_taster(struct g_consumer *cp) -{ - g_access(cp, -1, 0, 0); - g_detach(cp); -} - int vdev_geom_read_pool_label(const char *name, nvlist_t ***configs, uint64_t *count) { struct g_class *mp; - struct g_geom *gp, *zgp; + struct g_geom *gp; struct g_provider *pp; struct g_consumer *zcp; nvlist_t *vdev_cfg; @@ -514,11 +509,6 @@ vdev_geom_read_pool_label(const char *na DROP_GIANT(); g_topology_lock(); - zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste"); - /* This orphan function should be never called. */ - zgp->orphan = vdev_geom_taste_orphan; - zcp = g_new_consumer(zgp); - *configs = NULL; *count = 0; pool_guid = 0; @@ -531,12 +521,13 @@ vdev_geom_read_pool_label(const char *na LIST_FOREACH(pp, &gp->provider, provider) { if (pp->flags & G_PF_WITHER) continue; - if (vdev_geom_attach_taster(zcp, pp) != 0) + zcp = vdev_geom_attach(pp, NULL); + if (zcp == NULL) continue; g_topology_unlock(); error = vdev_geom_read_config(zcp, &vdev_cfg); g_topology_lock(); - vdev_geom_detach_taster(zcp); + vdev_geom_detach(zcp, B_TRUE); if (error) continue; ZFS_LOG(1, "successfully read vdev config"); @@ -546,9 +537,6 @@ vdev_geom_read_pool_label(const char *na } } } - - g_destroy_consumer(zcp); - g_destroy_geom(zgp); g_topology_unlock(); PICKUP_GIANT(); @@ -570,21 +558,55 @@ vdev_geom_read_guids(struct g_consumer * } } +static boolean_t +vdev_attach_ok(vdev_t *vd, struct g_provider *pp) +{ + uint64_t pool_guid; + uint64_t vdev_guid; + struct g_consumer *zcp; + boolean_t pool_ok; + boolean_t vdev_ok; + + zcp = vdev_geom_attach(pp, NULL); + if (zcp == NULL) { + ZFS_LOG(1, "Unable to attach tasting instance to %s.", + pp->name); + return (B_FALSE); + } + g_topology_unlock(); + vdev_geom_read_guids(zcp, &pool_guid, &vdev_guid); + g_topology_lock(); + vdev_geom_detach(zcp, B_TRUE); + + /* + * Check that the label's vdev guid matches the desired guid. If the + * label has a pool guid, check that it matches too. (Inactive spares + * and L2ARCs do not have any pool guid in the label.) + */ + if ((pool_guid == 0 || pool_guid == spa_guid(vd->vdev_spa)) && + vdev_guid == vd->vdev_guid) { + ZFS_LOG(1, "guids match for provider %s.", vd->vdev_path); + return (B_TRUE); + } else { + ZFS_LOG(1, "guid mismatch for provider %s: " + "%ju:%ju != %ju:%ju.", vd->vdev_path, + (uintmax_t)spa_guid(vd->vdev_spa), + (uintmax_t)vd->vdev_guid, + (uintmax_t)pool_guid, (uintmax_t)vdev_guid); + return (B_FALSE); + } +} + static struct g_consumer * vdev_geom_attach_by_guids(vdev_t *vd) { struct g_class *mp; - struct g_geom *gp, *zgp; + struct g_geom *gp; struct g_provider *pp; - struct g_consumer *cp, *zcp; - uint64_t pguid, vguid; + struct g_consumer *cp; g_topology_assert(); - zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste"); - zgp->orphan = vdev_geom_taste_orphan; - zcp = g_new_consumer(zgp); - cp = NULL; LIST_FOREACH(mp, &g_classes, class) { if (mp == &zfs_vdev_class) @@ -593,22 +615,7 @@ vdev_geom_attach_by_guids(vdev_t *vd) if (gp->flags & G_GEOM_WITHER) continue; LIST_FOREACH(pp, &gp->provider, provider) { - if (vdev_geom_attach_taster(zcp, pp) != 0) - continue; - g_topology_unlock(); - vdev_geom_read_guids(zcp, &pguid, &vguid); - g_topology_lock(); - vdev_geom_detach_taster(zcp); - /* - * Check that the label's vdev guid matches the - * desired guid. If the label has a pool guid, - * check that it matches too. (Inactive spares - * and L2ARCs do not have any pool guid in the - * label.) - */ - if ((pguid != 0 && - pguid != spa_guid(vd->vdev_spa)) || - vguid != vd->vdev_guid) + if (!vdev_attach_ok(vd, pp)) continue; cp = vdev_geom_attach(pp, vd); if (cp == NULL) { @@ -625,8 +632,6 @@ vdev_geom_attach_by_guids(vdev_t *vd) break; } end: - g_destroy_consumer(zcp); - g_destroy_geom(zgp); return (cp); } @@ -667,7 +672,6 @@ vdev_geom_open_by_path(vdev_t *vd, int c { struct g_provider *pp; struct g_consumer *cp; - uint64_t pguid, vguid; g_topology_assert(); @@ -675,34 +679,8 @@ vdev_geom_open_by_path(vdev_t *vd, int c pp = g_provider_by_name(vd->vdev_path + sizeof("/dev/") - 1); if (pp != NULL) { ZFS_LOG(1, "Found provider by name %s.", vd->vdev_path); - cp = vdev_geom_attach(pp, vd); - if (cp != NULL && check_guid && ISP2(pp->sectorsize) && - pp->sectorsize <= VDEV_PAD_SIZE) { - g_topology_unlock(); - vdev_geom_read_guids(cp, &pguid, &vguid); - g_topology_lock(); - /* - * Check that the label's vdev guid matches the - * desired guid. If the label has a pool guid, - * check that it matches too. (Inactive spares - * and L2ARCs do not have any pool guid in the - * label.) - */ - if ((pguid != 0 && - pguid != spa_guid(vd->vdev_spa)) || - vguid != vd->vdev_guid) { - vdev_geom_close_locked(vd); - cp = NULL; - ZFS_LOG(1, "guid mismatch for provider %s: " - "%ju:%ju != %ju:%ju.", vd->vdev_path, - (uintmax_t)spa_guid(vd->vdev_spa), - (uintmax_t)vd->vdev_guid, - (uintmax_t)pguid, (uintmax_t)vguid); - } else { - ZFS_LOG(1, "guid match for provider %s.", - vd->vdev_path); - } - } + if (!check_guid || vdev_attach_ok(vd, pp)) + cp = vdev_geom_attach(pp, vd); } return (cp); From owner-svn-src-head@freebsd.org Fri Apr 29 15:45:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A7D6B21146; Fri, 29 Apr 2016 15:45:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 379CC12E3; Fri, 29 Apr 2016 15:45:23 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TFjMY3024165; Fri, 29 Apr 2016 15:45:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TFjMbl024164; Fri, 29 Apr 2016 15:45:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201604291545.u3TFjMbl024164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 29 Apr 2016 15:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298787 - head/sys/cddl/dev/dtrace/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 15:45:23 -0000 Author: avg Date: Fri Apr 29 15:45:22 2016 New Revision: 298787 URL: https://svnweb.freebsd.org/changeset/base/298787 Log: add invpcid instruction to i386 dtrace disassembler tables MFC after: 2 weeks Modified: head/sys/cddl/dev/dtrace/x86/dis_tables.c Modified: head/sys/cddl/dev/dtrace/x86/dis_tables.c ============================================================================== --- head/sys/cddl/dev/dtrace/x86/dis_tables.c Fri Apr 29 15:23:51 2016 (r298786) +++ head/sys/cddl/dev/dtrace/x86/dis_tables.c Fri Apr 29 15:45:22 2016 (r298787) @@ -1182,7 +1182,7 @@ const instable_t dis_op0F38[256] = { /* [78] */ INVALID, INVALID, INVALID, INVALID, /* [7C] */ INVALID, INVALID, INVALID, INVALID, -/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),INVALID, INVALID, +/* [80] */ TNSy("invept", RM_66r), TNSy("invvpid", RM_66r),TNSy("invpcid", RM_66r),INVALID, /* [84] */ INVALID, INVALID, INVALID, INVALID, /* [88] */ INVALID, INVALID, INVALID, INVALID, /* [8C] */ INVALID, INVALID, INVALID, INVALID, From owner-svn-src-head@freebsd.org Fri Apr 29 15:55:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FD51B21541; Fri, 29 Apr 2016 15:55:37 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 621401B60; Fri, 29 Apr 2016 15:55:37 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 42B3C1745E; Fri, 29 Apr 2016 08:55:36 -0700 (PDT) Date: Fri, 29 Apr 2016 08:55:36 -0700 From: hiren panchasara To: Sepherosa Ziehau Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r298769 - head/sys/netinet Message-ID: <20160429155536.GD18595@strugglingcoder.info> References: <201604290723.u3T7N8Ph070162@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="9UV9rz0O2dU/yYYn" Content-Disposition: inline In-Reply-To: <201604290723.u3T7N8Ph070162@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 15:55:37 -0000 --9UV9rz0O2dU/yYYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 04/29/16 at 07:23P, Sepherosa Ziehau wrote: > Author: sephe > Date: Fri Apr 29 07:23:08 2016 > New Revision: 298769 > URL: https://svnweb.freebsd.org/changeset/base/298769 >=20 > Log: > tcp/syncache: Set flowid and hash type properly for SYN|ACK > =20 > So the underlying drivers can use it to select the sending queue > properly for SYN|ACK instead of rolling their own hash. > =20 > Sponsored by: Microsoft OSTC > Differential Revision: https://reviews.freebsd.org/D6120 >=20 > Modified: > head/sys/netinet/tcp_syncache.c Would it be possible to MFC this? Cheers, Hiren --9UV9rz0O2dU/yYYn Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXI4PxXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/luOMIAJa2o4WsVF9IbHmDava9iPru b6QYlZrL2mdeP3exGP3lTwPuWcseYiW4i/U1VzPsDCrzNnij5LhdJkE53HKyL3O3 a90XqiZox8PKWEKpkq/yEWANx7P2AzxWX6oYbyqrmS1aXPve8wohVhpNM49XLlZb UActoM6J9rotTwEHsVzqprQ6UMpxmtkhzw2EDgBPrTpk/wuLBONOH3Rj3b2kHn6i 8k2vgJwHNAoHALl5eADAlkE73YP0Rwo9QYLVGG5iIv12VsJ3X55oRfIB4BXR1f6q emmhaQWdbNsvn57LxU1fUt6j/x9ITtfs50KIk68IMgEoHho63+Z57+nfPq4qWaU= =4bqN -----END PGP SIGNATURE----- --9UV9rz0O2dU/yYYn-- From owner-svn-src-head@freebsd.org Fri Apr 29 16:07:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8DD9B21901; Fri, 29 Apr 2016 16:07: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 B921411AC; Fri, 29 Apr 2016 16:07: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 u3TG7QE4030509; Fri, 29 Apr 2016 16:07:26 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TG7Pn8030496; Fri, 29 Apr 2016 16:07:25 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604291607.u3TG7Pn8030496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 16:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298788 - in head/sys: fs/nfs fs/nfsclient fs/nfsserver nfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 16:07:28 -0000 Author: pfg Date: Fri Apr 29 16:07:25 2016 New Revision: 298788 URL: https://svnweb.freebsd.org/changeset/base/298788 Log: NFS: spelling fixes on comments. No funcional change. Modified: head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfsport.h head/sys/fs/nfs/nfsrvstate.h head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clkdtrace.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsserver/nfs_nfsdport.c head/sys/fs/nfsserver/nfs_nfsdstate.c head/sys/nfs/krpc_subr.c head/sys/nfs/nfs_nfssvc.c Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfs/nfs_commonport.c Fri Apr 29 16:07:25 2016 (r298788) @@ -155,7 +155,7 @@ newnfs_realign(struct mbuf **pm, int how * we cannot afford to overwrite them. * * We would prefer to avoid this situation entirely. The situation does - * not occur with NFS/UDP and is supposed to only occassionally occur + * not occur with NFS/UDP and is supposed to only occasionally occur * with TCP. Use vfs.nfs.realign_count and realign_test to check this. * */ Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfs/nfsport.h Fri Apr 29 16:07:25 2016 (r298788) @@ -968,7 +968,7 @@ struct nfsreq { /* * Name used by getnewvnode() to describe filesystem, "nfs". - * For perfomance reasons it is useful to have the same string + * For performance reasons it is useful to have the same string * used in both places that call getnewvnode(). */ extern const char nfs_vnode_tag[]; Modified: head/sys/fs/nfs/nfsrvstate.h ============================================================================== --- head/sys/fs/nfs/nfsrvstate.h Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfs/nfsrvstate.h Fri Apr 29 16:07:25 2016 (r298788) @@ -76,7 +76,7 @@ struct nfssessionhash { * Client server structure for V4. It is doubly linked into two lists. * The first is a hash table based on the clientid and the second is a * list of all clients maintained in LRU order. - * The actual size malloc'd is large enough to accomodate the id string. + * The actual size malloc'd is large enough to accommodate the id string. */ struct nfsclient { LIST_ENTRY(nfsclient) lc_hash; /* Clientid hash list */ Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfsclient/nfs_clbio.c Fri Apr 29 16:07:25 2016 (r298788) @@ -140,7 +140,7 @@ ncl_getpages(struct vop_getpages_args *a /* * We use only the kva address for the buffer, but this is extremely - * convienient and fast. + * convenient and fast. */ bp = getpbuf(&ncl_pbuf_freecnt); @@ -201,7 +201,7 @@ ncl_getpages(struct vop_getpages_args *a } else { /* * Read operation was short. If no error - * occured we may have hit a zero-fill + * occurred we may have hit a zero-fill * section. We leave valid set to 0, and page * is freed by vm_page_readahead_finish() if * its index is not equal to requested, or @@ -286,7 +286,7 @@ ncl_putpages(struct vop_putpages_args *a /* * We use only the kva address for the buffer, but this is extremely - * convienient and fast. + * convenient and fast. */ bp = getpbuf(&ncl_pbuf_freecnt); @@ -1188,7 +1188,7 @@ again: /* * Get the partial update on the progress made from - * uiomove, if an error occured. + * uiomove, if an error occurred. */ if (error != 0) n = local_resid - uio->uio_resid; @@ -1480,7 +1480,7 @@ again: } /* * We might have lost our iod while sleeping, - * so check and loop if nescessary. + * so check and loop if necessary. */ goto again; } Modified: head/sys/fs/nfsclient/nfs_clkdtrace.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clkdtrace.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfsclient/nfs_clkdtrace.c Fri Apr 29 16:07:25 2016 (r298788) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); /* * dtnfscl is a DTrace provider that tracks the intent to perform RPCs - * in the NFS client, as well as acess to and maintenance of the access and + * in the NFS client, as well as access to and maintenance of the access and * attribute caches. This is not quite the same as RPCs, because NFS may * issue multiple RPC transactions in the event that authentication fails, * there's a jukebox error, or none at all if the access or attribute cache Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Apr 29 16:07:25 2016 (r298788) @@ -1701,7 +1701,7 @@ nfsrpc_writerpc(vnode_t vp, struct uio * commit = fxdr_unsigned(int, *tl++); /* - * Return the lowest committment level + * Return the lowest commitment level * obtained by any of the RPCs. */ if (committed == NFSWRITE_FILESYNC) @@ -2676,7 +2676,7 @@ nfsrpc_rmdir(vnode_t dvp, char *name, in * 2 - pass the opaque directory offset cookies up into userland * and let the libc functions deal with them, via the system call * 3 - return them to userland in the "struct dirent", so future versions - * of libc can use them and do whatever is necessary to amke things work + * of libc can use them and do whatever is necessary to make things work * above these rpc calls, in the meantime * For now, I do #3 by "hiding" the directory offset cookies after the * d_name field in struct dirent. This is space inside d_reclen that @@ -2927,7 +2927,7 @@ nfsrpc_readdir(vnode_t vp, struct uio *u if (!more_dirs) tryformoredirs = 0; - /* loop thru the dir entries, doctoring them to 4bsd form */ + /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { if (nd->nd_flag & ND_NFSV4) { NFSM_DISSECT(tl, u_int32_t *, 3*NFSX_UNSIGNED); @@ -3342,7 +3342,7 @@ nfsrpc_readdirplus(vnode_t vp, struct ui if (!more_dirs) tryformoredirs = 0; - /* loop thru the dir entries, doctoring them to 4bsd form */ + /* loop through the dir entries, doctoring them to 4bsd form */ while (more_dirs && bigenough) { NFSM_DISSECT(tl, u_int32_t *, 3 * NFSX_UNSIGNED); if (nd->nd_flag & ND_NFSV4) { @@ -5782,7 +5782,7 @@ nfsrpc_writeds(vnode_t vp, struct uio *u commit = fxdr_unsigned(int, *tl++); /* - * Return the lowest committment level + * Return the lowest commitment level * obtained by any of the RPCs. */ if (committed == NFSWRITE_FILESYNC) Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfsclient/nfs_clstate.c Fri Apr 29 16:07:25 2016 (r298788) @@ -716,7 +716,7 @@ nfscl_openrelease(struct nfsclopen *op, /* * Called to get a clientid structure. It will optionally lock the * client data structures to do the SetClientId/SetClientId_confirm, - * but will release that lock and return the clientid with a refernce + * but will release that lock and return the clientid with a reference * count on it. * If the "cred" argument is NULL, a new clientid should not be created. * If the "p" argument is NULL, a SetClientID/SetClientIDConfirm cannot Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Fri Apr 29 16:07:25 2016 (r298788) @@ -1066,7 +1066,7 @@ nfs_mount(struct mount *mp) /* * If a change from TCP->UDP is done and there are thread(s) - * that have I/O RPC(s) in progress with a tranfer size + * that have I/O RPC(s) in progress with a transfer size * greater than NFS_MAXDGRAMDATA, those thread(s) will be * hung, retrying the RPC(s) forever. Usually these threads * will be seen doing an uninterruptible sleep on wait channel Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfsclient/nfs_clvnops.c Fri Apr 29 16:07:25 2016 (r298788) @@ -2414,7 +2414,7 @@ nfs_sillyrename(struct vnode *dvp, struc /* * Fudge together a funny name. - * Changing the format of the funny name to accomodate more + * Changing the format of the funny name to accommodate more * sillynames per directory. * The name is now changed to .nfs...4, where ticks is * CPU ticks since boot. Modified: head/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfsserver/nfs_nfsdport.c Fri Apr 29 16:07:25 2016 (r298788) @@ -1305,7 +1305,7 @@ nfsvno_fsync(struct vnode *vp, u_int64_t daddr_t lblkno; /* - * Align to iosize boundry, super-align to page boundry. + * Align to iosize boundary, super-align to page boundary. */ if (off & iomask) { cnt += off & iomask; @@ -2800,7 +2800,7 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s /* * Personally, I've never seen any point in requiring a * reserved port#, since only in the rare case where the - * clients are all boxes with secure system priviledges, + * clients are all boxes with secure system privileges, * does it provide any enhanced security, but... some people * believe it to be useful and keep putting this code back in. * (There is also some "security checker" out there that @@ -3066,7 +3066,7 @@ out: } /* - * Nfs server psuedo system call for the nfsd's + * Nfs server pseudo system call for the nfsd's */ /* * MPSAFE Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Apr 29 16:07:25 2016 (r298788) @@ -1635,7 +1635,7 @@ tryagain: if (new_stp->ls_flags & NFSLCK_TEST) { /* * RFC 3530 does not list LockT as an op that renews a - * lease, but the concensus seems to be that it is ok + * lease, but the consensus seems to be that it is ok * for a server to do so. */ error = nfsrv_getclient(clientid, CLOPS_RENEW, &clp, NULL, @@ -1742,7 +1742,7 @@ tryagain: * If the seqid part of the stateid isn't the same, return * NFSERR_OLDSTATEID for cases other than I/O Ops. * For I/O Ops, only return NFSERR_OLDSTATEID if - * nfsrv_returnoldstateid is set. (The concensus on the email + * nfsrv_returnoldstateid is set. (The consensus on the email * list was that most clients would prefer to not receive * NFSERR_OLDSTATEID for I/O Ops, but the RFC suggests that that * is what will happen, so I use the nfsrv_returnoldstateid to @@ -1971,7 +1971,7 @@ tryagain: * - there is a conflict if a different client has any delegation * - there is a conflict if the same client has a read delegation * (I don't understand why this isn't allowed, but that seems to be - * the current concensus?) + * the current consensus?) */ tstp = LIST_FIRST(&lfp->lf_deleg); while (tstp != LIST_END(&lfp->lf_deleg)) { @@ -2438,7 +2438,7 @@ tryagain: * For Open with other Write Access or any Deny except None * - there is a conflict if a different client has any delegation * - there is a conflict if the same client has a read delegation - * (The current concensus is that this last case should be + * (The current consensus is that this last case should be * considered a conflict since the client with a read delegation * could have done an Open with ReadAccess and WriteDeny * locally and then not have checked for the WriteDeny.) @@ -2731,7 +2731,7 @@ tryagain: * For Open with other Write Access or any Deny except None * - there is a conflict if a different client has any delegation * - there is a conflict if the same client has a read delegation - * (The current concensus is that this last case should be + * (The current consensus is that this last case should be * considered a conflict since the client with a read delegation * could have done an Open with ReadAccess and WriteDeny * locally and then not have checked for the WriteDeny.) @@ -4396,7 +4396,7 @@ tryagain: * nfsrvboottime does not, somehow, get set to a previous one. * (This is important so that Stale ClientIDs and StateIDs can * be recognized.) - * The number of previous nfsvrboottime values preceeds the list. + * The number of previous nfsvrboottime values precedes the list. * - followed by some number of appended records with: * - client id string * - flag that indicates it is a record revoking state via lease Modified: head/sys/nfs/krpc_subr.c ============================================================================== --- head/sys/nfs/krpc_subr.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/nfs/krpc_subr.c Fri Apr 29 16:07:25 2016 (r298788) @@ -217,7 +217,7 @@ krpc_call(struct sockaddr_in *sa, u_int from = NULL; /* - * Create socket and set its recieve timeout. + * Create socket and set its receive timeout. */ if ((error = socreate(AF_INET, &so, SOCK_DGRAM, 0, td->td_ucred, td))) return error; Modified: head/sys/nfs/nfs_nfssvc.c ============================================================================== --- head/sys/nfs/nfs_nfssvc.c Fri Apr 29 15:45:22 2016 (r298787) +++ head/sys/nfs/nfs_nfssvc.c Fri Apr 29 16:07:25 2016 (r298788) @@ -70,7 +70,7 @@ int (*nfsd_call_nfscl)(struct thread *, int (*nfsd_call_nfsd)(struct thread *, struct nfssvc_args *) = NULL; /* - * Nfs server psuedo system call for the nfsd's + * Nfs server pseudo system call for the nfsd's */ int sys_nfssvc(struct thread *td, struct nfssvc_args *uap) From owner-svn-src-head@freebsd.org Fri Apr 29 16:22:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B4B4B21F5C for ; Fri, 29 Apr 2016 16:22:11 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm42-vm4.bullet.mail.bf1.yahoo.com (nm42-vm4.bullet.mail.bf1.yahoo.com [216.109.114.191]) (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 02FCB1BEF for ; Fri, 29 Apr 2016 16:22:10 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1461946196; bh=wM2l/iCjiXOBAIlrWsA1bSqcGwZAwavqoMfHYu/bn5g=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=f/IvVYAOk8XnSLlywsHE0dHe1QsUjK9moXu3PBzQMW5+ldsbIS+Q5VYeVRWsm7RcBvOoqPNOWz2ln42WK0ZmO/R4XSNUq0jzm/8HlSo8x8iotSyfRRtZWwIjA/KqHaKNRp+ONyFyU/rgZ3w5jXkne2BrtBsLH1+0caPcUDGzoSp1CA37CNRxwerTG4TSVq2sHAGXEsfT9uBr+9sEi+sVFCufdwG9Lf6XSR99R2bxOMv7AZJ0XtSkqNcp1dSX44IE0NFtgnvPSzbRMiPEo65sEqbQDwjD6dr5n0apFdhG2Lpliob2DY+S7ho8G8mZbe/daq9fMsgyfWAe+zKEGFZ1bw== Received: from [66.196.81.170] by nm42.bullet.mail.bf1.yahoo.com with NNFMP; 29 Apr 2016 16:09:56 -0000 Received: from [98.139.211.196] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 29 Apr 2016 16:09:56 -0000 Received: from [127.0.0.1] by smtp205.mail.bf1.yahoo.com with NNFMP; 29 Apr 2016 16:09:56 -0000 X-Yahoo-Newman-Id: 945111.2588.bm@smtp205.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: x_YE2zcVM1nPebOXmlu7OkUouXeL6NfHLEbMDDHqFrhajy. 6dZvbrz7RpZ9ehr2uZ71BcNSINjYwR2XwjhbBwvMTcHoVl0nwLfI8grJTm3u tJUAK_EOOtz_sJYzzHXIEBOL.SdADcBIjUcjlLiHoNSaJDvXiOz6KOwl_OhH fDAXGkFsn0cplbnsO3PFOIhlEUkPyJlPN2_0dnTklR.zaN_t6HJqjkuLdzK0 NehyYni7BiHby8UXsJmqdxIv_4VFxmKmmldzHjMrsT577HnjBj4pGbZEAaag VktWNMBRakGrH4PF02L.ziY1HOJGDsV2iskvkCH7T7uK7K3HKUjHUobGYTZg 5VIf9blzmhZAS5wW.CzyATm9BoCmR0MeuIzkAU7LVkkNiqe1_BVSnETuGln3 EZpSZHqigpBTscuNnItvIiotkgvZejQhZFjkltBI.1D_T57.sUL690RNIDXz 422QPm5xUHrzTV_0NsYa0EpRXWuo6cUEkNnXucc_tKO_5CxwKmb_480RDH_v BpTWKny6WSzqSvyyPQ7seNKBY1WCurxXD X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298788 - in head/sys: fs/nfs fs/nfsclient fs/nfsserver nfs To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201604291607.u3TG7Pn8030496@repo.freebsd.org> From: Pedro Giffuni Message-ID: <13b5284f-5061-e29b-103f-0713a4a4d495@FreeBSD.org> Date: Fri, 29 Apr 2016 11:09:56 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: <201604291607.u3TG7Pn8030496@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 16:22:11 -0000 On 04/29/16 11:07, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Apr 29 16:07:25 2016 > New Revision: 298788 > URL: https://svnweb.freebsd.org/changeset/base/298788 > > Log: > NFS: spelling fixes on comments. > > No funcional change. > s/funcional/functional/ Ahh the irony ... Every one knows coders are quite bad at spelling. ;) Pedro. From owner-svn-src-head@freebsd.org Fri Apr 29 16:32:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 912C3B212D8; Fri, 29 Apr 2016 16:32:29 +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 4B65E13A0; Fri, 29 Apr 2016 16:32:29 +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 u3TGWSNi039150; Fri, 29 Apr 2016 16:32:28 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TGWSxg039148; Fri, 29 Apr 2016 16:32:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604291632.u3TGWSxg039148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 16:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298789 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 16:32:29 -0000 Author: pfg Date: Fri Apr 29 16:32:28 2016 New Revision: 298789 URL: https://svnweb.freebsd.org/changeset/base/298789 Log: bufs: make B_DIRTY and B_PERSISTENT flags available It appears these flags were related to ext2fs but are completely unused nowadays. Retire them. Suggested by: mckusick Modified: head/sys/kern/vfs_bio.c head/sys/sys/buf.h Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Apr 29 16:07:25 2016 (r298788) +++ head/sys/kern/vfs_bio.c Fri Apr 29 16:32:28 2016 (r298789) @@ -1162,8 +1162,7 @@ vfs_buf_check_unmapped(struct buf *bp) static int isbufbusy(struct buf *bp) { - if (((bp->b_flags & (B_INVAL | B_PERSISTENT)) == 0 && - BUF_ISLOCKED(bp)) || + if (((bp->b_flags & B_INVAL) == 0 && BUF_ISLOCKED(bp)) || ((bp->b_flags & (B_DELWRI | B_INVAL)) == B_DELWRI)) return (1); return (0); Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri Apr 29 16:07:25 2016 (r298788) +++ head/sys/sys/buf.h Fri Apr 29 16:32:28 2016 (r298789) @@ -200,7 +200,7 @@ struct buf { #define B_CACHE 0x00000020 /* Bread found us in the cache. */ #define B_VALIDSUSPWRT 0x00000040 /* Valid write during suspension. */ #define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */ -#define B_PERSISTENT 0x00000100 /* Perm. ref'ed while EXT2FS mounted. */ +#define B_00000100 0x00000100 /* Available flag. */ #define B_DONE 0x00000200 /* I/O completed. */ #define B_EINTR 0x00000400 /* I/O was interrupted */ #define B_NOREUSE 0x00000800 /* Contents not reused once released. */ @@ -213,7 +213,7 @@ struct buf { #define B_00040000 0x00040000 /* Available flag. */ #define B_00080000 0x00080000 /* Available flag. */ #define B_00100000 0x00100000 /* Available flag. */ -#define B_DIRTY 0x00200000 /* Needs writing later (in EXT2FS). */ +#define B_00200000 0x00200000 /* Available flag. */ #define B_RELBUF 0x00400000 /* Release VMIO buffer. */ #define B_FS_FLAG1 0x00800000 /* Available flag for FS use. */ #define B_NOCOPY 0x01000000 /* Don't copy-on-write this buf. */ From owner-svn-src-head@freebsd.org Fri Apr 29 16:40:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E9B9B21497; Fri, 29 Apr 2016 16:40:48 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi0-f65.google.com (mail-oi0-f65.google.com [209.85.218.65]) (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 2F8311BB1; Fri, 29 Apr 2016 16:40:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi0-f65.google.com with SMTP id i2so20108229oib.3; Fri, 29 Apr 2016 09:40:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=/BtDGk0XSjWbDAYKODO2SFWyLB6OHw3GHZJ3sKopnBo=; b=VJpZcIf7avCW93a9cxr+21WJAdT+9777Ds/xjbIoOf7COQu2mKqV6nWBInEE5jOw4q LDhw/dkWLuNvPDDLvNJ29z9x1KcPKxpCYGsQkPkjjqZQJa7qmBgy1w48MNAduBNSRGLp ksIOfY/AzNsi0Z0TXr3g1SmeUTACMVG8N+vgva/IfQfvl03y0L5oyLw5lDIOikZsmMS0 t4NvsEvuTvIMLC6ToPttiuIIuxgK7QzKZ9pJAs+iIdgUiIYSZdOB43WrWa/+eJhoe04X DHYZPtGf1s3N3YTiDlMlQRq6Dn8JnhJ/cqr0Es1UNthnOHTnmxAGwAudcm0IW9ZbjWCT IYKQ== X-Gm-Message-State: AOPr4FUNdS3I3OkGEc5c+IQqO1w2G5DWpnM4IPp9Ybfy6QMihFS0ScE5cCTlZzNUxCBaQQ== X-Received: by 10.157.44.147 with SMTP id p19mr9956022otb.37.1461948041492; Fri, 29 Apr 2016 09:40:41 -0700 (PDT) Received: from mail-oi0-f54.google.com (mail-oi0-f54.google.com. [209.85.218.54]) by smtp.gmail.com with ESMTPSA id 67sm5852906otr.4.2016.04.29.09.40.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Apr 2016 09:40:41 -0700 (PDT) Received: by mail-oi0-f54.google.com with SMTP id k142so124731722oib.1; Fri, 29 Apr 2016 09:40:41 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.157.36.135 with SMTP id z7mr9456454ota.69.1461948040807; Fri, 29 Apr 2016 09:40:40 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.157.6.111 with HTTP; Fri, 29 Apr 2016 09:40:40 -0700 (PDT) In-Reply-To: <201604291632.u3TGWSxg039148@repo.freebsd.org> References: <201604291632.u3TGWSxg039148@repo.freebsd.org> Date: Fri, 29 Apr 2016 09:40:40 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r298789 - in head/sys: kern sys From: Conrad Meyer To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 16:40:48 -0000 I think you'll want to remove them from the subsequent PRINT_BUF_FLAGS too. Best, Conrad On Fri, Apr 29, 2016 at 9:32 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Fri Apr 29 16:32:28 2016 > New Revision: 298789 > URL: https://svnweb.freebsd.org/changeset/base/298789 > > Log: > bufs: make B_DIRTY and B_PERSISTENT flags available > > It appears these flags were related to ext2fs but are completely > unused nowadays. Retire them. > > Suggested by: mckusick > > Modified: > head/sys/kern/vfs_bio.c > head/sys/sys/buf.h > > Modified: head/sys/kern/vfs_bio.c > ============================================================================== > --- head/sys/kern/vfs_bio.c Fri Apr 29 16:07:25 2016 (r298788) > +++ head/sys/kern/vfs_bio.c Fri Apr 29 16:32:28 2016 (r298789) > @@ -1162,8 +1162,7 @@ vfs_buf_check_unmapped(struct buf *bp) > static int > isbufbusy(struct buf *bp) > { > - if (((bp->b_flags & (B_INVAL | B_PERSISTENT)) == 0 && > - BUF_ISLOCKED(bp)) || > + if (((bp->b_flags & B_INVAL) == 0 && BUF_ISLOCKED(bp)) || > ((bp->b_flags & (B_DELWRI | B_INVAL)) == B_DELWRI)) > return (1); > return (0); > > Modified: head/sys/sys/buf.h > ============================================================================== > --- head/sys/sys/buf.h Fri Apr 29 16:07:25 2016 (r298788) > +++ head/sys/sys/buf.h Fri Apr 29 16:32:28 2016 (r298789) > @@ -200,7 +200,7 @@ struct buf { > #define B_CACHE 0x00000020 /* Bread found us in the cache. */ > #define B_VALIDSUSPWRT 0x00000040 /* Valid write during suspension. */ > #define B_DELWRI 0x00000080 /* Delay I/O until buffer reused. */ > -#define B_PERSISTENT 0x00000100 /* Perm. ref'ed while EXT2FS mounted. */ > +#define B_00000100 0x00000100 /* Available flag. */ > #define B_DONE 0x00000200 /* I/O completed. */ > #define B_EINTR 0x00000400 /* I/O was interrupted */ > #define B_NOREUSE 0x00000800 /* Contents not reused once released. */ > @@ -213,7 +213,7 @@ struct buf { > #define B_00040000 0x00040000 /* Available flag. */ > #define B_00080000 0x00080000 /* Available flag. */ > #define B_00100000 0x00100000 /* Available flag. */ > -#define B_DIRTY 0x00200000 /* Needs writing later (in EXT2FS). */ > +#define B_00200000 0x00200000 /* Available flag. */ > #define B_RELBUF 0x00400000 /* Release VMIO buffer. */ > #define B_FS_FLAG1 0x00800000 /* Available flag for FS use. */ > #define B_NOCOPY 0x01000000 /* Don't copy-on-write this buf. */ > From owner-svn-src-head@freebsd.org Fri Apr 29 17:35:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92E3BB20033; Fri, 29 Apr 2016 17:35:29 +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 6222C1268; Fri, 29 Apr 2016 17:35:29 +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 u3THZSb2057611; Fri, 29 Apr 2016 17:35:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3THZSli057610; Fri, 29 Apr 2016 17:35:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604291735.u3THZSli057610@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Apr 2016 17:35:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298790 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 17:35:29 -0000 Author: jhb Date: Fri Apr 29 17:35:28 2016 New Revision: 298790 URL: https://svnweb.freebsd.org/changeset/base/298790 Log: Don't require write locks on the VM object for vm_page_prev/next. Reviewed by: kib Sponsored by: Chelsio Communications Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Apr 29 16:32:28 2016 (r298789) +++ head/sys/vm/vm_page.c Fri Apr 29 17:35:28 2016 (r298790) @@ -1283,7 +1283,7 @@ vm_page_next(vm_page_t m) { vm_page_t next; - VM_OBJECT_ASSERT_WLOCKED(m->object); + VM_OBJECT_ASSERT_LOCKED(m->object); if ((next = TAILQ_NEXT(m, listq)) != NULL && next->pindex != m->pindex + 1) next = NULL; @@ -1301,7 +1301,7 @@ vm_page_prev(vm_page_t m) { vm_page_t prev; - VM_OBJECT_ASSERT_WLOCKED(m->object); + VM_OBJECT_ASSERT_LOCKED(m->object); if ((prev = TAILQ_PREV(m, pglist, listq)) != NULL && prev->pindex != m->pindex - 1) prev = NULL; From owner-svn-src-head@freebsd.org Fri Apr 29 17:56:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82787B20524; Fri, 29 Apr 2016 17:56:17 +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 46E031DC3; Fri, 29 Apr 2016 17:56:17 +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 u3THuGLr063760; Fri, 29 Apr 2016 17:56:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3THuGBD063759; Fri, 29 Apr 2016 17:56:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201604291756.u3THuGBD063759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 29 Apr 2016 17:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298791 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 17:56:17 -0000 Author: cem Date: Fri Apr 29 17:56:16 2016 New Revision: 298791 URL: https://svnweb.freebsd.org/changeset/base/298791 Log: PRINT_BUF_FLAGS: Remove removed DIRTY/PERSIST flags This is a follow-up to r298789, which removed the B_DIRTY and B_PERSISTENT flags. This changeset removes them from the associated %b bit description string as well. Reviewed by: pfg Sponsored by: EMC / Isilon Storage Division Modified: head/sys/sys/buf.h Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Fri Apr 29 17:35:28 2016 (r298790) +++ head/sys/sys/buf.h Fri Apr 29 17:56:16 2016 (r298791) @@ -226,9 +226,9 @@ struct buf { #define B_REMFREE 0x80000000 /* Delayed bremfree */ #define PRINT_BUF_FLAGS "\20\40remfree\37cluster\36vmio\35ram\34managed" \ - "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26dirty\25b20" \ + "\33paging\32infreecnt\31nocopy\30b23\27relbuf\26b21\25b20" \ "\24b19\23b18\22clusterok\21malloc\20nocache\17b14\16inval" \ - "\15b12\14noreuse\13eintr\12done\11persist\10delwri" \ + "\15b12\14noreuse\13eintr\12done\11b8\10delwri" \ "\7validsuspwrt\6cache\5deferred\4direct\3async\2needcommit\1age" /* From owner-svn-src-head@freebsd.org Fri Apr 29 18:53:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD613B2126B; Fri, 29 Apr 2016 18:53: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 AEEBE19A0; Fri, 29 Apr 2016 18:53: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 u3TIrGm3082138; Fri, 29 Apr 2016 18:53:16 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TIrGjj082137; Fri, 29 Apr 2016 18:53:16 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201604291853.u3TIrGjj082137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 29 Apr 2016 18:53:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298792 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 18:53:18 -0000 Author: adrian Date: Fri Apr 29 18:53:16 2016 New Revision: 298792 URL: https://svnweb.freebsd.org/changeset/base/298792 Log: [ath] initialise do_ldpc to 0. I .. can't believe I missed this. This showed up because the AP was TX'ing LDPC to an iwm(4) chipset, which didn't advertise LDPC and doesn't /accept/ LDPC. Amusingly, all the two other FreeBSD 11n parts I had tested with (AR9380, Intel 7260) and I completely forgot to test on ye olde hardware. That'll teach me. Tested: * AR9580 (AP) - Intel 7260 (STA), AR9380 (STA), Intel 6205 (STA) Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Fri Apr 29 17:56:16 2016 (r298791) +++ head/sys/dev/ath/if_ath_tx_ht.c Fri Apr 29 18:53:16 2016 (r298792) @@ -237,6 +237,7 @@ ath_tx_rate_fill_rcflags(struct ath_soft * It's a global flag, not a per-try flag, so we clear * it if any of the rate entries aren't 11n. */ + do_ldpc = 0; if ((ni->ni_vap->iv_htcaps & IEEE80211_HTCAP_LDPC) && (ni->ni_htcap & IEEE80211_HTCAP_LDPC)) do_ldpc = 1; From owner-svn-src-head@freebsd.org Fri Apr 29 19:10:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB8BFB21512; Fri, 29 Apr 2016 19:10:23 +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 7B462113C; Fri, 29 Apr 2016 19:10:23 +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 u3TJAMbs085499; Fri, 29 Apr 2016 19:10:22 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TJAMi6085498; Fri, 29 Apr 2016 19:10:22 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201604291910.u3TJAMi6085498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Fri, 29 Apr 2016 19:10:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298793 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 19:10:23 -0000 Author: dchagin Date: Fri Apr 29 19:10:22 2016 New Revision: 298793 URL: https://svnweb.freebsd.org/changeset/base/298793 Log: The iwm_nic_error() defined if IWM_DEBUG is defined. Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Fri Apr 29 18:53:16 2016 (r298792) +++ head/sys/dev/iwm/if_iwm.c Fri Apr 29 19:10:22 2016 (r298793) @@ -4363,8 +4363,9 @@ iwm_intr(void *arg) struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); +#ifdef IWM_DEBUG iwm_nic_error(sc); - +#endif /* Dump driver status (TX and RX rings) while we're here. */ device_printf(sc->sc_dev, "driver status:\n"); for (i = 0; i < IWM_MVM_MAX_QUEUES; i++) { From owner-svn-src-head@freebsd.org Fri Apr 29 20:11:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DC6AB2107B; Fri, 29 Apr 2016 20:11: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 CDD1E1271; Fri, 29 Apr 2016 20:11: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 u3TKBAeE005918; Fri, 29 Apr 2016 20:11:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKB9iL005914; Fri, 29 Apr 2016 20:11:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604292011.u3TKB9iL005914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Apr 2016 20:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298796 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:11:11 -0000 Author: jhb Date: Fri Apr 29 20:11:09 2016 New Revision: 298796 URL: https://svnweb.freebsd.org/changeset/base/298796 Log: Introduce a new protocol hook pru_aio_queue. This allows a protocol to claim individual AIO requests instead of using the default socket AIO handling. Sponsored by: Chelsio Communications Modified: head/sys/kern/sys_socket.c head/sys/kern/uipc_domain.c head/sys/kern/uipc_socket.c head/sys/sys/protosw.h Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Fri Apr 29 19:17:31 2016 (r298795) +++ head/sys/kern/sys_socket.c Fri Apr 29 20:11:09 2016 (r298796) @@ -734,8 +734,13 @@ soo_aio_queue(struct file *fp, struct ka { struct socket *so; struct sockbuf *sb; + int error; so = fp->f_data; + error = (*so->so_proto->pr_usrreqs->pru_aio_queue)(so, job); + if (error == 0) + return (0); + switch (job->uaiocb.aio_lio_opcode) { case LIO_READ: sb = &so->so_rcv; Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Fri Apr 29 19:17:31 2016 (r298795) +++ head/sys/kern/uipc_domain.c Fri Apr 29 20:11:09 2016 (r298796) @@ -135,6 +135,7 @@ protosw_init(struct protosw *pr) #define DEFAULT(foo, bar) if ((foo) == NULL) (foo) = (bar) DEFAULT(pu->pru_accept, pru_accept_notsupp); + DEFAULT(pu->pru_aio_queue, pru_aio_queue_notsupp); DEFAULT(pu->pru_bind, pru_bind_notsupp); DEFAULT(pu->pru_bindat, pru_bindat_notsupp); DEFAULT(pu->pru_connect, pru_connect_notsupp); Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Apr 29 19:17:31 2016 (r298795) +++ head/sys/kern/uipc_socket.c Fri Apr 29 20:11:09 2016 (r298796) @@ -3103,6 +3103,13 @@ pru_accept_notsupp(struct socket *so, st } int +pru_aio_queue_notsupp(struct socket *so, struct kaiocb *job) +{ + + return EOPNOTSUPP; +} + +int pru_attach_notsupp(struct socket *so, int proto, struct thread *td) { Modified: head/sys/sys/protosw.h ============================================================================== --- head/sys/sys/protosw.h Fri Apr 29 19:17:31 2016 (r298795) +++ head/sys/sys/protosw.h Fri Apr 29 20:11:09 2016 (r298796) @@ -34,6 +34,7 @@ #define _SYS_PROTOSW_H_ /* Forward declare these structures referenced from prototypes below. */ +struct kaiocb; struct mbuf; struct thread; struct sockaddr; @@ -228,12 +229,14 @@ struct pr_usrreqs { struct thread *td); int (*pru_connectat)(int fd, struct socket *so, struct sockaddr *nam, struct thread *td); + int (*pru_aio_queue)(struct socket *so, struct kaiocb *job); }; /* * All nonvoid pru_*() functions below return EOPNOTSUPP. */ int pru_accept_notsupp(struct socket *so, struct sockaddr **nam); +int pru_aio_queue_notsupp(struct socket *so, struct kaiocb *job); int pru_attach_notsupp(struct socket *so, int proto, struct thread *td); int pru_bind_notsupp(struct socket *so, struct sockaddr *nam, struct thread *td); From owner-svn-src-head@freebsd.org Fri Apr 29 20:12:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E617CB21204; Fri, 29 Apr 2016 20:12:46 +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 B6E3316B8; Fri, 29 Apr 2016 20:12:46 +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 u3TKCjW9006634; Fri, 29 Apr 2016 20:12:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKCjbr006632; Fri, 29 Apr 2016 20:12:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604292012.u3TKCjbr006632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Apr 2016 20:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298797 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:12:47 -0000 Author: jhb Date: Fri Apr 29 20:12:45 2016 New Revision: 298797 URL: https://svnweb.freebsd.org/changeset/base/298797 Log: Expose soaio_enqueue(). This can be used by protocol-specific AIO handlers to queue work to the socket AIO daemon pool. Sponsored by: Chelsio Communications Modified: head/sys/kern/sys_socket.c head/sys/sys/socketvar.h Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Fri Apr 29 20:11:09 2016 (r298796) +++ head/sys/kern/sys_socket.c Fri Apr 29 20:12:45 2016 (r298797) @@ -512,7 +512,7 @@ soaio_kproc_create(void *context, int pe mtx_unlock(&soaio_jobs_lock); } -static void +void soaio_enqueue(struct task *task) { Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Fri Apr 29 20:11:09 2016 (r298796) +++ head/sys/sys/socketvar.h Fri Apr 29 20:12:45 2016 (r298797) @@ -341,6 +341,7 @@ int getsock_cap(struct thread *td, int f struct file **fpp, u_int *fflagp); void soabort(struct socket *so); int soaccept(struct socket *so, struct sockaddr **nam); +void soaio_enqueue(struct task *task); void soaio_rcv(void *context, int pending); void soaio_snd(void *context, int pending); int socheckuid(struct socket *so, uid_t uid); From owner-svn-src-head@freebsd.org Fri Apr 29 20:13:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F56BB2125F; Fri, 29 Apr 2016 20:13:36 +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 10D571846; Fri, 29 Apr 2016 20:13:35 +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 u3TKDZqa006714; Fri, 29 Apr 2016 20:13:35 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKDZFm006713; Fri, 29 Apr 2016 20:13:35 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604292013.u3TKDZFm006713@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 Apr 2016 20:13:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298798 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:13:36 -0000 Author: tuexen Date: Fri Apr 29 20:13:35 2016 New Revision: 298798 URL: https://svnweb.freebsd.org/changeset/base/298798 Log: Use correct order of source and destination address and port. Modified: head/sys/netinet6/udp6_usrreq.c Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri Apr 29 20:12:45 2016 (r298797) +++ head/sys/netinet6/udp6_usrreq.c Fri Apr 29 20:13:35 2016 (r298798) @@ -556,8 +556,8 @@ udp6_common_ctlinput(int cmd, struct soc if (!PRC_IS_REDIRECT(cmd)) { /* Check to see if its tunneled */ struct inpcb *inp; - inp = in6_pcblookup_mbuf(pcbinfo, &ip6->ip6_src, - uh.uh_sport, &ip6->ip6_dst, uh.uh_dport, + inp = in6_pcblookup_mbuf(pcbinfo, &ip6->ip6_dst, + uh.uh_dport, &ip6->ip6_src, uh.uh_sport, INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif, m); if (inp != NULL) { @@ -566,7 +566,7 @@ udp6_common_ctlinput(int cmd, struct soc up = intoudpcb(inp); if (up->u_icmp_func) { /* Yes it is. */ - INP_RUNLOCK(inp); + INP_RUNLOCK(inp); (*up->u_icmp_func)(cmd, (struct sockaddr *)ip6cp->ip6c_src, d, up->u_tun_ctx); return; From owner-svn-src-head@freebsd.org Fri Apr 29 20:22:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AE63BB21473; Fri, 29 Apr 2016 20:22: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 C3CD71EE0; Fri, 29 Apr 2016 20:22:02 +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 u3TKM1Z0009190; Fri, 29 Apr 2016 20:22:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKM1vO009188; Fri, 29 Apr 2016 20:22:01 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604292022.u3TKM1vO009188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 Apr 2016 20:22:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298800 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:22:03 -0000 Author: tuexen Date: Fri Apr 29 20:22:01 2016 New Revision: 298800 URL: https://svnweb.freebsd.org/changeset/base/298800 Log: Add support for handling ICMP and ICMP6 messages sent in response to SCTP/UDP/IP and SCTP/UDP/IPv6 packets. Modified: head/sys/netinet/ip_icmp.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/ip_icmp.h ============================================================================== --- head/sys/netinet/ip_icmp.h Fri Apr 29 20:19:41 2016 (r298799) +++ head/sys/netinet/ip_icmp.h Fri Apr 29 20:22:01 2016 (r298800) @@ -140,9 +140,10 @@ struct icmp { /* * ICMP_ADVLENPREF is the preferred number of bytes which should be contiguous. * SCTP needs additional 12 bytes to be able to access the initiate tag - * in packets containing an INIT chunk. + * in packets containing an INIT chunk. For also supporting SCTP/UDP, + * additional 8 bytes are needed. */ -#define ICMP_ADVLENPREF(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8 + 12) +#define ICMP_ADVLENPREF(p) (8 + ((p)->icmp_ip.ip_hl << 2) + 8 + 8 + 12) /* * Definition of type and code field values. Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Apr 29 20:19:41 2016 (r298799) +++ head/sys/netinet/sctputil.c Fri Apr 29 20:22:01 2016 (r298800) @@ -52,6 +52,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#ifdef INET6 +#include +#endif #ifndef KTR_SCTP @@ -6880,6 +6883,261 @@ out: m_freem(m); } +#ifdef INET +static void +sctp_recv_icmp_tunneled_packet(int cmd, struct sockaddr *sa, void *vip, void *ctx SCTP_UNUSED) +{ + struct ip *outer_ip, *inner_ip; + struct sctphdr *sh; + struct icmp *icmp; + struct udphdr *udp; + struct sctp_inpcb *inp; + struct sctp_tcb *stcb; + struct sctp_nets *net; + struct sctp_init_chunk *ch; + struct sockaddr_in src, dst; + uint8_t type, code; + + inner_ip = (struct ip *)vip; + icmp = (struct icmp *)((caddr_t)inner_ip - + (sizeof(struct icmp) - sizeof(struct ip))); + outer_ip = (struct ip *)((caddr_t)icmp - sizeof(struct ip)); + if (ntohs(outer_ip->ip_len) < + sizeof(struct ip) + 8 + (inner_ip->ip_hl << 2) + sizeof(struct udphdr) + 8) { + return; + } + udp = (struct udphdr *)((caddr_t)inner_ip + (inner_ip->ip_hl << 2)); + sh = (struct sctphdr *)(udp + 1); + memset(&src, 0, sizeof(struct sockaddr_in)); + src.sin_family = AF_INET; + src.sin_len = sizeof(struct sockaddr_in); + src.sin_port = sh->src_port; + src.sin_addr = inner_ip->ip_src; + memset(&dst, 0, sizeof(struct sockaddr_in)); + dst.sin_family = AF_INET; + dst.sin_len = sizeof(struct sockaddr_in); + dst.sin_port = sh->dest_port; + dst.sin_addr = inner_ip->ip_dst; + /* + * 'dst' holds the dest of the packet that failed to be sent. 'src' + * holds our local endpoint address. Thus we reverse the dst and the + * src in the lookup. + */ + inp = NULL; + net = NULL; + stcb = sctp_findassociation_addr_sa((struct sockaddr *)&dst, + (struct sockaddr *)&src, + &inp, &net, 1, + SCTP_DEFAULT_VRFID); + if ((stcb != NULL) && + (net != NULL) && + (inp != NULL) && + (inp->sctp_socket != NULL)) { + /* Check the UDP port numbers */ + if ((udp->uh_dport != net->port) || + (udp->uh_sport != htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)))) { + SCTP_TCB_UNLOCK(stcb); + return; + } + /* Check the verification tag */ + if (ntohl(sh->v_tag) != 0) { + /* + * This must be the verification tag used for + * sending out packets. We don't consider packets + * reflecting the verification tag. + */ + if (ntohl(sh->v_tag) != stcb->asoc.peer_vtag) { + SCTP_TCB_UNLOCK(stcb); + return; + } + } else { + if (ntohs(outer_ip->ip_len) >= + sizeof(struct ip) + + 8 + (inner_ip->ip_hl << 2) + 8 + 20) { + /* + * In this case we can check if we got an + * INIT chunk and if the initiate tag + * matches. + */ + ch = (struct sctp_init_chunk *)(sh + 1); + if ((ch->ch.chunk_type != SCTP_INITIATION) || + (ntohl(ch->init.initiate_tag) != stcb->asoc.my_vtag)) { + SCTP_TCB_UNLOCK(stcb); + return; + } + } else { + SCTP_TCB_UNLOCK(stcb); + return; + } + } + type = icmp->icmp_type; + code = icmp->icmp_code; + if ((type = ICMP_UNREACH) && + (code = ICMP_UNREACH_PORT)) { + code = ICMP_UNREACH_PROTOCOL; + } + sctp_notify(inp, stcb, net, type, code, + ntohs(inner_ip->ip_len), + ntohs(icmp->icmp_nextmtu)); + } else { + if ((stcb == NULL) && (inp != NULL)) { + /* reduce ref-count */ + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); + } + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } + } + return; +} + +#endif + +#ifdef INET6 +static void +sctp_recv_icmp6_tunneled_packet(int cmd, struct sockaddr *sa, void *d, void *ctx SCTP_UNUSED) +{ + struct ip6ctlparam *ip6cp; + struct sctp_inpcb *inp; + struct sctp_tcb *stcb; + struct sctp_nets *net; + struct sctphdr sh; + struct udphdr udp; + struct sockaddr_in6 src, dst; + uint8_t type, code; + + ip6cp = (struct ip6ctlparam *)d; + /* + * XXX: We assume that when IPV6 is non NULL, M and OFF are valid. + */ + if (ip6cp->ip6c_m == NULL) { + return; + } + /* + * Check if we can safely examine the ports and the verification tag + * of the SCTP common header. + */ + if (ip6cp->ip6c_m->m_pkthdr.len < + ip6cp->ip6c_off + sizeof(struct udphdr) + offsetof(struct sctphdr, checksum)) { + return; + } + /* Copy out the UDP header. */ + memset(&udp, 0, sizeof(struct udphdr)); + m_copydata(ip6cp->ip6c_m, + ip6cp->ip6c_off, + sizeof(struct udphdr), + (caddr_t)&udp); + /* Copy out the port numbers and the verification tag. */ + memset(&sh, 0, sizeof(struct sctphdr)); + m_copydata(ip6cp->ip6c_m, + ip6cp->ip6c_off + sizeof(struct udphdr), + sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint32_t), + (caddr_t)&sh); + memset(&src, 0, sizeof(struct sockaddr_in6)); + src.sin6_family = AF_INET6; + src.sin6_len = sizeof(struct sockaddr_in6); + src.sin6_port = sh.src_port; + src.sin6_addr = ip6cp->ip6c_ip6->ip6_src; + if (in6_setscope(&src.sin6_addr, ip6cp->ip6c_m->m_pkthdr.rcvif, NULL) != 0) { + return; + } + memset(&dst, 0, sizeof(struct sockaddr_in6)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(struct sockaddr_in6); + dst.sin6_port = sh.dest_port; + dst.sin6_addr = ip6cp->ip6c_ip6->ip6_dst; + if (in6_setscope(&dst.sin6_addr, ip6cp->ip6c_m->m_pkthdr.rcvif, NULL) != 0) { + return; + } + inp = NULL; + net = NULL; + stcb = sctp_findassociation_addr_sa((struct sockaddr *)&dst, + (struct sockaddr *)&src, + &inp, &net, 1, SCTP_DEFAULT_VRFID); + if ((stcb != NULL) && + (net != NULL) && + (inp != NULL) && + (inp->sctp_socket != NULL)) { + /* Check the UDP port numbers */ + if ((udp.uh_dport != net->port) || + (udp.uh_sport != htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)))) { + SCTP_TCB_UNLOCK(stcb); + return; + } + /* Check the verification tag */ + if (ntohl(sh.v_tag) != 0) { + /* + * This must be the verification tag used for + * sending out packets. We don't consider packets + * reflecting the verification tag. + */ + if (ntohl(sh.v_tag) != stcb->asoc.peer_vtag) { + SCTP_TCB_UNLOCK(stcb); + return; + } + } else { + if (ip6cp->ip6c_m->m_pkthdr.len >= + ip6cp->ip6c_off + sizeof(struct udphdr) + + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr) + + offsetof(struct sctp_init, a_rwnd)) { + /* + * In this case we can check if we got an + * INIT chunk and if the initiate tag + * matches. + */ + uint32_t initiate_tag; + uint8_t chunk_type; + + m_copydata(ip6cp->ip6c_m, + ip6cp->ip6c_off + + sizeof(struct udphdr) + + sizeof(struct sctphdr), + sizeof(uint8_t), + (caddr_t)&chunk_type); + m_copydata(ip6cp->ip6c_m, + ip6cp->ip6c_off + + sizeof(struct udphdr) + + sizeof(struct sctphdr) + + sizeof(struct sctp_chunkhdr), + sizeof(uint32_t), + (caddr_t)&initiate_tag); + if ((chunk_type != SCTP_INITIATION) || + (ntohl(initiate_tag) != stcb->asoc.my_vtag)) { + SCTP_TCB_UNLOCK(stcb); + return; + } + } else { + SCTP_TCB_UNLOCK(stcb); + return; + } + } + type = ip6cp->ip6c_icmp6->icmp6_type; + code = ip6cp->ip6c_icmp6->icmp6_code; + if ((type == ICMP6_DST_UNREACH) && + (code == ICMP6_DST_UNREACH_NOPORT)) { + type = ICMP6_PARAM_PROB; + code = ICMP6_PARAMPROB_NEXTHEADER; + } + sctp6_notify(inp, stcb, net, type, code, + (uint16_t) ntohl(ip6cp->ip6c_icmp6->icmp6_mtu)); + } else { + if ((stcb == NULL) && (inp != NULL)) { + /* reduce inp's ref-count */ + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); + } + if (stcb) { + SCTP_TCB_UNLOCK(stcb); + } + } +} + +#endif + void sctp_over_udp_stop(void) { @@ -6945,7 +7203,9 @@ sctp_over_udp_start(void) } /* Call the special UDP hook. */ if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp4_tun_socket), - sctp_recv_udp_tunneled_packet, NULL, NULL))) { + sctp_recv_udp_tunneled_packet, + sctp_recv_icmp_tunneled_packet, + NULL))) { sctp_over_udp_stop(); return (ret); } @@ -6969,7 +7229,9 @@ sctp_over_udp_start(void) } /* Call the special UDP hook. */ if ((ret = udp_set_kernel_tunneling(SCTP_BASE_INFO(udp6_tun_socket), - sctp_recv_udp_tunneled_packet, NULL, NULL))) { + sctp_recv_udp_tunneled_packet, + sctp_recv_icmp6_tunneled_packet, + NULL))) { sctp_over_udp_stop(); return (ret); } From owner-svn-src-head@freebsd.org Fri Apr 29 20:22:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D294B214A0; Fri, 29 Apr 2016 20:22: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 4EF9710E7; Fri, 29 Apr 2016 20:22:11 +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 u3TKMAkN009238; Fri, 29 Apr 2016 20:22:10 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKMAsP009237; Fri, 29 Apr 2016 20:22:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292022.u3TKMAsP009237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 20:22:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298801 - head/sys/compat/x86bios X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:22:11 -0000 Author: pfg Date: Fri Apr 29 20:22:10 2016 New Revision: 298801 URL: https://svnweb.freebsd.org/changeset/base/298801 Log: x86bios_alloc(): Unsign a counter. The value can't even be signed so we can avoid the signed vs. unsigned comparison. Reviewed by: jkim Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Fri Apr 29 20:22:01 2016 (r298800) +++ head/sys/compat/x86bios/x86bios.c Fri Apr 29 20:22:10 2016 (r298801) @@ -119,7 +119,7 @@ void * x86bios_alloc(uint32_t *offset, size_t size, int flags) { void *vaddr; - int i; + u_int i; if (offset == NULL || size == 0) return (NULL); From owner-svn-src-head@freebsd.org Fri Apr 29 20:31:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F8C2B2171C; Fri, 29 Apr 2016 20:31:50 +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 1FFA81666; Fri, 29 Apr 2016 20:31:50 +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 u3TKVnd9012898; Fri, 29 Apr 2016 20:31:49 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKVntk012894; Fri, 29 Apr 2016 20:31:49 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604292031.u3TKVntk012894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 29 Apr 2016 20:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298802 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:31:50 -0000 Author: gonzo Date: Fri Apr 29 20:31:49 2016 New Revision: 298802 URL: https://svnweb.freebsd.org/changeset/base/298802 Log: Add driver for AM33xx SoC touchscreen Split ADC driver in two halves: ADC(analog ot digital) and TSC(touchscreen). Touchscreen driver is fully functional up to the point of reporting samples. This part will be added once FreeBSD has API for touchscreen. Tested on: Beaglebone Black + 4DCAPE-43T Reviewed by: loos Differential Revision: https://reviews.freebsd.org/D5847 Modified: head/sys/arm/ti/ti_adc.c head/sys/arm/ti/ti_adcreg.h head/sys/arm/ti/ti_adcvar.h Modified: head/sys/arm/ti/ti_adc.c ============================================================================== --- head/sys/arm/ti/ti_adc.c Fri Apr 29 20:22:10 2016 (r298801) +++ head/sys/arm/ti/ti_adc.c Fri Apr 29 20:31:49 2016 (r298802) @@ -31,17 +31,23 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include #include #include +#include #include #include #include +#include +#include +#include #include +#include #include #include #include @@ -50,16 +56,26 @@ __FBSDID("$FreeBSD$"); #include #include +#undef DEBUG_TSC + +#define DEFAULT_CHARGE_DELAY 0x400 +#define STEPDLY_OPEN 0x98 + +#define ORDER_XP 0 +#define ORDER_XN 1 +#define ORDER_YP 2 +#define ORDER_YN 3 + /* Define our 8 steps, one for each input channel. */ static struct ti_adc_input ti_adc_inputs[TI_ADC_NPINS] = { - { .stepconfig = ADC_STEPCFG1, .stepdelay = ADC_STEPDLY1 }, - { .stepconfig = ADC_STEPCFG2, .stepdelay = ADC_STEPDLY2 }, - { .stepconfig = ADC_STEPCFG3, .stepdelay = ADC_STEPDLY3 }, - { .stepconfig = ADC_STEPCFG4, .stepdelay = ADC_STEPDLY4 }, - { .stepconfig = ADC_STEPCFG5, .stepdelay = ADC_STEPDLY5 }, - { .stepconfig = ADC_STEPCFG6, .stepdelay = ADC_STEPDLY6 }, - { .stepconfig = ADC_STEPCFG7, .stepdelay = ADC_STEPDLY7 }, - { .stepconfig = ADC_STEPCFG8, .stepdelay = ADC_STEPDLY8 }, + { .stepconfig = ADC_STEPCFG(1), .stepdelay = ADC_STEPDLY(1) }, + { .stepconfig = ADC_STEPCFG(2), .stepdelay = ADC_STEPDLY(2) }, + { .stepconfig = ADC_STEPCFG(3), .stepdelay = ADC_STEPDLY(3) }, + { .stepconfig = ADC_STEPCFG(4), .stepdelay = ADC_STEPDLY(4) }, + { .stepconfig = ADC_STEPCFG(5), .stepdelay = ADC_STEPDLY(5) }, + { .stepconfig = ADC_STEPCFG(6), .stepdelay = ADC_STEPDLY(6) }, + { .stepconfig = ADC_STEPCFG(7), .stepdelay = ADC_STEPDLY(7) }, + { .stepconfig = ADC_STEPCFG(8), .stepdelay = ADC_STEPDLY(8) }, }; static int ti_adc_samples[5] = { 0, 2, 4, 8, 16 }; @@ -67,6 +83,7 @@ static int ti_adc_samples[5] = { 0, 2, 4 static void ti_adc_enable(struct ti_adc_softc *sc) { + uint32_t reg; TI_ADC_LOCK_ASSERT(sc); @@ -75,10 +92,28 @@ ti_adc_enable(struct ti_adc_softc *sc) /* Enable the FIFO0 threshold and the end of sequence interrupt. */ ADC_WRITE4(sc, ADC_IRQENABLE_SET, - ADC_IRQ_FIFO0_THRES | ADC_IRQ_END_OF_SEQ); + ADC_IRQ_FIFO0_THRES | ADC_IRQ_FIFO1_THRES | ADC_IRQ_END_OF_SEQ); + reg = ADC_CTRL_STEP_WP | ADC_CTRL_STEP_ID; + if (sc->sc_tsc_wires > 0) { + reg |= ADC_CTRL_TSC_ENABLE; + switch (sc->sc_tsc_wires) { + case 4: + reg |= ADC_CTRL_TSC_4WIRE; + break; + case 5: + reg |= ADC_CTRL_TSC_5WIRE; + break; + case 8: + reg |= ADC_CTRL_TSC_8WIRE; + break; + default: + break; + } + } + reg |= ADC_CTRL_ENABLE; /* Enable the ADC. Run thru enabled steps, start the conversions. */ - ADC_WRITE4(sc, ADC_CTRL, ADC_READ4(sc, ADC_CTRL) | ADC_CTRL_ENABLE); + ADC_WRITE4(sc, ADC_CTRL, reg); sc->sc_last_state = 1; } @@ -102,7 +137,7 @@ ti_adc_disable(struct ti_adc_softc *sc) /* Disable the FIFO0 threshold and the end of sequence interrupt. */ ADC_WRITE4(sc, ADC_IRQENABLE_CLR, - ADC_IRQ_FIFO0_THRES | ADC_IRQ_END_OF_SEQ); + ADC_IRQ_FIFO0_THRES | ADC_IRQ_FIFO1_THRES | ADC_IRQ_END_OF_SEQ); /* ACK any pending interrupt. */ ADC_WRITE4(sc, ADC_IRQSTATUS, ADC_READ4(sc, ADC_IRQSTATUS)); @@ -114,20 +149,27 @@ ti_adc_disable(struct ti_adc_softc *sc) count = ADC_READ4(sc, ADC_FIFO0COUNT) & ADC_FIFO_COUNT_MSK; } + count = ADC_READ4(sc, ADC_FIFO1COUNT) & ADC_FIFO_COUNT_MSK; + while (count > 0) { + data = ADC_READ4(sc, ADC_FIFO1DATA); + count = ADC_READ4(sc, ADC_FIFO1COUNT) & ADC_FIFO_COUNT_MSK; + } + sc->sc_last_state = 0; } static int ti_adc_setup(struct ti_adc_softc *sc) { - int ain; + int ain, i; uint32_t enabled; TI_ADC_LOCK_ASSERT(sc); /* Check for enabled inputs. */ - enabled = 0; - for (ain = 0; ain < TI_ADC_NPINS; ain++) { + enabled = sc->sc_tsc_enabled; + for (i = 0; i < sc->sc_adc_nchannels; i++) { + ain = sc->sc_adc_channels[i]; if (ti_adc_inputs[ain].enable) enabled |= (1U << (ain + 1)); } @@ -182,13 +224,15 @@ ti_adc_input_setup(struct ti_adc_softc * static void ti_adc_reset(struct ti_adc_softc *sc) { - int ain; + int ain, i; TI_ADC_LOCK_ASSERT(sc); /* Disable all the inputs. */ - for (ain = 0; ain < TI_ADC_NPINS; ain++) + for (i = 0; i < sc->sc_adc_nchannels; i++) { + ain = sc->sc_adc_channels[i]; ti_adc_inputs[ain].enable = 0; + } } static int @@ -345,31 +389,127 @@ ti_adc_read_data(struct ti_adc_softc *sc } } +static int +cmp_values(const void *a, const void *b) +{ + const uint32_t *v1, *v2; + v1 = a; + v2 = b; + if (*v1 < *v2) + return -1; + if (*v1 > *v2) + return 1; + + return (0); +} + +static void +ti_adc_tsc_read_data(struct ti_adc_softc *sc) +{ + int count; + uint32_t data[16]; + uint32_t x, y; + int i, start, end; + + TI_ADC_LOCK_ASSERT(sc); + + /* Read the available data. */ + count = ADC_READ4(sc, ADC_FIFO1COUNT) & ADC_FIFO_COUNT_MSK; + if (count == 0) + return; + + i = 0; + while (count > 0) { + data[i++] = ADC_READ4(sc, ADC_FIFO1DATA) & ADC_FIFO_DATA_MSK; + count = ADC_READ4(sc, ADC_FIFO1COUNT) & ADC_FIFO_COUNT_MSK; + } + + if (sc->sc_coord_readouts > 3) { + start = 1; + end = sc->sc_coord_readouts - 1; + qsort(data, sc->sc_coord_readouts, + sizeof(data[0]), &cmp_values); + qsort(&data[sc->sc_coord_readouts + 2], + sc->sc_coord_readouts, + sizeof(data[0]), &cmp_values); + } + else { + start = 0; + end = sc->sc_coord_readouts; + } + + x = y = 0; + for (i = start; i < end; i++) + y += data[i]; + y /= (end - start); + + for (i = sc->sc_coord_readouts + 2 + start; i < sc->sc_coord_readouts + 2 + end; i++) + x += data[i]; + x /= (end - start); + +#ifdef DEBUG_TSC + device_printf(sc->sc_dev, "touchscreen x: %d, y: %d\n", x, y); +#endif + /* TODO: That's where actual event reporting should take place */ +} + +static void +ti_adc_intr_locked(struct ti_adc_softc *sc, uint32_t status) +{ + /* Read the available data. */ + if (status & ADC_IRQ_FIFO0_THRES) + ti_adc_read_data(sc); +} + +static void +ti_adc_tsc_intr_locked(struct ti_adc_softc *sc, uint32_t status) +{ + /* Read the available data. */ + if (status & ADC_IRQ_FIFO1_THRES) + ti_adc_tsc_read_data(sc); + +} + static void ti_adc_intr(void *arg) { struct ti_adc_softc *sc; - uint32_t status; + uint32_t status, rawstatus; sc = (struct ti_adc_softc *)arg; + TI_ADC_LOCK(sc); + + rawstatus = ADC_READ4(sc, ADC_IRQSTATUS_RAW); status = ADC_READ4(sc, ADC_IRQSTATUS); - if (status == 0) - return; - if (status & ~(ADC_IRQ_FIFO0_THRES | ADC_IRQ_END_OF_SEQ)) - device_printf(sc->sc_dev, "stray interrupt: %#x\n", status); - TI_ADC_LOCK(sc); - /* ACK the interrupt. */ - ADC_WRITE4(sc, ADC_IRQSTATUS, status); + if (rawstatus & ADC_IRQ_HW_PEN_ASYNC) { + sc->sc_pen_down = 1; + status |= ADC_IRQ_HW_PEN_ASYNC; + ADC_WRITE4(sc, ADC_IRQENABLE_CLR, + ADC_IRQ_HW_PEN_ASYNC); + } + + if (rawstatus & ADC_IRQ_PEN_UP) { + sc->sc_pen_down = 0; + status |= ADC_IRQ_PEN_UP; + } - /* Read the available data. */ if (status & ADC_IRQ_FIFO0_THRES) - ti_adc_read_data(sc); + ti_adc_intr_locked(sc, status); + + if (status & ADC_IRQ_FIFO1_THRES) + ti_adc_tsc_intr_locked(sc, status); + + if (status) { + /* ACK the interrupt. */ + ADC_WRITE4(sc, ADC_IRQSTATUS, status); + } /* Start the next conversion ? */ if (status & ADC_IRQ_END_OF_SEQ) ti_adc_setup(sc); + TI_ADC_UNLOCK(sc); } @@ -380,7 +520,7 @@ ti_adc_sysctl_init(struct ti_adc_softc * struct sysctl_ctx_list *ctx; struct sysctl_oid *tree_node, *inp_node, *inpN_node; struct sysctl_oid_list *tree, *inp_tree, *inpN_tree; - int ain; + int ain, i; /* * Add per-pin sysctl tree/handlers. @@ -395,7 +535,8 @@ ti_adc_sysctl_init(struct ti_adc_softc * CTLFLAG_RD, NULL, "ADC inputs"); inp_tree = SYSCTL_CHILDREN(inp_node); - for (ain = 0; ain < TI_ADC_NPINS; ain++) { + for (i = 0; i < sc->sc_adc_nchannels; i++) { + ain = sc->sc_adc_channels[i]; snprintf(pinbuf, sizeof(pinbuf), "%d", ain); inpN_node = SYSCTL_ADD_NODE(ctx, inp_tree, OID_AUTO, pinbuf, @@ -420,11 +561,12 @@ ti_adc_sysctl_init(struct ti_adc_softc * static void ti_adc_inputs_init(struct ti_adc_softc *sc) { - int ain; + int ain, i; struct ti_adc_input *input; TI_ADC_LOCK(sc); - for (ain = 0; ain < TI_ADC_NPINS; ain++) { + for (i = 0; i < sc->sc_adc_nchannels; i++) { + ain = sc->sc_adc_channels[i]; input = &ti_adc_inputs[ain]; input->sc = sc; input->input = ain; @@ -437,29 +579,126 @@ ti_adc_inputs_init(struct ti_adc_softc * } static void -ti_adc_idlestep_init(struct ti_adc_softc *sc) +ti_adc_tsc_init(struct ti_adc_softc *sc) { - uint32_t val; + int i, start_step, end_step; + uint32_t stepconfig, val; + + TI_ADC_LOCK(sc); + + /* X coordinates */ + stepconfig = ADC_STEP_FIFO1 | (4 << ADC_STEP_AVG_SHIFT) | + ADC_STEP_MODE_HW_ONESHOT | sc->sc_xp_bit; + if (sc->sc_tsc_wires == 4) + stepconfig |= ADC_STEP_INP(sc->sc_yp_inp) | sc->sc_xn_bit; + else if (sc->sc_tsc_wires == 5) + stepconfig |= ADC_STEP_INP(4) | + sc->sc_xn_bit | sc->sc_yn_bit | sc->sc_yp_bit; + else if (sc->sc_tsc_wires == 8) + stepconfig |= ADC_STEP_INP(sc->sc_yp_inp) | sc->sc_xn_bit; + + start_step = ADC_STEPS - sc->sc_coord_readouts + 1; + end_step = start_step + sc->sc_coord_readouts - 1; + for (i = start_step; i <= end_step; i++) { + ADC_WRITE4(sc, ADC_STEPCFG(i), stepconfig); + ADC_WRITE4(sc, ADC_STEPDLY(i), STEPDLY_OPEN); + } + + /* Y coordinates */ + stepconfig = ADC_STEP_FIFO1 | (4 << ADC_STEP_AVG_SHIFT) | + ADC_STEP_MODE_HW_ONESHOT | sc->sc_yn_bit | + ADC_STEP_INM(8); + if (sc->sc_tsc_wires == 4) + stepconfig |= ADC_STEP_INP(sc->sc_xp_inp) | sc->sc_yp_bit; + else if (sc->sc_tsc_wires == 5) + stepconfig |= ADC_STEP_INP(4) | + sc->sc_xp_bit | sc->sc_xn_bit | sc->sc_yp_bit; + else if (sc->sc_tsc_wires == 8) + stepconfig |= ADC_STEP_INP(sc->sc_xp_inp) | sc->sc_yp_bit; + + start_step = ADC_STEPS - (sc->sc_coord_readouts*2 + 2) + 1; + end_step = start_step + sc->sc_coord_readouts - 1; + for (i = start_step; i <= end_step; i++) { + ADC_WRITE4(sc, ADC_STEPCFG(i), stepconfig); + ADC_WRITE4(sc, ADC_STEPDLY(i), STEPDLY_OPEN); + } + /* Charge config */ val = ADC_READ4(sc, ADC_IDLECONFIG); + ADC_WRITE4(sc, ADC_TC_CHARGE_STEPCONFIG, val); + ADC_WRITE4(sc, ADC_TC_CHARGE_DELAY, sc->sc_charge_delay); - /* Set single ended operation. */ - val &= ~ADC_STEP_DIFF_CNTRL; + /* 2 steps for Z */ + start_step = ADC_STEPS - (sc->sc_coord_readouts + 2) + 1; + stepconfig = ADC_STEP_FIFO1 | (4 << ADC_STEP_AVG_SHIFT) | + ADC_STEP_MODE_HW_ONESHOT | sc->sc_yp_bit | + sc->sc_xn_bit | ADC_STEP_INP(sc->sc_xp_inp) | + ADC_STEP_INM(8); + ADC_WRITE4(sc, ADC_STEPCFG(start_step), stepconfig); + ADC_WRITE4(sc, ADC_STEPDLY(start_step), STEPDLY_OPEN); + start_step++; + stepconfig |= ADC_STEP_INP(sc->sc_yn_inp); + ADC_WRITE4(sc, ADC_STEPCFG(start_step), stepconfig); + ADC_WRITE4(sc, ADC_STEPDLY(start_step), STEPDLY_OPEN); + + ADC_WRITE4(sc, ADC_FIFO1THRESHOLD, (sc->sc_coord_readouts*2 + 2) - 1); + + sc->sc_tsc_enabled = 1; + start_step = ADC_STEPS - (sc->sc_coord_readouts*2 + 2) + 1; + end_step = ADC_STEPS; + for (i = start_step; i <= end_step; i++) { + sc->sc_tsc_enabled |= (1 << i); + } - /* Set the negative voltage reference. */ - val &= ~ADC_STEP_RFM_MSK; - /* Set the positive voltage reference. */ - val &= ~ADC_STEP_RFP_MSK; + TI_ADC_UNLOCK(sc); +} - /* Connect the input to VREFN. */ - val &= ~ADC_STEP_INP_MSK; - val |= ADC_STEP_IN_VREFN << ADC_STEP_INP_SHIFT; +static void +ti_adc_idlestep_init(struct ti_adc_softc *sc) +{ + uint32_t val; + + val = ADC_STEP_YNN_SW | ADC_STEP_INM(8) | ADC_STEP_INP(8) | ADC_STEP_YPN_SW; ADC_WRITE4(sc, ADC_IDLECONFIG, val); } static int +ti_adc_config_wires(struct ti_adc_softc *sc, int *wire_configs, int nwire_configs) +{ + int i; + int wire, ai; + + for (i = 0; i < nwire_configs; i++) { + wire = wire_configs[i] & 0xf; + ai = (wire_configs[i] >> 4) & 0xf; + switch (wire) { + case ORDER_XP: + sc->sc_xp_bit = ADC_STEP_XPP_SW; + sc->sc_xp_inp = ai; + break; + case ORDER_XN: + sc->sc_xn_bit = ADC_STEP_XNN_SW; + sc->sc_xn_inp = ai; + break; + case ORDER_YP: + sc->sc_yp_bit = ADC_STEP_YPP_SW; + sc->sc_yp_inp = ai; + break; + case ORDER_YN: + sc->sc_yn_bit = ADC_STEP_YNN_SW; + sc->sc_yn_inp = ai; + break; + default: + device_printf(sc->sc_dev, "Invalid wire config\n"); + return (-1); + } + } + return (0); +} + +static int ti_adc_probe(device_t dev) { @@ -473,17 +712,68 @@ ti_adc_probe(device_t dev) static int ti_adc_attach(device_t dev) { - int err, rid; + int err, rid, i; struct ti_adc_softc *sc; - uint32_t reg, rev; + uint32_t rev, reg; + phandle_t node, child; + pcell_t cell; + int *channels; + int nwire_configs; + int *wire_configs; sc = device_get_softc(dev); sc->sc_dev = dev; - /* Activate the ADC_TSC module. */ - err = ti_prcm_clk_enable(TSC_ADC_CLK); - if (err) - return (err); + node = ofw_bus_get_node(dev); + + sc->sc_tsc_wires = 0; + sc->sc_coord_readouts = 1; + sc->sc_x_plate_resistance = 0; + sc->sc_charge_delay = DEFAULT_CHARGE_DELAY; + /* Read "tsc" node properties */ + child = ofw_bus_find_child(node, "tsc"); + if (child != 0) { + if ((OF_getprop(child, "ti,wires", &cell, sizeof(cell))) > 0) + sc->sc_tsc_wires = fdt32_to_cpu(cell); + if ((OF_getprop(child, "ti,coordinate-readouts", &cell, sizeof(cell))) > 0) + sc->sc_coord_readouts = fdt32_to_cpu(cell); + if ((OF_getprop(child, "ti,x-plate-resistance", &cell, sizeof(cell))) > 0) + sc->sc_x_plate_resistance = fdt32_to_cpu(cell); + if ((OF_getprop(child, "ti,charge-delay", &cell, sizeof(cell))) > 0) + sc->sc_charge_delay = fdt32_to_cpu(cell); + nwire_configs = OF_getencprop_alloc(child, "ti,wire-config", + sizeof(*wire_configs), (void **)&wire_configs); + if (nwire_configs != sc->sc_tsc_wires) { + device_printf(sc->sc_dev, + "invalid nubmer of ti,wire-config: %d (should be %d)\n", + nwire_configs, sc->sc_tsc_wires); + free(wire_configs, M_OFWPROP); + return (EINVAL); + } + err = ti_adc_config_wires(sc, wire_configs, nwire_configs); + free(wire_configs, M_OFWPROP); + if (err) + return (EINVAL); + } + + /* Read "adc" node properties */ + child = ofw_bus_find_child(node, "adc"); + if (child != 0) { + sc->sc_adc_nchannels = OF_getencprop_alloc(child, "ti,adc-channels", + sizeof(*channels), (void **)&channels); + if (sc->sc_adc_nchannels > 0) { + for (i = 0; i < sc->sc_adc_nchannels; i++) + sc->sc_adc_channels[i] = channels[i]; + free(channels, M_OFWPROP); + } + } + + /* Sanity check FDT data */ + if (sc->sc_tsc_wires + sc->sc_adc_nchannels > TI_ADC_NPINS) { + device_printf(dev, "total number of chanels (%d) is larger than %d\n", + sc->sc_tsc_wires + sc->sc_adc_nchannels, TI_ADC_NPINS); + return (ENXIO); + } rid = 0; sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, @@ -493,6 +783,11 @@ ti_adc_attach(device_t dev) return (ENXIO); } + /* Activate the ADC_TSC module. */ + err = ti_prcm_clk_enable(TSC_ADC_CLK); + if (err) + return (err); + rid = 0; sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); @@ -521,25 +816,29 @@ ti_adc_attach(device_t dev) rev & ADC_REV_MINOR_MSK, (rev & ADC_REV_CUSTOM_MSK) >> ADC_REV_CUSTOM_SHIFT); - /* - * Disable the step write protect and make it store the step ID for - * the captured data on FIFO. - */ reg = ADC_READ4(sc, ADC_CTRL); ADC_WRITE4(sc, ADC_CTRL, reg | ADC_CTRL_STEP_WP | ADC_CTRL_STEP_ID); /* - * Set the ADC prescaler to 2400 (yes, the actual value written here - * is 2400 - 1). - * This sets the ADC clock to ~10Khz (CLK_M_OSC / 2400). + * Set the ADC prescaler to 2400 if touchscreen is not enabled + * and to 24 if it is. This sets the ADC clock to ~10Khz and + * ~1Mhz respectively (CLK_M_OSC / prescaler). */ - ADC_WRITE4(sc, ADC_CLKDIV, 2399); + if (sc->sc_tsc_wires) + ADC_WRITE4(sc, ADC_CLKDIV, 24 - 1); + else + ADC_WRITE4(sc, ADC_CLKDIV, 2400 - 1); TI_ADC_LOCK_INIT(sc); ti_adc_idlestep_init(sc); ti_adc_inputs_init(sc); ti_adc_sysctl_init(sc); + ti_adc_tsc_init(sc); + + TI_ADC_LOCK(sc); + ti_adc_setup(sc); + TI_ADC_UNLOCK(sc); return (0); } Modified: head/sys/arm/ti/ti_adcreg.h ============================================================================== --- head/sys/arm/ti/ti_adcreg.h Fri Apr 29 20:22:10 2016 (r298801) +++ head/sys/arm/ti/ti_adcreg.h Fri Apr 29 20:31:49 2016 (r298802) @@ -60,6 +60,10 @@ #define ADC_IRQ_END_OF_SEQ (1 << 1) #define ADC_IRQ_HW_PEN_ASYNC (1 << 0) #define ADC_CTRL 0x040 +#define ADC_CTRL_TSC_ENABLE (1 << 7) +#define ADC_CTRL_TSC_4WIRE (1 << 5) +#define ADC_CTRL_TSC_5WIRE (2 << 5) +#define ADC_CTRL_TSC_8WIRE (3 << 5) #define ADC_CTRL_STEP_WP (1 << 2) #define ADC_CTRL_STEP_ID (1 << 1) #define ADC_CTRL_ENABLE (1 << 0) @@ -67,22 +71,12 @@ #define ADC_CLKDIV 0x04c #define ADC_STEPENABLE 0x054 #define ADC_IDLECONFIG 0x058 -#define ADC_STEPCFG1 0x064 -#define ADC_STEPDLY1 0x068 -#define ADC_STEPCFG2 0x06c -#define ADC_STEPDLY2 0x070 -#define ADC_STEPCFG3 0x074 -#define ADC_STEPDLY3 0x078 -#define ADC_STEPCFG4 0x07c -#define ADC_STEPDLY4 0x080 -#define ADC_STEPCFG5 0x084 -#define ADC_STEPDLY5 0x088 -#define ADC_STEPCFG6 0x08c -#define ADC_STEPDLY6 0x090 -#define ADC_STEPCFG7 0x094 -#define ADC_STEPDLY7 0x098 -#define ADC_STEPCFG8 0x09c -#define ADC_STEPDLY8 0x0a0 +#define ADC_TC_CHARGE_STEPCONFIG 0x05C +#define ADC_TC_CHARGE_DELAY 0x060 +#define ADC_STEPS 16 +#define ADC_STEPCFG(n) (0x064 + (8*((n)-1))) +#define ADC_STEPDLY(n) (0x068 + (8*((n)-1))) +#define ADC_STEP_FIFO1 (1 << 26) #define ADC_STEP_DIFF_CNTRL (1 << 25) #define ADC_STEP_RFM_MSK 0x01800000 #define ADC_STEP_RFM_SHIFT 23 @@ -92,8 +86,10 @@ #define ADC_STEP_RFM_VREFN 3 #define ADC_STEP_INP_MSK 0x00780000 #define ADC_STEP_INP_SHIFT 19 +#define ADC_STEP_INP(i) ((i) << ADC_STEP_INP_SHIFT) #define ADC_STEP_INM_MSK 0x00078000 #define ADC_STEP_INM_SHIFT 15 +#define ADC_STEP_INM(i) ((i) << ADC_STEP_INM_SHIFT) #define ADC_STEP_IN_VREFN 8 #define ADC_STEP_RFP_MSK 0x00007000 #define ADC_STEP_RFP_SHIFT 12 @@ -102,16 +98,26 @@ #define ADC_STEP_RFP_YPLL 2 #define ADC_STEP_RFP_VREFP 3 #define ADC_STEP_RFP_INTREF 4 +#define ADC_STEP_YPN_SW (1 << 10) +#define ADC_STEP_YNN_SW (1 << 8) +#define ADC_STEP_YPP_SW (1 << 7) +#define ADC_STEP_XNN_SW (1 << 6) +#define ADC_STEP_XPP_SW (1 << 5) #define ADC_STEP_AVG_MSK 0x0000001c #define ADC_STEP_AVG_SHIFT 2 #define ADC_STEP_MODE_MSK 0x00000003 #define ADC_STEP_MODE_ONESHOT 0x00000000 #define ADC_STEP_MODE_CONTINUOUS 0x00000001 +#define ADC_STEP_MODE_HW_ONESHOT 0x00000002 +#define ADC_STEP_MODE_HW_CONTINUOUS 0x00000003 #define ADC_STEP_SAMPLE_DELAY 0xff000000 #define ADC_STEP_OPEN_DELAY 0x0003ffff #define ADC_FIFO0COUNT 0x0e4 #define ADC_FIFO0THRESHOLD 0x0e8 +#define ADC_FIFO1COUNT 0x0f0 +#define ADC_FIFO1THRESHOLD 0x0f4 #define ADC_FIFO0DATA 0x100 +#define ADC_FIFO1DATA 0x200 #define ADC_FIFO_COUNT_MSK 0x0000007f #define ADC_FIFO_STEP_ID_MSK 0x000f0000 #define ADC_FIFO_STEP_ID_SHIFT 16 Modified: head/sys/arm/ti/ti_adcvar.h ============================================================================== --- head/sys/arm/ti/ti_adcvar.h Fri Apr 29 20:22:10 2016 (r298801) +++ head/sys/arm/ti/ti_adcvar.h Fri Apr 29 20:31:49 2016 (r298802) @@ -42,6 +42,19 @@ struct ti_adc_softc { struct resource *sc_mem_res; struct resource *sc_irq_res; void *sc_intrhand; + int sc_tsc_wires; + int sc_tsc_wire_config[TI_ADC_NPINS]; + int sc_coord_readouts; + int sc_x_plate_resistance; + int sc_charge_delay; + int sc_adc_nchannels; + int sc_adc_channels[TI_ADC_NPINS]; + int sc_xp_bit, sc_xp_inp; + int sc_xn_bit, sc_xn_inp; + int sc_yp_bit, sc_yp_inp; + int sc_yn_bit, sc_yn_inp; + uint32_t sc_tsc_enabled; + int sc_pen_down; }; struct ti_adc_input { From owner-svn-src-head@freebsd.org Fri Apr 29 20:33:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF21CB217B0; Fri, 29 Apr 2016 20:33:21 +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 9170E19AA; Fri, 29 Apr 2016 20:33:21 +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 u3TKXKrU013004; Fri, 29 Apr 2016 20:33:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKXKH2013003; Fri, 29 Apr 2016 20:33:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604292033.u3TKXKH2013003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 29 Apr 2016 20:33:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298803 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:33:21 -0000 Author: tuexen Date: Fri Apr 29 20:33:20 2016 New Revision: 298803 URL: https://svnweb.freebsd.org/changeset/base/298803 Log: Don't assign, just compare... Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Apr 29 20:31:49 2016 (r298802) +++ head/sys/netinet/sctputil.c Fri Apr 29 20:33:20 2016 (r298803) @@ -6972,8 +6972,8 @@ sctp_recv_icmp_tunneled_packet(int cmd, } type = icmp->icmp_type; code = icmp->icmp_code; - if ((type = ICMP_UNREACH) && - (code = ICMP_UNREACH_PORT)) { + if ((type == ICMP_UNREACH) && + (code == ICMP_UNREACH_PORT)) { code = ICMP_UNREACH_PROTOCOL; } sctp_notify(inp, stcb, net, type, code, From owner-svn-src-head@freebsd.org Fri Apr 29 20:43:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F075B219E0; Fri, 29 Apr 2016 20:43:53 +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 004EA1EB9; Fri, 29 Apr 2016 20:43:52 +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 u3TKhq6O016013; Fri, 29 Apr 2016 20:43:52 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKhpRe016007; Fri, 29 Apr 2016 20:43:51 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292043.u3TKhpRe016007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 20:43:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298804 - in head/sys/ufs: ffs ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:43:53 -0000 Author: pfg Date: Fri Apr 29 20:43:51 2016 New Revision: 298804 URL: https://svnweb.freebsd.org/changeset/base/298804 Log: UFS: spelling fixes on comments. No functional change. Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_vfsops.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/dirhash.h head/sys/ufs/ufs/ufs_acl.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Fri Apr 29 20:33:20 2016 (r298803) +++ head/sys/ufs/ffs/ffs_alloc.c Fri Apr 29 20:43:51 2016 (r298804) @@ -1231,7 +1231,7 @@ ffs_dirpref(pip) * backwards or even to alternate looking forward and backward, * this approach fails badly when the filesystem is nearly full. * Specifically, we first search all the areas that have no space - * and finally try the one preceeding that. We repeat this on + * and finally try the one preceding that. We repeat this on * every request and in the case of the final block end up * searching the entire filesystem. By jumping to the front * of the filesystem, our future forward searches always look @@ -1351,7 +1351,7 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) /* * If we are at the beginning of a file, or we have already allocated * the maximum number of blocks per cylinder group, or we do not - * have a block allocated immediately preceeding us, then we need + * have a block allocated immediately preceding us, then we need * to decide where to start allocating new blocks. */ if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) { @@ -1456,7 +1456,7 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) /* * If we are at the beginning of a file, or we have already allocated * the maximum number of blocks per cylinder group, or we do not - * have a block allocated immediately preceeding us, then we need + * have a block allocated immediately preceding us, then we need * to decide where to start allocating new blocks. */ if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) { Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Apr 29 20:33:20 2016 (r298803) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Apr 29 20:43:51 2016 (r298804) @@ -13187,7 +13187,7 @@ softdep_request_cleanup(fs, vp, cred, re * * Additionally, if we are unpriviledged and allocating space, * we need to ensure that we clean up enough blocks to get the - * needed number of blocks over the threshhold of the minimum + * needed number of blocks over the threshold of the minimum * number of blocks required to be kept free by the filesystem * (fs_minfree). */ @@ -13888,7 +13888,7 @@ getdirtybuf(bp, lock, waitfor) error = BUF_LOCK(bp, LK_EXCLUSIVE | LK_SLEEPFAIL | LK_INTERLOCK, lock); /* - * Even if we sucessfully acquire bp here, we have dropped + * Even if we successfully acquire bp here, we have dropped * lock, which may violates our guarantee. */ if (error == 0) Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Apr 29 20:33:20 2016 (r298803) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Apr 29 20:43:51 2016 (r298804) @@ -814,7 +814,7 @@ ffs_mountfs(devvp, mp, td) goto out; } fs->fs_fmod = 0; - fs->fs_flags &= ~FS_INDEXDIRS; /* no support for directory indicies */ + fs->fs_flags &= ~FS_INDEXDIRS; /* no support for directory indices */ fs->fs_flags &= ~FS_UNCLEAN; if (fs->fs_clean == 0) { fs->fs_flags |= FS_UNCLEAN; Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Fri Apr 29 20:33:20 2016 (r298803) +++ head/sys/ufs/ffs/fs.h Fri Apr 29 20:43:51 2016 (r298804) @@ -401,8 +401,8 @@ CTASSERT(sizeof(struct fs) == 1376); * flag to enforce that inconsistent filesystems be mounted read-only. * The FS_INDEXDIRS flag when set indicates that the kernel maintains * on-disk auxiliary indexes (such as B-trees) for speeding directory - * accesses. Kernels that do not support auxiliary indicies clear the - * flag to indicate that the indicies need to be rebuilt (by fsck) before + * accesses. Kernels that do not support auxiliary indices clear the + * flag to indicate that the indices need to be rebuilt (by fsck) before * they can be used. * * FS_ACLS indicates that POSIX.1e ACLs are administratively enabled Modified: head/sys/ufs/ufs/dirhash.h ============================================================================== --- head/sys/ufs/ufs/dirhash.h Fri Apr 29 20:33:20 2016 (r298803) +++ head/sys/ufs/ufs/dirhash.h Fri Apr 29 20:43:51 2016 (r298804) @@ -60,7 +60,7 @@ * together on a TAILQ list, and hashes with higher scores filter * towards the tail (most recently used) end of the list. * - * New hash entries are given an inital score of DH_SCOREINIT and are + * New hash entries are given an initial score of DH_SCOREINIT and are * placed at the most-recently-used end of the list. This helps a lot * in the worst-case case scenario where every directory access is * to a directory that is not hashed (i.e. the working set of hash Modified: head/sys/ufs/ufs/ufs_acl.c ============================================================================== --- head/sys/ufs/ufs/ufs_acl.c Fri Apr 29 20:33:20 2016 (r298803) +++ head/sys/ufs/ufs/ufs_acl.c Fri Apr 29 20:43:51 2016 (r298804) @@ -220,7 +220,7 @@ ufs_getacl_nfs4(struct vop_getacl_args * /* * Read POSIX.1e ACL from an EA. Return error if its not found - * or if any other error has occured. + * or if any other error has occurred. */ static int ufs_get_oldacl(acl_type_t type, struct oldacl *old, struct vnode *vp, From owner-svn-src-head@freebsd.org Fri Apr 29 20:45:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEA90B21A63; Fri, 29 Apr 2016 20:45:51 +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 7FCAC1041; Fri, 29 Apr 2016 20:45:51 +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 u3TKjofX016134; Fri, 29 Apr 2016 20:45:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKjoqC016133; Fri, 29 Apr 2016 20:45:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292045.u3TKjoqC016133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 20:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298805 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:45:51 -0000 Author: pfg Date: Fri Apr 29 20:45:50 2016 New Revision: 298805 URL: https://svnweb.freebsd.org/changeset/base/298805 Log: fs/ext2fs: spelling fixes on comment. No functional change. Modified: head/sys/fs/ext2fs/ext2_inode.c Modified: head/sys/fs/ext2fs/ext2_inode.c ============================================================================== --- head/sys/fs/ext2fs/ext2_inode.c Fri Apr 29 20:43:51 2016 (r298804) +++ head/sys/fs/ext2fs/ext2_inode.c Fri Apr 29 20:45:50 2016 (r298805) @@ -183,7 +183,7 @@ ext2_truncate(struct vnode *vp, off_t le } /* * Shorten the size of the file. If the file is not being - * truncated to a block boundry, the contents of the + * truncated to a block boundary, the contents of the * partial block following the end of the file must be * zero'ed in case it ever become accessible again because * of subsequent file growth. From owner-svn-src-head@freebsd.org Fri Apr 29 20:51:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1073B21AE8; Fri, 29 Apr 2016 20:51:26 +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 7CC0212BB; Fri, 29 Apr 2016 20:51:26 +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 u3TKpPlh018328; Fri, 29 Apr 2016 20:51:25 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKpOQX018309; Fri, 29 Apr 2016 20:51:24 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292051.u3TKpOQX018309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 20:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298806 - in head/sys/fs: fuse msdosfs nandfs nullfs smbfs tmpfs udf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:51:26 -0000 Author: pfg Date: Fri Apr 29 20:51:24 2016 New Revision: 298806 URL: https://svnweb.freebsd.org/changeset/base/298806 Log: sys/fs: spelling fixes in comments. No functional change. Modified: head/sys/fs/fuse/fuse_io.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/msdosfs/msdosfs_conv.c head/sys/fs/msdosfs/msdosfs_fat.c head/sys/fs/msdosfs/msdosfs_lookup.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/nandfs/nandfs_fs.h head/sys/fs/nandfs/nandfs_subr.h head/sys/fs/nandfs/nandfs_sufile.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/nullfs/null_vnops.c head/sys/fs/smbfs/smbfs_io.c head/sys/fs/smbfs/smbfs_subr.h head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/udf/osta.h Modified: head/sys/fs/fuse/fuse_io.c ============================================================================== --- head/sys/fs/fuse/fuse_io.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/fuse/fuse_io.c Fri Apr 29 20:51:24 2016 (r298806) @@ -209,7 +209,7 @@ fuse_read_biobackend(struct vnode *vp, s * buffer based on an EOF condition we need to hold * nfs_rslock() through obtaining the buffer to prevent * a potential writer-appender from messing with n_size. - * Otherwise we may accidently truncate the buffer and + * Otherwise we may accidentally truncate the buffer and * lose dirty data. * * Note that bcount is *not* DEV_BSIZE aligned. @@ -546,7 +546,7 @@ again: (on > bp->b_dirtyend || (on + n) < bp->b_dirtyoff)) { /* * Yes, we mean it. Write out everything to "storage" - * immediatly, without hesitation. (Apart from other + * immediately, without hesitation. (Apart from other * reasons: the only way to know if a write is valid * if its actually written out.) */ Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/fuse/fuse_vnops.c Fri Apr 29 20:51:24 2016 (r298806) @@ -1027,7 +1027,7 @@ out: * soon as we get those attrs... There is * one bit of info though not given us by * the daemon: whether his response is - * authorative or not... His response should + * authoritative or not... His response should * be ignored if something is mounted over * the dir in question. But that can be * known only by having the vnode... @@ -1774,7 +1774,7 @@ fuse_vnop_getpages(struct vop_getpages_a /* * We use only the kva address for the buffer, but this is extremely - * convienient and fast. + * convenient and fast. */ bp = getpbuf(&fuse_pbuf_freecnt); @@ -1835,7 +1835,7 @@ fuse_vnop_getpages(struct vop_getpages_a ("fuse_getpages: page %p is dirty", m)); } else { /* - * Read operation was short. If no error occured + * Read operation was short. If no error occurred * we may have hit a zero-fill section. We simply * leave valid set to 0. */ @@ -1908,7 +1908,7 @@ fuse_vnop_putpages(struct vop_putpages_a } /* * We use only the kva address for the buffer, but this is extremely - * convienient and fast. + * convenient and fast. */ bp = getpbuf(&fuse_pbuf_freecnt); Modified: head/sys/fs/msdosfs/msdosfs_conv.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_conv.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/msdosfs/msdosfs_conv.c Fri Apr 29 20:51:24 2016 (r298806) @@ -759,7 +759,7 @@ winSlotCnt(const u_char *un, size_t unle } /* - * Determine the number of bytes neccessary for Win95 names + * Determine the number of bytes necessary for Win95 names */ size_t winLenFixup(const u_char *un, size_t unlen) Modified: head/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_fat.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/msdosfs/msdosfs_fat.c Fri Apr 29 20:51:24 2016 (r298806) @@ -175,7 +175,7 @@ pcbmap(struct denode *dep, u_long findcn /* * Rummage around in the fat cache, maybe we can avoid tromping - * thru every fat entry for the file. And, keep track of how far + * through every fat entry for the file. And, keep track of how far * off the cache was from where we wanted to be. */ i = 0; Modified: head/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_lookup.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/msdosfs/msdosfs_lookup.c Fri Apr 29 20:51:24 2016 (r298806) @@ -924,7 +924,7 @@ readde(struct denode *dep, struct buf ** /* * Remove a directory entry. At this point the file represented by the - * directory entry to be removed is still full length until noone has it + * directory entry to be removed is still full length until no one has it * open. When the file no longer being used msdosfs_inactive() is called * and will truncate the file to 0 length. When the vnode containing the * denode is needed for some other purpose by VFS it will call @@ -975,7 +975,7 @@ removede(struct denode *pdep, struct den offset += sizeof(struct direntry); while (1) { /* - * We are a bit agressive here in that we delete any Win95 + * We are a bit aggressive here in that we delete any Win95 * entries preceding this entry, not just the ones we "own". * Since these presumably aren't valid anyway, * there should be no harm. Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Fri Apr 29 20:51:24 2016 (r298806) @@ -116,7 +116,7 @@ static vop_vptofh_t msdosfs_vptofh; * that when a directory is actually read/written (via read, write, or * readdir, or seek) we must use the vnode for the filesystem instead of * the vnode for the directory as would happen in ufs. This is to insure we - * retreive the correct block from the buffer cache since the hash value is + * retrieve the correct block from the buffer cache since the hash value is * based upon the vnode address and the desired block number. */ Modified: head/sys/fs/nandfs/nandfs_fs.h ============================================================================== --- head/sys/fs/nandfs/nandfs_fs.h Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/nandfs/nandfs_fs.h Fri Apr 29 20:51:24 2016 (r298806) @@ -343,7 +343,7 @@ struct nandfs_segment_summary { /* * Structure of DAT/inode file. * - * A DAT file is devided into groups. The maximum number of groups is the + * A DAT file is divided into groups. The maximum number of groups is the * number of block group descriptors that fit into one block; this descriptor * only gives the number of free entries in the associated group. * Modified: head/sys/fs/nandfs/nandfs_subr.h ============================================================================== --- head/sys/fs/nandfs/nandfs_subr.h Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/nandfs/nandfs_subr.h Fri Apr 29 20:51:24 2016 (r298806) @@ -114,7 +114,7 @@ int nandfs_free_entry(struct nandfs_mdt int nandfs_get_entry_block(struct nandfs_mdt *, struct nandfs_node *, struct nandfs_alloc_request *, uint32_t *, int); -/* inode managment */ +/* Inode management. */ int nandfs_node_create(struct nandfsmount *, struct nandfs_node **, uint16_t); int nandfs_node_destroy(struct nandfs_node *); int nandfs_node_update(struct nandfs_node *); Modified: head/sys/fs/nandfs/nandfs_sufile.c ============================================================================== --- head/sys/fs/nandfs/nandfs_sufile.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/nandfs/nandfs_sufile.c Fri Apr 29 20:51:24 2016 (r298806) @@ -137,7 +137,7 @@ nandfs_alloc_segment(struct nandfs_devic rest = (fsdev->nd_blocksize - offset) / seg_size; /* Go through all su usage in block */ while (rest) { - /* When last check start from beggining */ + /* When last check start from beginning */ if (i == nsegments) break; Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/nandfs/nandfs_vnops.c Fri Apr 29 20:51:24 2016 (r298806) @@ -1251,12 +1251,12 @@ nandfs_readdir(struct vop_readdir_args * diroffset += ndirent->rec_len; blkoff += ndirent->rec_len; - /* Remember the last entry we transfered */ + /* Remember the last entry we transferred */ transoffset = diroffset; } brelse(bp); - /* Pass on last transfered offset */ + /* Pass on last transferred offset */ uio->uio_offset = transoffset; } Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/nullfs/null_vnops.c Fri Apr 29 20:51:24 2016 (r298806) @@ -117,7 +117,7 @@ * are created as a result of vnode operations on * this or other null vnode stacks. * - * New vnode stacks come into existance as a result of + * New vnode stacks come into existence as a result of * an operation which returns a vnode. * The bypass routine stacks a null-node above the new * vnode before returning it to the caller. Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/smbfs/smbfs_io.c Fri Apr 29 20:51:24 2016 (r298806) @@ -520,7 +520,7 @@ smbfs_getpages(ap) ("smbfs_getpages: page %p is dirty", m)); } else { /* - * Read operation was short. If no error occured + * Read operation was short. If no error occurred * we may have hit a zero-fill section. We simply * leave valid set to 0. */ Modified: head/sys/fs/smbfs/smbfs_subr.h ============================================================================== --- head/sys/fs/smbfs/smbfs_subr.h Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/smbfs/smbfs_subr.h Fri Apr 29 20:51:24 2016 (r298806) @@ -107,7 +107,7 @@ struct smbfs_fctx { struct smb_t2rq * uf_t2; } f_urq; int f_left; /* entries left */ - int f_ecnt; /* entries left in the current reponse */ + int f_ecnt; /* entries left in the current response */ int f_eofs; /* entry offset in the parameter block */ u_char f_skey[SMB_SKEYLEN]; /* server side search context */ u_char f_fname[8 + 1 + 3 + 1]; /* common case for 8.3 filenames */ Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Fri Apr 29 20:51:24 2016 (r298806) @@ -840,7 +840,7 @@ tmpfs_rename(struct vop_rename_args *v) /* If re-naming a directory to another preexisting directory * ensure that the target directory is empty so that its * removal causes no side effects. - * Kern_rename gurantees the destination to be a directory + * Kern_rename guarantees the destination to be a directory * if the source is one. */ if (tvp != NULL) { MPASS(tnode != NULL); Modified: head/sys/fs/udf/osta.h ============================================================================== --- head/sys/fs/udf/osta.h Fri Apr 29 20:45:50 2016 (r298805) +++ head/sys/fs/udf/osta.h Fri Apr 29 20:51:24 2016 (r298806) @@ -28,7 +28,7 @@ #endif /*********************************************************************** - * The following two typedef's are to remove compiler dependancies. + * The following two typedef's are to remove compiler dependencies. * byte needs to be unsigned 8-bit, and unicode_t needs to be * unsigned 16-bit. */ From owner-svn-src-head@freebsd.org Fri Apr 29 20:53:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 670C4B21BF9; Fri, 29 Apr 2016 20:53:40 +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 37E84170D; Fri, 29 Apr 2016 20:53:40 +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 u3TKrdJR019064; Fri, 29 Apr 2016 20:53:39 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKrdIG019063; Fri, 29 Apr 2016 20:53:39 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292053.u3TKrdIG019063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 20:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298807 - head/sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:53:40 -0000 Author: pfg Date: Fri Apr 29 20:53:39 2016 New Revision: 298807 URL: https://svnweb.freebsd.org/changeset/base/298807 Log: sys/ddb: spelling fixes in comments. No functional change. Modified: head/sys/ddb/db_textdump.c Modified: head/sys/ddb/db_textdump.c ============================================================================== --- head/sys/ddb/db_textdump.c Fri Apr 29 20:51:24 2016 (r298806) +++ head/sys/ddb/db_textdump.c Fri Apr 29 20:53:39 2016 (r298807) @@ -52,7 +52,7 @@ * TODO * ---- * - * - Allow subsytems to register to submit files for inclusion in the text + * - Allow subsystems to register to submit files for inclusion in the text * dump in a generic way. */ From owner-svn-src-head@freebsd.org Fri Apr 29 20:57:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDF85B21C67; Fri, 29 Apr 2016 20:57:01 +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 9162118D2; Fri, 29 Apr 2016 20:57:01 +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 u3TKv0YB019245; Fri, 29 Apr 2016 20:57:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TKux9L019223; Fri, 29 Apr 2016 20:56:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292056.u3TKux9L019223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 20:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298808 - in head/sys/geom: . bde journal mirror part raid raid3 vinum X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 20:57:01 -0000 Author: pfg Date: Fri Apr 29 20:56:58 2016 New Revision: 298808 URL: https://svnweb.freebsd.org/changeset/base/298808 Log: sys/geom: spelling fixes in comments. No functional change. Modified: head/sys/geom/bde/g_bde_lock.c head/sys/geom/geom_bsd_enc.c head/sys/geom/geom_ccd.c head/sys/geom/geom_dev.c head/sys/geom/geom_disk.c head/sys/geom/geom_kern.c head/sys/geom/geom_mbr_enc.c head/sys/geom/geom_sunlabel_enc.c head/sys/geom/journal/g_journal.c head/sys/geom/mirror/g_mirror.c head/sys/geom/part/g_part_bsd64.c head/sys/geom/part/g_part_if.m head/sys/geom/part/g_part_ldm.c head/sys/geom/raid/tr_raid1.c head/sys/geom/raid/tr_raid1e.c head/sys/geom/raid3/g_raid3.c head/sys/geom/vinum/geom_vinum_drive.c head/sys/geom/vinum/geom_vinum_subr.c Modified: head/sys/geom/bde/g_bde_lock.c ============================================================================== --- head/sys/geom/bde/g_bde_lock.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/bde/g_bde_lock.c Fri Apr 29 20:56:58 2016 (r298808) @@ -289,7 +289,7 @@ g_bde_decode_lock(struct g_bde_softc *sc * Security objectives: Encode/Decode the metadata encrypted by key-material. * * A simple AES/128/CBC will do. We take care to always store the metadata - * in the same endianess to make it MI. + * in the same endianness to make it MI. * * In the typical case the metadata is stored in encrypted format in sector * zero on the media, but at the users discretion or if the piece of the Modified: head/sys/geom/geom_bsd_enc.c ============================================================================== --- head/sys/geom/geom_bsd_enc.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/geom_bsd_enc.c Fri Apr 29 20:56:58 2016 (r298808) @@ -35,7 +35,7 @@ /* * Functions to encode and decode struct disklabel and struct partition into - * a bytestream of little endianess and correct packing. + * a bytestream of little endianness and correct packing. * * NB! This file must be usable both in kernel and userland. */ Modified: head/sys/geom/geom_ccd.c ============================================================================== --- head/sys/geom/geom_ccd.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/geom_ccd.c Fri Apr 29 20:56:58 2016 (r298808) @@ -271,7 +271,7 @@ ccdinit(struct gctl_req *req, struct ccd /* * If uniform interleave is desired set all sizes to that of - * the smallest component. This will guarentee that a single + * the smallest component. This will guarantee that a single * interleave table is generated. * * Lost space must be taken into account when calculating the @@ -291,7 +291,7 @@ ccdinit(struct gctl_req *req, struct ccd * Check to see if an even number of components * have been specified. The interleave must also * be non-zero in order for us to be able to - * guarentee the topology. + * guarantee the topology. */ if (cs->sc_ndisks % 2) { gctl_error(req, Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/geom_dev.c Fri Apr 29 20:56:58 2016 (r298808) @@ -630,8 +630,8 @@ g_dev_strategy(struct bio *bp) for (;;) { /* - * XXX: This is not an ideal solution, but I belive it to - * XXX: deadlock safe, all things considered. + * XXX: This is not an ideal solution, but I believe it to + * XXX: deadlock safely, all things considered. */ bp2 = g_clone_bio(bp); if (bp2 != NULL) @@ -686,7 +686,7 @@ g_dev_callback(void *arg) * - Clear any dump settings. * - Request asynchronous device destruction to prevent any more requests * from coming in. The provider is already marked with an error, so - * anything which comes in in the interrim will be returned immediately. + * anything which comes in the interim will be returned immediately. */ static void Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/geom_disk.c Fri Apr 29 20:56:58 2016 (r298808) @@ -107,7 +107,7 @@ g_disk_access(struct g_provider *pp, int if (sc == NULL || (dp = sc->dp) == NULL || dp->d_destroyed) { /* * Allow decreasing access count even if disk is not - * avaliable anymore. + * available anymore. */ if (r <= 0 && w <= 0 && e <= 0) return (0); Modified: head/sys/geom/geom_kern.c ============================================================================== --- head/sys/geom/geom_kern.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/geom_kern.c Fri Apr 29 20:56:58 2016 (r298808) @@ -76,7 +76,7 @@ int g_notaste; * part of I/O prioritization by deciding which bios/bioqs to service * in what order. * - * We have only one thread in each direction, it is belived that until + * We have only one thread in each direction, it is believed that until * a very non-trivial workload in the UP/DOWN path this will be enough, * but more than one can actually be run without problems. * Modified: head/sys/geom/geom_mbr_enc.c ============================================================================== --- head/sys/geom/geom_mbr_enc.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/geom_mbr_enc.c Fri Apr 29 20:56:58 2016 (r298808) @@ -25,7 +25,7 @@ */ /* Functions to encode or decode struct dos_partition into a bytestream - * of correct endianess and packing. These functions do no validation + * of correct endianness and packing. These functions do no validation * or sanity checking, they only pack/unpack the fields correctly. * * NB! This file must be usable both in kernel and userland. Modified: head/sys/geom/geom_sunlabel_enc.c ============================================================================== --- head/sys/geom/geom_sunlabel_enc.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/geom_sunlabel_enc.c Fri Apr 29 20:56:58 2016 (r298808) @@ -26,7 +26,7 @@ * SUCH DAMAGE. */ /* Functions to encode or decode struct sun_disklabel into a bytestream - * of correct endianess and packing. + * of correct endianness and packing. * * NB! This file must be usable both in kernel and userland. */ Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/journal/g_journal.c Fri Apr 29 20:56:58 2016 (r298808) @@ -520,7 +520,7 @@ g_journal_write_header(struct g_journal_ /* * Every journal record has a header and data following it. * Functions below are used to decode the header before storing it to - * little endian and to encode it after reading to system endianess. + * little endian and to encode it after reading to system endianness. */ static void g_journal_record_header_encode(struct g_journal_record_header *hdr, @@ -581,7 +581,7 @@ g_journal_record_header_decode(const u_c /* * Function reads metadata from a provider (via the given consumer), decodes - * it to system endianess and verifies its correctness. + * it to system endianness and verifies its correctness. */ static int g_journal_metadata_read(struct g_consumer *cp, struct g_journal_metadata *md) @@ -1846,7 +1846,7 @@ g_journal_sync(struct g_journal_softc *s for (;;) { /* * If the biggest record won't fit, look for a record header or - * journal header from the begining. + * journal header from the beginning. */ GJ_VALIDATE_OFFSET(offset, sc); error = g_journal_sync_read(cp, bp, offset, buf); Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/mirror/g_mirror.c Fri Apr 29 20:56:58 2016 (r298808) @@ -1048,7 +1048,7 @@ g_mirror_kernel_dump(struct bio *bp) /* * We configure dumping to the first component, because this component * will be used for reading with 'prefer' balance algorithm. - * If the component with the higest priority is currently disconnected + * If the component with the highest priority is currently disconnected * we will not be able to read the dump after the reboot if it will be * connected and synchronized later. Can we do something better? */ @@ -1277,7 +1277,7 @@ g_mirror_sync_release(struct g_mirror_so * Handle synchronization requests. * Every synchronization request is two-steps process: first, READ request is * send to active provider and then WRITE request (with read data) to the provider - * beeing synchronized. When WRITE is finished, new synchronization request is + * being synchronized. When WRITE is finished, new synchronization request is * send. */ static void Modified: head/sys/geom/part/g_part_bsd64.c ============================================================================== --- head/sys/geom/part/g_part_bsd64.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/part/g_part_bsd64.c Fri Apr 29 20:56:58 2016 (r298808) @@ -58,7 +58,7 @@ FEATURE(geom_part_bsd64, "GEOM partition struct disklabel64 { char d_reserved0[512]; /* reserved or unused */ u_int32_t d_magic; /* the magic number */ - u_int32_t d_crc; /* crc32() d_magic thru last part */ + u_int32_t d_crc; /* crc32() d_magic through last part */ u_int32_t d_align; /* partition alignment requirement */ u_int32_t d_npartitions; /* number of partitions */ struct uuid d_stor_uuid; /* unique uuid for label */ Modified: head/sys/geom/part/g_part_if.m ============================================================================== --- head/sys/geom/part/g_part_if.m Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/part/g_part_if.m Fri Apr 29 20:56:58 2016 (r298808) @@ -201,7 +201,7 @@ METHOD int setunset { }; # type() - return a string representation of the partition type. -# Preferrably, the alias names. +# Preferably, the alias names. METHOD const char * type { struct g_part_table *table; struct g_part_entry *entry; Modified: head/sys/geom/part/g_part_ldm.c ============================================================================== --- head/sys/geom/part/g_part_ldm.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/part/g_part_ldm.c Fri Apr 29 20:56:58 2016 (r298808) @@ -1220,7 +1220,7 @@ ldm_gpt_probe(struct g_part_table *baset int error; /* - * XXX: We use some knowlege about GEOM_PART_GPT internal + * XXX: We use some knowledge about GEOM_PART_GPT internal * structures, but it is easier than parse GPT by himself. */ g_topology_lock(); Modified: head/sys/geom/raid/tr_raid1.c ============================================================================== --- head/sys/geom/raid/tr_raid1.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/raid/tr_raid1.c Fri Apr 29 20:56:58 2016 (r298808) @@ -840,8 +840,8 @@ rebuild_round_done: * disk, remapping the bad sector. Do we need to do that by * queueing a request to the main worker thread? It doesn't * affect the return code of this current read, and can be - * done at our liesure. However, to make the code simpler, it - * is done syncrhonously. + * done at our leisure. However, to make the code simpler, it + * is done synchronously. */ G_RAID_LOGREQ(3, bp, "Recovered data from other drive"); cbp = g_clone_bio(pbp); @@ -858,7 +858,7 @@ rebuild_round_done: if (pbp->bio_pflags & G_RAID_BIO_FLAG_LOCKED) { /* * We're done with a recovery, mark the range as unlocked. - * For any write errors, we agressively fail the disk since + * For any write errors, we aggressively fail the disk since * there was both a READ and a WRITE error at this location. * Both types of errors generally indicates the drive is on * the verge of total failure anyway. Better to stop trusting Modified: head/sys/geom/raid/tr_raid1e.c ============================================================================== --- head/sys/geom/raid/tr_raid1e.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/raid/tr_raid1e.c Fri Apr 29 20:56:58 2016 (r298808) @@ -1096,7 +1096,7 @@ rebuild_round_done: if ((mask & (1U << 31)) != 0) { /* * We're done with a recovery, mark the range as unlocked. - * For any write errors, we agressively fail the disk since + * For any write errors, we aggressively fail the disk since * there was both a READ and a WRITE error at this location. * Both types of errors generally indicates the drive is on * the verge of total failure anyway. Better to stop trusting Modified: head/sys/geom/raid3/g_raid3.c ============================================================================== --- head/sys/geom/raid3/g_raid3.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/raid3/g_raid3.c Fri Apr 29 20:56:58 2016 (r298808) @@ -1587,7 +1587,7 @@ g_raid3_sync_release(struct g_raid3_soft * Handle synchronization requests. * Every synchronization request is two-steps process: first, READ request is * send to active provider and then WRITE request (with read data) to the provider - * beeing synchronized. When WRITE is finished, new synchronization request is + * being synchronized. When WRITE is finished, new synchronization request is * send. */ static void Modified: head/sys/geom/vinum/geom_vinum_drive.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_drive.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/vinum/geom_vinum_drive.c Fri Apr 29 20:56:58 2016 (r298808) @@ -76,7 +76,7 @@ gv_legacy_header_type(uint8_t *hdr, int uint32_t *i32; int arch_32, arch_64, i; - /* Set arch according to endianess. */ + /* Set arch according to endianness. */ if (bigendian) { arch_32 = GV_LEGACY_POWERPC; arch_64 = GV_LEGACY_SPARC64; Modified: head/sys/geom/vinum/geom_vinum_subr.c ============================================================================== --- head/sys/geom/vinum/geom_vinum_subr.c Fri Apr 29 20:53:39 2016 (r298807) +++ head/sys/geom/vinum/geom_vinum_subr.c Fri Apr 29 20:56:58 2016 (r298808) @@ -72,7 +72,7 @@ gv_parse_config(struct gv_softc *sc, cha bptr = aptr; cptr = aptr; - /* Seperate input lines. */ + /* Separate input lines. */ while (*bptr != '\n') bptr++; *bptr = '\0'; From owner-svn-src-head@freebsd.org Fri Apr 29 21:04:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E6EBB21ECD; Fri, 29 Apr 2016 21:04:08 +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 D41931EA3; Fri, 29 Apr 2016 21:04:07 +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 u3TL476v022124; Fri, 29 Apr 2016 21:04:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TL47EA022123; Fri, 29 Apr 2016 21:04:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292104.u3TL47EA022123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 21:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298809 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 21:04:08 -0000 Author: pfg Date: Fri Apr 29 21:04:06 2016 New Revision: 298809 URL: https://svnweb.freebsd.org/changeset/base/298809 Log: sys/cam: spelling fixes. Affects a debug message. MFC after: 2 weeks Modified: head/sys/cam/cam_queue.c Modified: head/sys/cam/cam_queue.c ============================================================================== --- head/sys/cam/cam_queue.c Fri Apr 29 20:56:58 2016 (r298808) +++ head/sys/cam/cam_queue.c Fri Apr 29 21:04:06 2016 (r298809) @@ -122,7 +122,7 @@ camq_resize(struct camq *queue, int new_ cam_pinfo **new_array; KASSERT(new_size >= queue->entries, ("camq_resize: " - "New queue size can't accomodate queued entries (%d < %d).", + "New queue size can't accommodate queued entries (%d < %d).", new_size, queue->entries)); new_array = (cam_pinfo **)malloc(new_size * sizeof(cam_pinfo *), M_CAMQ, M_NOWAIT); From owner-svn-src-head@freebsd.org Fri Apr 29 21:05:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1127B21F75; Fri, 29 Apr 2016 21:05:50 +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 C231B1053; Fri, 29 Apr 2016 21:05:50 +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 u3TL5nGB022237; Fri, 29 Apr 2016 21:05:49 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TL5m9b022221; Fri, 29 Apr 2016 21:05:48 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292105.u3TL5m9b022221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 21:05:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298810 - in head/sys/cam: . ctl scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 21:05:51 -0000 Author: pfg Date: Fri Apr 29 21:05:48 2016 New Revision: 298810 URL: https://svnweb.freebsd.org/changeset/base/298810 Log: sys/cam: spelling fixes in comments. No functional change. Modified: head/sys/cam/cam.h head/sys/cam/cam_periph.c head/sys/cam/cam_xpt.c head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_frontend_cam_sim.c head/sys/cam/ctl/ctl_frontend_ioctl.c head/sys/cam/ctl/ctl_io.h head/sys/cam/ctl/ctl_ioctl.h head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_ch.h head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_low.h head/sys/cam/scsi/scsi_sa.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/cam.h ============================================================================== --- head/sys/cam/cam.h Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/cam.h Fri Apr 29 21:05:48 2016 (r298810) @@ -77,7 +77,7 @@ typedef enum { CAM_RL_VALUES } cam_rl; /* - * The generation number is incremented everytime a new entry is entered into + * The generation number is incremented every time a new entry is entered into * the queue giving round robin per priority level scheduling. */ typedef struct { @@ -118,7 +118,7 @@ typedef enum { enum { SF_RETRY_UA = 0x01, /* Retry UNIT ATTENTION conditions. */ SF_NO_PRINT = 0x02, /* Never print error status. */ - SF_QUIET_IR = 0x04, /* Be quiet about Illegal Request reponses */ + SF_QUIET_IR = 0x04, /* Be quiet about Illegal Request responses */ SF_PRINT_ALWAYS = 0x08, /* Always print error status. */ SF_NO_RECOVERY = 0x10, /* Don't do active error recovery. */ SF_NO_RETRY = 0x20, /* Don't do any retries. */ Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/cam_periph.c Fri Apr 29 21:05:48 2016 (r298810) @@ -1604,7 +1604,7 @@ sense_error_done: /* * Generic error handler. Peripheral drivers usually filter - * out the errors that they handle in a unique mannor, then + * out the errors that they handle in a unique manner, then * call this function. */ int Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/cam_xpt.c Fri Apr 29 21:05:48 2016 (r298810) @@ -863,7 +863,7 @@ xpt_init(void *dummy) xsoftc.boot_delay = CAM_BOOT_DELAY; #endif /* - * The xpt layer is, itself, the equivelent of a SIM. + * The xpt layer is, itself, the equivalent of a SIM. * Allow 16 ccbs in the ccb pool for it. This should * give decent parallelism when we probe busses and * perform other XPT functions. @@ -892,7 +892,7 @@ xpt_init(void *dummy) /* * Looking at the XPT from the SIM layer, the XPT is - * the equivelent of a peripheral driver. Allocate + * the equivalent of a peripheral driver. Allocate * a peripheral driver entry for us. */ if ((status = xpt_create_path(&path, NULL, CAM_XPT_PATH_ID, Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/ctl/ctl.c Fri Apr 29 21:05:48 2016 (r298810) @@ -5980,7 +5980,7 @@ ctl_debugconf_sp_sense_handler(struct ct case SMS_PAGE_CTRL_DEFAULT >> 6: case SMS_PAGE_CTRL_SAVED >> 6: /* - * We don't update the changable or default bits for this page. + * We don't update the changeable or default bits for this page. */ break; case SMS_PAGE_CTRL_CURRENT >> 6: @@ -10223,7 +10223,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * * Therefore we set the HiSup bit here. * - * The reponse format is 2, per SPC-3. + * The response format is 2, per SPC-3. */ inq_ptr->response_format = SID_HiSup | 2; Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Apr 29 21:05:48 2016 (r298810) @@ -106,7 +106,7 @@ static void cfcs_async(void *callback_ar struct cfcs_softc cfcs_softc; /* - * This is primarly intended to allow for error injection to test the CAM + * This is primarily intended to allow for error injection to test the CAM * sense data and sense residual handling code. This sets the maximum * amount of SCSI sense data that we will report to CAM. */ Modified: head/sys/cam/ctl/ctl_frontend_ioctl.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_ioctl.c Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/ctl/ctl_frontend_ioctl.c Fri Apr 29 21:05:48 2016 (r298810) @@ -339,7 +339,7 @@ cfi_submit_wait(union ctl_io *io) mtx_lock(¶ms.ioctl_mtx); /* * Check the state here, and don't sleep if the state has - * already changed (i.e. wakeup has already occured, but we + * already changed (i.e. wakeup has already occurred, but we * weren't waiting yet). */ if (params.state == last_state) { Modified: head/sys/cam/ctl/ctl_io.h ============================================================================== --- head/sys/cam/ctl/ctl_io.h Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/ctl/ctl_io.h Fri Apr 29 21:05:48 2016 (r298810) @@ -80,7 +80,7 @@ typedef enum { /* * WARNING: Keep the data in/out/none flags where they are. They're used - * in conjuction with ctl_cmd_flags. See comment above ctl_cmd_flags + * in conjunction with ctl_cmd_flags. See comment above ctl_cmd_flags * definition in ctl_private.h. */ typedef enum { Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/ctl/ctl_ioctl.h Fri Apr 29 21:05:48 2016 (r298810) @@ -313,7 +313,7 @@ typedef enum { * * namelen: Length of the name field, including the terminating NUL. * - * name: Name of the paramter. This must be NUL-terminated. + * name: Name of the parameter. This must be NUL-terminated. * * flags: Flags for the parameter, see above for values. * @@ -485,7 +485,7 @@ struct ctl_lun_req { * NEED_MORE_SPACE: The allocated length of the entries field is too * small for the available data. * - * ERROR: An error occured, look at the error string for a + * ERROR: An error occurred, look at the error string for a * description of the error. */ typedef enum { @@ -573,7 +573,7 @@ struct ctl_req { * * OK: Request completed successfully. * - * ERROR: An error occured, look at the error string for a + * ERROR: An error occurred, look at the error string for a * description of the error. * * CTL_ISCSI_LIST_NEED_MORE_SPACE: Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/scsi/scsi_all.c Fri Apr 29 21:05:48 2016 (r298810) @@ -3644,7 +3644,7 @@ scsi_desc_iterate(struct scsi_sense_data /* * The length of data actually returned may be different than the - * extra_len recorded in the sturcture. + * extra_len recorded in the structure. */ desc_len = sense_len -offsetof(struct scsi_sense_data_desc, sense_desc); @@ -8704,7 +8704,7 @@ scsi_static_inquiry_match(caddr_t inqbuf * \return 0 on a match, -1 otherwise. * * Treat rhs and lhs as arrays of vpd device id descriptors. Walk lhs matching - * agains each element in rhs until all data are exhausted or we have found + * against each element in rhs until all data are exhausted or we have found * a match. */ int Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/scsi/scsi_all.h Fri Apr 29 21:05:48 2016 (r298810) @@ -3146,7 +3146,7 @@ struct scsi_sense_info /* * Command-specific information depends on the command for which the - * reported condition occured. + * reported condition occurred. * * Note that any changes to the field names or positions in this structure, * even reserved fields, should be accompanied by an examination of the @@ -3381,7 +3381,7 @@ struct scsi_sense_forwarded /* * Vendor-specific sense descriptor. The desc_type field will be in the - * range bewteen MIN and MAX inclusive. + * range between MIN and MAX inclusive. */ struct scsi_sense_vendor { Modified: head/sys/cam/scsi/scsi_ch.h ============================================================================== --- head/sys/cam/scsi/scsi_ch.h Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/scsi/scsi_ch.h Fri Apr 29 21:05:48 2016 (r298810) @@ -333,7 +333,7 @@ struct scsi_send_volume_tag_parameters { /* * Device capabilities page. * - * This page defines characteristics of the elemenet types in the + * This page defines characteristics of the element types in the * medium changer device. * * Note in the definitions below, the following abbreviations are @@ -341,7 +341,7 @@ struct scsi_send_volume_tag_parameters { * MT Medium transport element (picker) * ST Storage transport element (slot) * IE Import/export element (portal) - * DT Data tranfer element (tape/disk drive) + * DT Data transfer element (tape/disk drive) */ struct page_device_capabilities { u_int8_t pg_code; /* page code (0x1f) */ Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/scsi/scsi_da.c Fri Apr 29 21:05:48 2016 (r298810) @@ -2966,7 +2966,7 @@ cmd6workaround(union ccb *ccb) * * While we will attempt to choose an alternative delete method * this may result in short deletes if the existing delete - * requests from geom are big for the new method choosen. + * requests from geom are big for the new method chosen. * * This method assumes that the error which triggered this * will not retry the io otherwise a panic will occur @@ -3421,7 +3421,7 @@ dadone(struct cam_periph *periph, union * Based on older SBC-3 spec revisions * any of the UNMAP methods "may" be * available via LBP given this flag so - * we flag all of them as availble and + * we flag all of them as available and * then remove those which further * probes confirm aren't available * later. Modified: head/sys/cam/scsi/scsi_low.h ============================================================================== --- head/sys/cam/scsi/scsi_low.h Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/scsi/scsi_low.h Fri Apr 29 21:05:48 2016 (r298810) @@ -146,7 +146,7 @@ struct slccb { *****************************************/ struct sc_p ccb_scp; /* given */ struct sc_p ccb_sscp; /* saved scsi data pointer */ - int ccb_datalen; /* transfered data counter */ + int ccb_datalen; /* transferred data counter */ /***************************************** * Msgout @@ -165,7 +165,7 @@ struct slccb { #define CCB_STARTQ 0x0010 #define CCB_POLLED 0x0100 /* polling ccb */ #define CCB_NORETRY 0x0200 /* do NOT retry */ -#define CCB_AUTOSENSE 0x0400 /* do a sence after CA */ +#define CCB_AUTOSENSE 0x0400 /* do a sense after CA */ #define CCB_URGENT 0x0800 /* an urgent ccb */ #define CCB_NOSDONE 0x1000 /* do not call an os done routine */ #define CCB_SCSIIO 0x2000 /* a normal scsi io coming from upper layer */ Modified: head/sys/cam/scsi/scsi_sa.c ============================================================================== --- head/sys/cam/scsi/scsi_sa.c Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/scsi/scsi_sa.c Fri Apr 29 21:05:48 2016 (r298810) @@ -2862,7 +2862,7 @@ samount(struct cam_periph *periph, int o softc = (struct sa_softc *)periph->softc; /* - * This should determine if something has happend since the last + * This should determine if something has happened since the last * open/mount that would invalidate the mount. We do *not* want * to retry this command- we just want the status. But we only * do this if we're mounted already- if we're not mounted, Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Fri Apr 29 21:04:06 2016 (r298809) +++ head/sys/cam/scsi/scsi_xpt.c Fri Apr 29 21:05:48 2016 (r298810) @@ -456,7 +456,7 @@ static struct scsi_quirk_entry scsi_quir }, { /* - * The Hitachi CJ series with J8A8 firmware apparantly has + * The Hitachi CJ series with J8A8 firmware apparently has * problems with tagged commands. * PR: 23536 * Reported by: amagai@nue.org @@ -2431,7 +2431,7 @@ scsi_devise_transport(struct cam_path *p path->device->transport_version = otherdev->transport_version; } else { - /* Until we know better, opt for safty */ + /* Until we know better, opt for safety */ path->device->protocol_version = 2; if (path->device->transport == XPORT_SPI) path->device->transport_version = 2; From owner-svn-src-head@freebsd.org Fri Apr 29 21:11:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AB77B2102F; Fri, 29 Apr 2016 21:11:33 +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 04B7412F3; Fri, 29 Apr 2016 21:11:32 +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 u3TLBWZW025066; Fri, 29 Apr 2016 21:11:32 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TLBWjU025064; Fri, 29 Apr 2016 21:11:32 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604292111.u3TLBWjU025064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 29 Apr 2016 21:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298811 - in head: sys/kern tests/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 21:11:33 -0000 Author: asomers Date: Fri Apr 29 21:11:31 2016 New Revision: 298811 URL: https://svnweb.freebsd.org/changeset/base/298811 Log: Automate the subr_unit test. Build and install the subr_unit test program originally written by phk, and run it with the other ATF tests. tests/sys/kern/Makefile * Build and install the subr_unit test as a plain test sys/kern/subr_unit.c * Reduce the default number of repetitions from 100 to 1, and add a command-line parser to override it. * Don't be so noisy by default * Fix an include problem for the test build Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6038 Modified: head/sys/kern/subr_unit.c head/tests/sys/kern/Makefile Modified: head/sys/kern/subr_unit.c ============================================================================== --- head/sys/kern/subr_unit.c Fri Apr 29 21:05:48 2016 (r298810) +++ head/sys/kern/subr_unit.c Fri Apr 29 21:11:31 2016 (r298811) @@ -68,11 +68,11 @@ */ #include -#include #include #ifdef _KERNEL +#include #include #include #include @@ -98,6 +98,11 @@ MTX_SYSINIT(unit, &unitmtx, "unit# alloc #else /* ...USERLAND */ +#include +#include +#include +#include +#include #include #include #include @@ -880,9 +885,13 @@ free_unr(struct unrhdr *uh, u_int item) #ifndef _KERNEL /* USERLAND test driver */ /* - * Simple stochastic test driver for the above functions + * Simple stochastic test driver for the above functions. The code resides + * here so that it can access static functions and structures. */ +static bool verbose; +#define VPRINTF(...) {if (verbose) printf(__VA_ARGS__);} + static void print_unr(struct unrhdr *uh, struct unr *up) { @@ -933,7 +942,7 @@ test_alloc_unr(struct unrhdr *uh, u_int int j; if (a[i]) { - printf("F %u\n", i); + VPRINTF("F %u\n", i); free_unr(uh, i); a[i] = 0; } else { @@ -941,7 +950,7 @@ test_alloc_unr(struct unrhdr *uh, u_int j = alloc_unr(uh); if (j != -1) { a[j] = 1; - printf("A %d\n", j); + VPRINTF("A %d\n", j); } no_alloc = 0; } @@ -954,40 +963,73 @@ test_alloc_unr_specific(struct unrhdr *u j = alloc_unr_specific(uh, i); if (j == -1) { - printf("F %u\n", i); + VPRINTF("F %u\n", i); a[i] = 0; free_unr(uh, i); } else { a[i] = 1; - printf("A %d\n", j); + VPRINTF("A %d\n", j); } } -/* Number of unrs to test */ -#define NN 10000 +static void +usage(char** argv) +{ + printf("%s [-h] [-r REPETITIONS] [-v]\n", argv[0]); +} int -main(int argc __unused, const char **argv __unused) +main(int argc, char **argv) { struct unrhdr *uh; + char *a; + long count = 10000; /* Number of unrs to test */ + long reps = 1; + int ch; u_int i, x, m, j; - char a[NN]; + + verbose = false; + + while ((ch = getopt(argc, argv, "hr:v")) != -1) { + switch (ch) { + case 'r': + errno = 0; + reps = strtol(optarg, NULL, 0); + if (errno == ERANGE || errno == EINVAL) { + usage(argv); + exit(2); + } + + break; + case 'v': + verbose = true; + break; + case 'h': + default: + usage(argv); + exit(2); + } + + + } setbuf(stdout, NULL); - uh = new_unrhdr(0, NN - 1, NULL); + uh = new_unrhdr(0, count - 1, NULL); print_unrhdr(uh); - memset(a, 0, sizeof a); + a = calloc(count, sizeof(char)); + if (a == NULL) + err(1, "calloc failed"); srandomdev(); - fprintf(stderr, "sizeof(struct unr) %zu\n", sizeof(struct unr)); - fprintf(stderr, "sizeof(struct unrb) %zu\n", sizeof(struct unrb)); - fprintf(stderr, "sizeof(struct unrhdr) %zu\n", sizeof(struct unrhdr)); - fprintf(stderr, "NBITS %d\n", NBITS); + printf("sizeof(struct unr) %zu\n", sizeof(struct unr)); + printf("sizeof(struct unrb) %zu\n", sizeof(struct unrb)); + printf("sizeof(struct unrhdr) %zu\n", sizeof(struct unrhdr)); + printf("NBITS %d\n", NBITS); x = 1; - for (m = 0; m < NN * 100; m++) { + for (m = 0; m < count * reps; m++) { j = random(); - i = (j >> 1) % NN; + i = (j >> 1) % count; #if 0 if (a[i] && (j & 1)) continue; @@ -997,19 +1039,22 @@ main(int argc __unused, const char **arg else test_alloc_unr_specific(uh, i, a); - if (1) /* XXX: change this for detailed debug printout */ + if (verbose) print_unrhdr(uh); check_unrhdr(uh, __LINE__); } - for (i = 0; i < NN; i++) { + for (i = 0; i < count; i++) { if (a[i]) { - printf("C %u\n", i); + if (verbose) { + printf("C %u\n", i); + print_unrhdr(uh); + } free_unr(uh, i); - print_unrhdr(uh); } } print_unrhdr(uh); delete_unrhdr(uh); + free(a); return (0); } #endif Modified: head/tests/sys/kern/Makefile ============================================================================== --- head/tests/sys/kern/Makefile Fri Apr 29 21:05:48 2016 (r298810) +++ head/tests/sys/kern/Makefile Fri Apr 29 21:11:31 2016 (r298811) @@ -4,12 +4,14 @@ PACKAGE= tests FILESGROUPS= TESTS TESTSPACKAGE= ${PACKAGE} TESTSRC= ${SRCTOP}/contrib/netbsd-tests/kernel +.PATH: ${SRCTOP}/sys/kern TESTSDIR= ${TESTSBASE}/sys/kern ATF_TESTS_C+= kern_copyin ATF_TESTS_C+= kern_descrip_test ATF_TESTS_C+= ptrace_test +PLAIN_TESTS_C+= subr_unit_test ATF_TESTS_C+= unix_seqpacket_test ATF_TESTS_C+= unix_passfd_test TEST_METADATA.unix_seqpacket_test+= timeout="15" @@ -23,6 +25,14 @@ NETBSD_ATF_TESTS_C+= mqueue_test CFLAGS.mqueue_test+= -I${SRCTOP}/tests LIBADD.mqueue_test+= rt +# subr_unit.c contains functions whose prototypes lie in headers that cannot be +# included in userland. But as far as subr_unit_test goes, they're effectively +# static. So it's ok to disable -Wmissing-prototypes for this program. +CFLAGS.subr_unit.c+= -Wno-missing-prototypes +# XXX: -Wno-sign-compare will be eliminated as part of D6004 +CFLAGS.subr_unit.c+= -Wno-sign-compare +SRCS.subr_unit_test+= subr_unit.c + WARNS?= 5 TESTS_SUBDIRS+= acct From owner-svn-src-head@freebsd.org Fri Apr 29 21:18:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 95C8BB21341; Fri, 29 Apr 2016 21:18:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 662D51B34; Fri, 29 Apr 2016 21:18:15 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TLIEBc025510; Fri, 29 Apr 2016 21:18:14 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TLIEc2025507; Fri, 29 Apr 2016 21:18:14 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604292118.u3TLIEc2025507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 29 Apr 2016 21:18:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298812 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 21:18:15 -0000 Author: avos Date: Fri Apr 29 21:18:14 2016 New Revision: 298812 URL: https://svnweb.freebsd.org/changeset/base/298812 Log: net80211: provide a set of ieee80211_add_channel*() functions This change adds few methods for net80211 channel table setup: - ieee80211_add_channel() - ieee80211_add_channel_ht40() (primarily for drivers, that parse EEPROM to get channel list - they will allow to hide implementation details). - ieee80211_add_channel_list_2ghz() - ieee80211_add_channel_list_5ghz() (mostly as a replacement for ieee80211_init_channels() - they will allow to specify non-default channel list; may be used in ic_getradiocaps()). Tested with wpi(4) (add_channel) and rum(4) (add_channel_list_2ghz). Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D6124 Modified: head/sys/net80211/ieee80211.c head/sys/net80211/ieee80211_regdomain.c head/sys/net80211/ieee80211_var.h Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Fri Apr 29 21:11:31 2016 (r298811) +++ head/sys/net80211/ieee80211.c Fri Apr 29 21:18:14 2016 (r298812) @@ -970,6 +970,261 @@ ieee80211_ieee2mhz(u_int chan, u_int fla } } +static __inline void +set_extchan(struct ieee80211_channel *c) +{ + + /* + * IEEE Std 802.11-2012, page 1738, subclause 20.3.15.4: + * "the secondary channel number shall be 'N + [1,-1] * 4' + */ + if (c->ic_flags & IEEE80211_CHAN_HT40U) + c->ic_extieee = c->ic_ieee + 4; + else if (c->ic_flags & IEEE80211_CHAN_HT40D) + c->ic_extieee = c->ic_ieee - 4; + else + c->ic_extieee = 0; +} + +static int +addchan(struct ieee80211_channel chans[], int maxchans, int *nchans, + uint8_t ieee, uint16_t freq, int8_t maxregpower, uint32_t flags) +{ + struct ieee80211_channel *c; + + if (*nchans >= maxchans) + return (ENOBUFS); + + c = &chans[(*nchans)++]; + c->ic_ieee = ieee; + c->ic_freq = freq != 0 ? freq : ieee80211_ieee2mhz(ieee, flags); + c->ic_maxregpower = maxregpower; + c->ic_maxpower = 2 * maxregpower; + c->ic_flags = flags; + set_extchan(c); + + return (0); +} + +static int +copychan_prev(struct ieee80211_channel chans[], int maxchans, int *nchans, + uint32_t flags) +{ + struct ieee80211_channel *c; + + KASSERT(*nchans > 0, ("channel list is empty\n")); + + if (*nchans >= maxchans) + return (ENOBUFS); + + c = &chans[(*nchans)++]; + c[0] = c[-1]; + c->ic_flags = flags; + set_extchan(c); + + return (0); +} + +static void +getflags_2ghz(const uint8_t bands[], uint32_t flags[], int ht40) +{ + int nmodes; + + nmodes = 0; + if (isset(bands, IEEE80211_MODE_11B)) + flags[nmodes++] = IEEE80211_CHAN_B; + if (isset(bands, IEEE80211_MODE_11G)) + flags[nmodes++] = IEEE80211_CHAN_G; + if (isset(bands, IEEE80211_MODE_11NG)) + flags[nmodes++] = IEEE80211_CHAN_G | IEEE80211_CHAN_HT20; + if (ht40) { + flags[nmodes++] = IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U; + flags[nmodes++] = IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D; + } + flags[nmodes] = 0; +} + +static void +getflags_5ghz(const uint8_t bands[], uint32_t flags[], int ht40) +{ + int nmodes; + + nmodes = 0; + if (isset(bands, IEEE80211_MODE_11A)) + flags[nmodes++] = IEEE80211_CHAN_A; + if (isset(bands, IEEE80211_MODE_11NA)) + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT20; + if (ht40) { + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U; + flags[nmodes++] = IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D; + } + flags[nmodes] = 0; +} + +static void +getflags(const uint8_t bands[], uint32_t flags[], int ht40) +{ + + flags[0] = 0; + if (isset(bands, IEEE80211_MODE_11A) || + isset(bands, IEEE80211_MODE_11NA)) { + if (isset(bands, IEEE80211_MODE_11B) || + isset(bands, IEEE80211_MODE_11G) || + isset(bands, IEEE80211_MODE_11NG)) + return; + + getflags_5ghz(bands, flags, ht40); + } else + getflags_2ghz(bands, flags, ht40); +} + +/* + * Add one 20 MHz channel into specified channel list. + */ +int +ieee80211_add_channel(struct ieee80211_channel chans[], int maxchans, + int *nchans, uint8_t ieee, uint16_t freq, int8_t maxregpower, + uint32_t chan_flags, const uint8_t bands[]) +{ + uint32_t flags[IEEE80211_MODE_MAX]; + int i, error; + + getflags(bands, flags, 0); + KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); + + error = addchan(chans, maxchans, nchans, ieee, freq, maxregpower, + flags[0] | chan_flags); + for (i = 1; flags[i] != 0 && error == 0; i++) { + error = copychan_prev(chans, maxchans, nchans, + flags[i] | chan_flags); + } + + return (error); +} + +static struct ieee80211_channel * +findchannel(struct ieee80211_channel chans[], int nchans, uint16_t freq, + uint32_t flags) +{ + struct ieee80211_channel *c; + int i; + + flags &= IEEE80211_CHAN_ALLTURBO; + /* brute force search */ + for (i = 0; i < nchans; i++) { + c = &chans[i]; + if (c->ic_freq == freq && + (c->ic_flags & IEEE80211_CHAN_ALLTURBO) == flags) + return c; + } + return NULL; +} + +/* + * Add 40 MHz channel pair into specified channel list. + */ +int +ieee80211_add_channel_ht40(struct ieee80211_channel chans[], int maxchans, + int *nchans, uint8_t ieee, int8_t maxregpower, uint32_t flags) +{ + struct ieee80211_channel *cent, *extc; + uint16_t freq; + int error; + + freq = ieee80211_ieee2mhz(ieee, flags); + + /* + * Each entry defines an HT40 channel pair; find the + * center channel, then the extension channel above. + */ + flags |= IEEE80211_CHAN_HT20; + cent = findchannel(chans, *nchans, freq, flags); + if (cent == NULL) + return (EINVAL); + + extc = findchannel(chans, *nchans, freq + 20, flags); + if (extc == NULL) + return (ENOENT); + + flags &= ~IEEE80211_CHAN_HT; + error = addchan(chans, maxchans, nchans, cent->ic_ieee, cent->ic_freq, + maxregpower, flags | IEEE80211_CHAN_HT40U); + if (error != 0) + return (error); + + error = addchan(chans, maxchans, nchans, extc->ic_ieee, extc->ic_freq, + maxregpower, flags | IEEE80211_CHAN_HT40D); + + return (error); +} + +/* + * Adds channels into specified channel list (ieee[] array must be sorted). + * Channels are already sorted. + */ +static int +add_chanlist(struct ieee80211_channel chans[], int maxchans, int *nchans, + const uint8_t ieee[], int nieee, uint32_t flags[]) +{ + uint16_t freq; + int i, j, error; + + for (i = 0; i < nieee; i++) { + freq = ieee80211_ieee2mhz(ieee[i], flags[0]); + for (j = 0; flags[j] != 0; j++) { + if (flags[j] & IEEE80211_CHAN_HT40D) + if (i == 0 || ieee[i] < ieee[0] + 4 || + freq - 20 != + ieee80211_ieee2mhz(ieee[i] - 4, flags[j])) + continue; + if (flags[j] & IEEE80211_CHAN_HT40U) + if (i == nieee - 1 || + ieee[i] + 4 > ieee[nieee - 1] || + freq + 20 != + ieee80211_ieee2mhz(ieee[i] + 4, flags[j])) + continue; + + if (j == 0) { + error = addchan(chans, maxchans, nchans, + ieee[i], freq, 0, flags[j]); + } else { + error = copychan_prev(chans, maxchans, nchans, + flags[j]); + } + if (error != 0) + return (error); + } + } + + return (error); +} + +int +ieee80211_add_channel_list_2ghz(struct ieee80211_channel chans[], int maxchans, + int *nchans, const uint8_t ieee[], int nieee, const uint8_t bands[], + int ht40) +{ + uint32_t flags[IEEE80211_MODE_MAX]; + + getflags_2ghz(bands, flags, ht40); + KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); + + return (add_chanlist(chans, maxchans, nchans, ieee, nieee, flags)); +} + +int +ieee80211_add_channel_list_5ghz(struct ieee80211_channel chans[], int maxchans, + int *nchans, const uint8_t ieee[], int nieee, const uint8_t bands[], + int ht40) +{ + uint32_t flags[IEEE80211_MODE_MAX]; + + getflags_5ghz(bands, flags, ht40); + KASSERT(flags[0] != 0, ("%s: no correct mode provided\n", __func__)); + + return (add_chanlist(chans, maxchans, nchans, ieee, nieee, flags)); +} + /* * Locate a channel given a frequency+flags. We cache * the previous lookup to optimize switching between two @@ -979,7 +1234,6 @@ struct ieee80211_channel * ieee80211_find_channel(struct ieee80211com *ic, int freq, int flags) { struct ieee80211_channel *c; - int i; flags &= IEEE80211_CHAN_ALLTURBO; c = ic->ic_prevchan; @@ -987,13 +1241,7 @@ ieee80211_find_channel(struct ieee80211c (c->ic_flags & IEEE80211_CHAN_ALLTURBO) == flags) return c; /* brute force search */ - for (i = 0; i < ic->ic_nchans; i++) { - c = &ic->ic_channels[i]; - if (c->ic_freq == freq && - (c->ic_flags & IEEE80211_CHAN_ALLTURBO) == flags) - return c; - } - return NULL; + return (findchannel(ic->ic_channels, ic->ic_nchans, freq, flags)); } /* Modified: head/sys/net80211/ieee80211_regdomain.c ============================================================================== --- head/sys/net80211/ieee80211_regdomain.c Fri Apr 29 21:11:31 2016 (r298811) +++ head/sys/net80211/ieee80211_regdomain.c Fri Apr 29 21:18:14 2016 (r298812) @@ -98,22 +98,14 @@ ieee80211_regdomain_vdetach(struct ieee8 { } -static void -addchan(struct ieee80211com *ic, int ieee, int flags) -{ - struct ieee80211_channel *c; - - c = &ic->ic_channels[ic->ic_nchans++]; - c->ic_freq = ieee80211_ieee2mhz(ieee, flags); - c->ic_ieee = ieee; - c->ic_flags = flags; - if (flags & IEEE80211_CHAN_HT40U) - c->ic_extieee = ieee + 4; - else if (flags & IEEE80211_CHAN_HT40D) - c->ic_extieee = ieee - 4; - else - c->ic_extieee = 0; -} +static const uint8_t def_chan_2ghz[] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 }; +static const uint8_t def_chan_5ghz_band1[] = + { 36, 40, 44, 48, 52, 56, 60, 64 }; +static const uint8_t def_chan_5ghz_band2[] = + { 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140 }; +static const uint8_t def_chan_5ghz_band3[] = + { 149, 153, 157, 161 }; /* * Setup the channel list for the specified regulatory domain, @@ -125,82 +117,34 @@ int ieee80211_init_channels(struct ieee80211com *ic, const struct ieee80211_regdomain *rd, const uint8_t bands[]) { - int i; + struct ieee80211_channel *chans = ic->ic_channels; + int *nchans = &ic->ic_nchans; + int ht40; /* XXX just do something for now */ - ic->ic_nchans = 0; + ht40 = !!(ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40); + *nchans = 0; if (isset(bands, IEEE80211_MODE_11B) || isset(bands, IEEE80211_MODE_11G) || isset(bands, IEEE80211_MODE_11NG)) { - int maxchan = 11; - if (rd != NULL && rd->ecm) - maxchan = 14; - for (i = 1; i <= maxchan; i++) { - if (isset(bands, IEEE80211_MODE_11B)) - addchan(ic, i, IEEE80211_CHAN_B); - if (isset(bands, IEEE80211_MODE_11G)) - addchan(ic, i, IEEE80211_CHAN_G); - if (isset(bands, IEEE80211_MODE_11NG)) { - addchan(ic, i, - IEEE80211_CHAN_G | IEEE80211_CHAN_HT20); - } - if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) == 0) - continue; - if (i <= 7) { - addchan(ic, i, - IEEE80211_CHAN_G | IEEE80211_CHAN_HT40U); - addchan(ic, i + 4, - IEEE80211_CHAN_G | IEEE80211_CHAN_HT40D); - } - } + int nchan = nitems(def_chan_2ghz); + if (!(rd != NULL && rd->ecm)) + nchan -= 3; + + ieee80211_add_channel_list_2ghz(chans, IEEE80211_CHAN_MAX, + nchans, def_chan_2ghz, nchan, bands, ht40); } if (isset(bands, IEEE80211_MODE_11A) || isset(bands, IEEE80211_MODE_11NA)) { - for (i = 36; i <= 64; i += 4) { - addchan(ic, i, IEEE80211_CHAN_A); - if (isset(bands, IEEE80211_MODE_11NA)) { - addchan(ic, i, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT20); - } - if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) == 0) - continue; - if ((i % 8) == 4) { - addchan(ic, i, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U); - addchan(ic, i + 4, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D); - } - } - for (i = 100; i <= 140; i += 4) { - addchan(ic, i, IEEE80211_CHAN_A); - if (isset(bands, IEEE80211_MODE_11NA)) { - addchan(ic, i, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT20); - } - if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) == 0) - continue; - if ((i % 8) == 4 && i != 140) { - addchan(ic, i, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U); - addchan(ic, i + 4, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D); - } - } - for (i = 149; i <= 161; i += 4) { - addchan(ic, i, IEEE80211_CHAN_A); - if (isset(bands, IEEE80211_MODE_11NA)) { - addchan(ic, i, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT20); - } - if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) == 0) - continue; - if ((i % 8) == 5) { - addchan(ic, i, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT40U); - addchan(ic, i + 4, - IEEE80211_CHAN_A | IEEE80211_CHAN_HT40D); - } - } + ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, + nchans, def_chan_5ghz_band1, nitems(def_chan_5ghz_band1), + bands, ht40); + ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, + nchans, def_chan_5ghz_band2, nitems(def_chan_5ghz_band2), + bands, ht40); + ieee80211_add_channel_list_5ghz(chans, IEEE80211_CHAN_MAX, + nchans, def_chan_5ghz_band3, nitems(def_chan_5ghz_band3), + bands, ht40); } if (rd != NULL) ic->ic_regdomain = *rd; Modified: head/sys/net80211/ieee80211_var.h ============================================================================== --- head/sys/net80211/ieee80211_var.h Fri Apr 29 21:11:31 2016 (r298811) +++ head/sys/net80211/ieee80211_var.h Fri Apr 29 21:18:14 2016 (r298812) @@ -723,6 +723,14 @@ int ieee80211_mhz2ieee(u_int, u_int); int ieee80211_chan2ieee(struct ieee80211com *, const struct ieee80211_channel *); u_int ieee80211_ieee2mhz(u_int, u_int); +int ieee80211_add_channel(struct ieee80211_channel[], int, int *, + uint8_t, uint16_t, int8_t, uint32_t, const uint8_t[]); +int ieee80211_add_channel_ht40(struct ieee80211_channel[], int, int *, + uint8_t, int8_t, uint32_t); +int ieee80211_add_channel_list_2ghz(struct ieee80211_channel[], int, int *, + const uint8_t[], int, const uint8_t[], int); +int ieee80211_add_channel_list_5ghz(struct ieee80211_channel[], int, int *, + const uint8_t[], int, const uint8_t[], int); struct ieee80211_channel *ieee80211_find_channel(struct ieee80211com *, int freq, int flags); struct ieee80211_channel *ieee80211_find_channel_byieee(struct ieee80211com *, From owner-svn-src-head@freebsd.org Fri Apr 29 21:25:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3F0BB2155C; Fri, 29 Apr 2016 21:25:10 +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 450F5116D; Fri, 29 Apr 2016 21:25: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 u3TLP9EM028704; Fri, 29 Apr 2016 21:25:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TLP5BV028665; Fri, 29 Apr 2016 21:25:05 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292125.u3TLP5BV028665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 21:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298813 - in head/sys/netgraph: . atm bluetooth/drivers/ubt bluetooth/hci bluetooth/include bluetooth/l2cap bluetooth/socket netflow X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 21:25:10 -0000 Author: pfg Date: Fri Apr 29 21:25:05 2016 New Revision: 298813 URL: https://svnweb.freebsd.org/changeset/base/298813 Log: sys/netgraph: spelling fixes in comments. No functional change. Modified: head/sys/netgraph/atm/ng_atm.c head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c head/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h head/sys/netgraph/bluetooth/include/ng_hci.h head/sys/netgraph/bluetooth/include/ng_l2cap.h head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c head/sys/netgraph/netflow/ng_netflow.c head/sys/netgraph/netflow/ng_netflow.h head/sys/netgraph/netgraph.h head/sys/netgraph/ng_base.c head/sys/netgraph/ng_bridge.c head/sys/netgraph/ng_car.c head/sys/netgraph/ng_car.h head/sys/netgraph/ng_etf.c head/sys/netgraph/ng_ether.c head/sys/netgraph/ng_frame_relay.c head/sys/netgraph/ng_gif.c head/sys/netgraph/ng_gif_demux.c head/sys/netgraph/ng_ksocket.c head/sys/netgraph/ng_l2tp.h head/sys/netgraph/ng_lmi.c head/sys/netgraph/ng_one2many.c head/sys/netgraph/ng_ppp.c head/sys/netgraph/ng_pppoe.c head/sys/netgraph/ng_pptpgre.c head/sys/netgraph/ng_sample.c head/sys/netgraph/ng_source.c head/sys/netgraph/ng_split.h head/sys/netgraph/ng_tee.c head/sys/netgraph/ng_tty.c head/sys/netgraph/ng_vjc.c head/sys/netgraph/ng_vlan.c Modified: head/sys/netgraph/atm/ng_atm.c ============================================================================== --- head/sys/netgraph/atm/ng_atm.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/atm/ng_atm.c Fri Apr 29 21:25:05 2016 (r298813) @@ -1343,7 +1343,7 @@ ng_atm_shutdown(node_p node) } #else /* - * We are persistant - reinitialize + * We are persistent - reinitialize. */ NG_NODE_REVIVE(node); #endif Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Fri Apr 29 21:25:05 2016 (r298813) @@ -58,7 +58,7 @@ * 2) Netgraph context. This is where all the Netgraph related stuff happens. * Since we mark node as WRITER, the Netgraph node will be "locked" (from * Netgraph point of view). Any variable that is only modified from the - * Netgraph context does not require any additonal locking. It is generally + * Netgraph context does not require any additional locking. It is generally * *NOT* allowed to grab *ANY* additional locks. Whatever you do, *DO NOT* * grab any lock in the Netgraph context that could cause de-scheduling of * the Netgraph thread for significant amount of time. In fact, the only @@ -1463,7 +1463,7 @@ ng_ubt_shutdown(node_p node) if (node->nd_flags & NGF_REALLY_DIE) { /* * We came here because the USB device is being - * detached, so stop being persistant. + * detached, so stop being persistent. */ NG_NODE_SET_PRIVATE(node, NULL); NG_NODE_UNREF(node); Modified: head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c ============================================================================== --- head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Fri Apr 29 21:25:05 2016 (r298813) @@ -369,7 +369,7 @@ complete_command(ng_hci_unit_p unit, int * and return command parameters. ng_hci_command_untimeout will * drop NG_HCI_UNIT_COMMAND_PENDING flag. * Note: if ng_hci_command_untimeout() fails (returns non-zero) - * then timeout aready happened and timeout message went info node + * then timeout already happened and timeout message went info node * queue. In this case we ignore command completion and pretend * there is a timeout. */ Modified: head/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/include/ng_btsocket_rfcomm.h Fri Apr 29 21:25:05 2016 (r298813) @@ -69,7 +69,7 @@ #define RFCOMM_MODEM_FC 0x02 /* Flow Control asserted */ #define RFCOMM_MODEM_RTC 0x04 /* Ready To Communicate */ #define RFCOMM_MODEM_RTR 0x08 /* Ready To Receive */ -#define RFCOMM_MODEM_IC 0x40 /* Incomming Call */ +#define RFCOMM_MODEM_IC 0x40 /* Incoming Call */ #define RFCOMM_MODEM_DV 0x80 /* Data Valid */ /* RPN parameters - baud rate */ @@ -270,7 +270,7 @@ struct ng_btsocket_rfcomm_pcb { u_int16_t flags; /* DLC flags */ #define NG_BTSOCKET_RFCOMM_DLC_TIMO (1 << 0) /* timeout pending */ #define NG_BTSOCKET_RFCOMM_DLC_CFC (1 << 1) /* credit flow ctrl */ -#define NG_BTSOCKET_RFCOMM_DLC_TIMEDOUT (1 << 2) /* timeout happend */ +#define NG_BTSOCKET_RFCOMM_DLC_TIMEDOUT (1 << 2) /* timeout happened */ #define NG_BTSOCKET_RFCOMM_DLC_DETACHED (1 << 3) /* DLC detached */ #define NG_BTSOCKET_RFCOMM_DLC_SENDING (1 << 4) /* send pending */ Modified: head/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_hci.h Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/include/ng_hci.h Fri Apr 29 21:25:05 2016 (r298813) @@ -1560,7 +1560,7 @@ typedef struct { u_int16_t min_ce_length; u_int16_t max_ce_length; }__attribute__((packed)) ng_hci_le_create_connection_cp; -/* no return paramters*/ +/* No return parameters. */ #define NG_HCI_OCF_LE_CREATE_CONNECTION_CANCEL 0x000e /*No command parameter*/ typedef ng_hci_status_rp ng_hci_le_create_connection_cancel_rp; @@ -1572,7 +1572,7 @@ typedef struct { } __attribute__ ((packed)) ng_hci_le_read_white_list_size_rp; #define NG_HCI_OCF_LE_CLEAR_WHITE_LIST 0x0010 -/*No command paramters*/ +/* No command parameters. */ typedef ng_hci_status_rp ng_hci_le_clear_white_list_rp; #define NG_HCI_OCF_LE_ADD_DEVICE_TO_WHITE_LIST 0x0011 typedef struct { @@ -1689,7 +1689,7 @@ typedef struct{ typedef ng_hci_status_rp ng_hci_le_transmitter_test_rp; #define NG_HCI_OCF_LE_TEST_END 0x001f -/*No command paramter*/ +/* No command parameter. */ typedef struct { u_int8_t status; u_int16_t number_of_packets; Modified: head/sys/netgraph/bluetooth/include/ng_l2cap.h ============================================================================== --- head/sys/netgraph/bluetooth/include/ng_l2cap.h Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/include/ng_l2cap.h Fri Apr 29 21:25:05 2016 (r298813) @@ -385,7 +385,7 @@ typedef struct { bdaddr_t bdaddr; /* remote unit address */ u_int16_t lcid; /* local channel ID */ u_int16_t psm; /* Procotol/Service Multiplexor */ - u_int8_t ident; /* indentifier */ + u_int8_t ident; /* identifier */ u_int8_t linktype; /* link type*/ } ng_l2cap_l2ca_con_ind_ip; /* No output parameters */ @@ -688,7 +688,7 @@ typedef struct { u_int16_t scid; /* source (local) channel ID */ u_int16_t dcid; /* destination (remote) channel ID */ - u_int16_t imtu; /* incomming MTU */ + u_int16_t imtu; /* incoming MTU */ u_int16_t omtu; /* outgoing MTU */ u_int16_t psm; /* PSM */ Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_cmds.c Fri Apr 29 21:25:05 2016 (r298813) @@ -332,7 +332,7 @@ ng_l2cap_con_fail(ng_l2cap_con_p con, u_ /* * Process L2CAP command timeout. In general - notify upper layer and destroy - * channel. Do not pay much attension to return code, just do our best. + * channel. Do not pay much attention to return code, just do our best. */ void Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_evnt.c Fri Apr 29 21:25:05 2016 (r298813) @@ -358,7 +358,7 @@ ng_l2cap_process_lesignal_cmd(ng_l2cap_c /*Update Paramater Request*/ static int ng_l2cap_process_cmd_urq(ng_l2cap_con_p con, uint8_t ident) { - /*We do not implement paramter negotiasion for now*/ + /* We do not implement parameter negotiation for now. */ send_l2cap_param_urs(con, ident, NG_L2CAP_UPDATE_PARAM_ACCEPT); NG_FREE_M(con->rx_pkt); return 0; @@ -1068,7 +1068,7 @@ ng_l2cap_process_discon_rsp(ng_l2cap_con } /* - * Looks like we have successfuly disconnected channel, so notify + * Looks like we have successfully disconnected channel, so notify * upper layer. If command timeout already happened then ignore * response. */ Modified: head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c ============================================================================== --- head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/l2cap/ng_l2cap_misc.c Fri Apr 29 21:25:05 2016 (r298813) @@ -325,7 +325,7 @@ ng_l2cap_con_by_handle(ng_l2cap_p l2cap, } /* ng_l2cap_con_by_handle */ /* - * Allocate new L2CAP channel descriptor on "con" conection with "psm". + * Allocate new L2CAP channel descriptor on "con" connection with "psm". * Will link the channel to the l2cap node */ Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_l2cap.c Fri Apr 29 21:25:05 2016 (r298813) @@ -2076,7 +2076,7 @@ ng_btsocket_l2cap_attach(struct socket * * This is totally FUBAR. We could get here in two cases: * * 1) When user calls socket() - * 2) When we need to accept new incomming connection and call + * 2) When we need to accept new incoming connection and call * sonewconn() * * In the first case we must acquire ng_btsocket_l2cap_sockets_mtx. @@ -2610,7 +2610,7 @@ ng_btsocket_l2cap_send(struct socket *so goto drop; } - /* Check packet size agains outgoing (peer's incoming) MTU) */ + /* Check packet size against outgoing (peer's incoming) MTU) */ if (m->m_pkthdr.len > pcb->omtu) { NG_BTSOCKET_L2CAP_ERR( "%s: Packet too big, len=%d, omtu=%d\n", __func__, m->m_pkthdr.len, pcb->omtu); @@ -2690,7 +2690,7 @@ ng_btsocket_l2cap_send2(ng_btsocket_l2ca hdr->token, pcb->state); /* - * If we got here than we have successfuly creates new L2CAP + * If we got here than we have successfully creates new L2CAP * data packet and now we can send it to the L2CAP layer */ Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_rfcomm.c Fri Apr 29 21:25:05 2016 (r298813) @@ -1475,7 +1475,7 @@ ng_btsocket_rfcomm_session_accept(ng_bts s->state = NG_BTSOCKET_RFCOMM_SESSION_CONNECTED; /* - * Adjust MTU on incomming connection. Reserve 5 bytes: + * Adjust MTU on incoming connection. Reserve 5 bytes: * RFCOMM frame header, one extra byte for length and * one extra byte for credits. */ @@ -2881,7 +2881,7 @@ ng_btsocket_rfcomm_receive_pn(ng_btsocke mtx_unlock(&pcb->pcb_mtx); } else if (RFCOMM_CR(hdr->type)) { - /* PN request to non-existing dlci - incomming connection */ + /* PN request to non-existing dlci - incoming connection */ pcb = ng_btsocket_rfcomm_connect_ind(s, RFCOMM_SRVCHANNEL(pn->dlci)); if (pcb != NULL) { Modified: head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c ============================================================================== --- head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/bluetooth/socket/ng_btsocket_sco.c Fri Apr 29 21:25:05 2016 (r298813) @@ -1261,10 +1261,10 @@ ng_btsocket_sco_attach(struct socket *so * This is totally FUBAR. We could get here in two cases: * * 1) When user calls socket() - * 2) When we need to accept new incomming connection and call + * 2) When we need to accept new incoming connection and call * sonewconn() * - * In the first case we must aquire ng_btsocket_sco_sockets_mtx. + * In the first case we must acquire ng_btsocket_sco_sockets_mtx. * In the second case we hold ng_btsocket_sco_sockets_mtx already. * So we now need to distinguish between these cases. From reading * /sys/kern/uipc_socket2.c we can find out that sonewconn() calls Modified: head/sys/netgraph/netflow/ng_netflow.c ============================================================================== --- head/sys/netgraph/netflow/ng_netflow.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/netflow/ng_netflow.c Fri Apr 29 21:25:05 2016 (r298813) @@ -826,7 +826,7 @@ ng_netflow_rcvdata (hook_p hook, item_p goto bypass; /* - * Loop thru IPv6 extended headers to get upper + * Loop through IPv6 extended headers to get upper * layer header / frag. */ for (;;) { Modified: head/sys/netgraph/netflow/ng_netflow.h ============================================================================== --- head/sys/netgraph/netflow/ng_netflow.h Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/netflow/ng_netflow.h Fri Apr 29 21:25:05 2016 (r298813) @@ -166,7 +166,7 @@ struct ng_netflow_setmtu { uint16_t mtu; /* MTU for packet */ }; -/* This structure is used in NGM_NETFLOW_SHOW request/responce */ +/* This structure is used in NGM_NETFLOW_SHOW request/response */ struct ngnf_show_header { u_char version; /* IPv4 or IPv6 */ uint32_t hash_id; /* current hash index */ Modified: head/sys/netgraph/netgraph.h ============================================================================== --- head/sys/netgraph/netgraph.h Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/netgraph.h Fri Apr 29 21:25:05 2016 (r298813) @@ -109,7 +109,7 @@ typedef int ng_rcvitem (node_p node, hoo */ struct ng_hook { char hk_name[NG_HOOKSIZ]; /* what this node knows this link as */ - void *hk_private; /* node dependant ID for this hook */ + void *hk_private; /* node dependent ID for this hook */ int hk_flags; /* info about this hook/link */ int hk_type; /* tbd: hook data link type */ struct ng_hook *hk_peer; /* the other end of this link */ @@ -362,7 +362,7 @@ struct ng_node { struct ng_type *nd_type; /* the installed 'type' */ int nd_flags; /* see below for bit definitions */ int nd_numhooks; /* number of hooks */ - void *nd_private; /* node type dependant node ID */ + void *nd_private; /* node type dependent node ID */ ng_ID_t nd_ID; /* Unique per node */ LIST_HEAD(hooks, ng_hook) nd_hooks; /* linked list of node hooks */ LIST_ENTRY(ng_node) nd_nodes; /* name hash collision list */ @@ -1066,7 +1066,7 @@ struct ng_cmdlist { * Note the input queueing system is to allow modules * to 'release the stack' or to pass data across spl layers. * The data will be redelivered as soon as the NETISR code runs - * which may be almost immediatly. A node may also do it's own queueing + * which may be almost immediately. A node may also do it's own queueing * for other reasons (e.g. device output queuing). */ struct ng_type { Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_base.c Fri Apr 29 21:25:05 2016 (r298813) @@ -759,7 +759,7 @@ ng_rmnode(node_p node, hook_p dummy1, vo /* * Well, blow me down if the node code hasn't declared * that it doesn't want to die. - * Presumably it is a persistant node. + * Presumably it is a persistent node. * If we REALLY want it to go away, * e.g. hardware going away, * Our caller should set NGF_REALLY_DIE in nd_flags. @@ -2935,7 +2935,7 @@ ng_generic_msg(node_p here, item_p item, * Sometimes a generic message may be statically allocated * to avoid problems with allocating when in tight memory situations. * Don't free it if it is so. - * I break them appart here, because erros may cause a free if the item + * I break them apart here, because erros may cause a free if the item * in which case we'd be doing it twice. * they are kept together above, to simplify freeing. */ Modified: head/sys/netgraph/ng_bridge.c ============================================================================== --- head/sys/netgraph/ng_bridge.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_bridge.c Fri Apr 29 21:25:05 2016 (r298813) @@ -327,7 +327,7 @@ ng_bridge_constructor(node_p node) /* * This node has all kinds of stuff that could be screwed by SMP. * Until it gets it's own internal protection, we go through in - * single file. This could hurt a machine bridging beteen two + * single file. This could hurt a machine bridging between two * GB ethernets so it should be fixed. * When it's fixed the process SHOULD NOT SLEEP, spinlocks please! * (and atomic ops ) Modified: head/sys/netgraph/ng_car.c ============================================================================== --- head/sys/netgraph/ng_car.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_car.c Fri Apr 29 21:25:05 2016 (r298813) @@ -28,7 +28,7 @@ */ /* - * ng_car - An implementation of commited access rate for netgraph + * ng_car - An implementation of committed access rate for netgraph * * TODO: * - Sanitize input config values (impose some limits) @@ -49,14 +49,14 @@ #include #define NG_CAR_QUEUE_SIZE 100 /* Maximum queue size for SHAPE mode */ -#define NG_CAR_QUEUE_MIN_TH 8 /* Minimum RED threshhold for SHAPE mode */ +#define NG_CAR_QUEUE_MIN_TH 8 /* Minimum RED threshold for SHAPE mode */ /* Hook private info */ struct hookinfo { hook_p hook; /* this (source) hook */ hook_p dest; /* destination hook */ - int64_t tc; /* commited token bucket counter */ + int64_t tc; /* committed token bucket counter */ int64_t te; /* exceeded/peak token bucket counter */ struct bintime lastRefill; /* last token refill time */ @@ -296,7 +296,7 @@ ng_car_rcvdata(hook_p hook, item_p item len = m->m_pkthdr.len; } - /* Check commited token bucket. */ + /* Check committed token bucket. */ if (hinfo->tc - len >= 0) { /* This packet is green. */ ++hinfo->stats.green_pkts; @@ -307,7 +307,7 @@ ng_car_rcvdata(hook_p hook, item_p item /* Refill only if not green without it. */ ng_car_refillhook(hinfo); - /* Check commited token bucket again after refill. */ + /* Check committed token bucket again after refill. */ if (hinfo->tc - len >= 0) { /* This packet is green */ ++hinfo->stats.green_pkts; @@ -339,7 +339,7 @@ ng_car_rcvdata(hook_p hook, item_p item hinfo->tc -= len; NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.yellow_action); } else { - /* This packet is probaly red. */ + /* This packet is probably red. */ ++hinfo->stats.red_pkts; hinfo->te = 0; NG_CAR_PERFORM_MATCH_ACTION(hinfo->conf.red_action); @@ -608,7 +608,7 @@ ng_car_refillhook(struct hookinfo *h) if (h->conf.mode == NG_CAR_SINGLE_RATE) { int64_t delta; - /* Refill commited token bucket. */ + /* Refill committed token bucket. */ h->tc += (h->conf.cir * deltat_us) >> 23; delta = h->tc - h->conf.cbs; if (delta > 0) { @@ -621,7 +621,7 @@ ng_car_refillhook(struct hookinfo *h) } } else if (h->conf.mode == NG_CAR_DOUBLE_RATE) { - /* Refill commited token bucket. */ + /* Refill committed token bucket. */ h->tc += (h->conf.cir * deltat_us) >> 23; if (h->tc > ((int64_t)h->conf.cbs)) h->tc = h->conf.cbs; @@ -632,7 +632,7 @@ ng_car_refillhook(struct hookinfo *h) h->te = h->conf.ebs; } else { /* RED or SHAPE mode. */ - /* Refill commited token bucket. */ + /* Refill committed token bucket. */ h->tc += (h->conf.cir * deltat_us) >> 23; if (h->tc > ((int64_t)h->conf.cbs)) h->tc = h->conf.cbs; Modified: head/sys/netgraph/ng_car.h ============================================================================== --- head/sys/netgraph/ng_car.h Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_car.h Fri Apr 29 21:25:05 2016 (r298813) @@ -69,9 +69,9 @@ struct ng_car_bulkstats { /* Per hook configuration */ struct ng_car_hookconf { - u_int64_t cbs; /* Commited burst size (bytes) */ + u_int64_t cbs; /* Committed burst size (bytes) */ u_int64_t ebs; /* Exceeded/Peak burst size (bytes) */ - u_int64_t cir; /* Commited information rate (bits/s) */ + u_int64_t cir; /* Committed information rate (bits/s) */ u_int64_t pir; /* Peak information rate (bits/s) */ u_int8_t green_action; /* Action for green packets */ u_int8_t yellow_action; /* Action for yellow packets */ Modified: head/sys/netgraph/ng_etf.c ============================================================================== --- head/sys/netgraph/ng_etf.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_etf.c Fri Apr 29 21:25:05 2016 (r298813) @@ -228,7 +228,7 @@ ng_etf_newhook(node_p node, hook_p hook, /* * Get a netgraph control message. - * We actually recieve a queue item that has a pointer to the message. + * We actually receive a queue item that has a pointer to the message. * If we free the item, the message will be freed too, unless we remove * it from the item using NGI_GET_MSG(); * The return address is also stored in the item, as an ng_ID_t, Modified: head/sys/netgraph/ng_ether.c ============================================================================== --- head/sys/netgraph/ng_ether.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_ether.c Fri Apr 29 21:25:05 2016 (r298813) @@ -754,7 +754,7 @@ ng_ether_shutdown(node_p node) if (node->nd_flags & NGF_REALLY_DIE) { /* * WE came here because the ethernet card is being unloaded, - * so stop being persistant. + * so stop being persistent. * Actually undo all the things we did on creation. * Assume the ifp has already been freed. */ Modified: head/sys/netgraph/ng_frame_relay.c ============================================================================== --- head/sys/netgraph/ng_frame_relay.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_frame_relay.c Fri Apr 29 21:25:05 2016 (r298813) @@ -364,7 +364,7 @@ ngfrm_rcvdata(hook_p hook, item_p item) data = mtod(m, char *); /* - * Shift the lowest bits into the address field untill we are done. + * Shift the lowest bits into the address field until we are done. * First byte is MSBits of addr so work backwards. */ switch (alen) { Modified: head/sys/netgraph/ng_gif.c ============================================================================== --- head/sys/netgraph/ng_gif.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_gif.c Fri Apr 29 21:25:05 2016 (r298813) @@ -491,7 +491,7 @@ ng_gif_shutdown(node_p node) if (node->nd_flags & NGF_REALLY_DIE) { /* * WE came here because the gif interface is being destroyed, - * so stop being persistant. + * so stop being persistent. * Actually undo all the things we did on creation. * Assume the ifp has already been freed. */ Modified: head/sys/netgraph/ng_gif_demux.c ============================================================================== --- head/sys/netgraph/ng_gif_demux.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_gif_demux.c Fri Apr 29 21:25:05 2016 (r298813) @@ -70,7 +70,7 @@ * * Packets received on the "gif" hook have their type header removed * and are passed to the appropriate hook protocol hook. Packets - * recieved on a protocol hook have a type header added back and are + * received on a protocol hook have a type header added back and are * passed out the gif hook. The currently supported protocol hooks are: */ Modified: head/sys/netgraph/ng_ksocket.c ============================================================================== --- head/sys/netgraph/ng_ksocket.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_ksocket.c Fri Apr 29 21:25:05 2016 (r298813) @@ -632,7 +632,7 @@ ng_ksocket_connect(hook_p hook) * first created and now (on another processesor) will * be earlier on the queue than the request to finalise the hook. * By the time the hook is finalised, - * The queued upcalls will have happenned and the code + * The queued upcalls will have happened and the code * will have discarded them because of a lack of a hook. * (socket not open). * @@ -642,9 +642,9 @@ ng_ksocket_connect(hook_p hook) * Since we are a netgraph operation * We know that we hold a lock on this node. This forces the * request we make below to be queued rather than implemented - * immediatly which will cause the upcall function to be called a bit + * immediately which will cause the upcall function to be called a bit * later. - * However, as we will run any waiting queued operations immediatly + * However, as we will run any waiting queued operations immediately * after doing this one, if we have not finalised the other end * of the hook, those queued operations will fail. */ Modified: head/sys/netgraph/ng_l2tp.h ============================================================================== --- head/sys/netgraph/ng_l2tp.h Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_l2tp.h Fri Apr 29 21:25:05 2016 (r298813) @@ -54,7 +54,7 @@ #define NG_L2TP_HOOK_SESSION_P "session_" /* session data hook (prefix) */ #define NG_L2TP_HOOK_SESSION_F "session_%04x" /* session data hook (format) */ -/* Set intial sequence numbers to not yet enabled node. */ +/* Set initial sequence numbers to not yet enabled node. */ struct ng_l2tp_seq_config { u_int16_t ns; /* sequence number to send next */ u_int16_t nr; /* sequence number to be recved next */ Modified: head/sys/netgraph/ng_lmi.c ============================================================================== --- head/sys/netgraph/ng_lmi.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_lmi.c Fri Apr 29 21:25:05 2016 (r298813) @@ -429,7 +429,7 @@ ngauto_state_machine(sc_p sc) break; } - /* send an inquirey encoded appropriatly */ + /* send an inquirey encoded appropriately */ nglmi_inquire(sc, 0); sc->poll_count--; } @@ -585,7 +585,7 @@ nglmi_rcvdata(hook_p hook, item_p item) /* Now check if there is a 'locking shift'. This is only seen in * Annex D frames. don't bother checking, we already did that. Don't - * increment immediatly as it might not be there. */ + * increment immediately as it might not be there. */ if (ANNEXD(sc)) STEPBY(1); Modified: head/sys/netgraph/ng_one2many.c ============================================================================== --- head/sys/netgraph/ng_one2many.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_one2many.c Fri Apr 29 21:25:05 2016 (r298813) @@ -44,7 +44,7 @@ * ng_one2many(4) netgraph node type * * Packets received on the "one" hook are sent out each of the - * "many" hooks accoring to an algorithm. Packets received on any + * "many" hooks according to an algorithm. Packets received on any * "many" hook are always delivered to the "one" hook. */ Modified: head/sys/netgraph/ng_ppp.c ============================================================================== --- head/sys/netgraph/ng_ppp.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_ppp.c Fri Apr 29 21:25:05 2016 (r298813) @@ -152,7 +152,7 @@ static MALLOC_DEFINE(M_NETGRAPH_PPP, "ne ((s) | ~MP_LONG_SEQ_MASK) \ : ((s) & MP_LONG_SEQ_MASK)) -/* Comparision of MP sequence numbers. Note: all sequence numbers +/* Comparison of MP sequence numbers. Note: all sequence numbers except priv->xseq are stored with the sign bit extended. */ #define MP_SHORT_SEQ_DIFF(x,y) MP_SHORT_EXTEND((x) - (y)) #define MP_LONG_SEQ_DIFF(x,y) MP_LONG_EXTEND((x) - (y)) @@ -211,7 +211,7 @@ struct ng_ppp_private { struct ng_ppp_link links[NG_PPP_MAX_LINKS];/* per-link info */ int32_t xseq; /* next out MP seq # */ int32_t mseq; /* min links[i].seq */ - uint16_t activeLinks[NG_PPP_MAX_LINKS]; /* indicies */ + uint16_t activeLinks[NG_PPP_MAX_LINKS]; /* indices */ uint16_t numActiveLinks; /* how many links up */ uint16_t lastLink; /* for round robin */ uint8_t vjCompHooked; /* VJ comp hooked up? */ @@ -254,7 +254,7 @@ static ng_rcvdata_t ng_ppp_rcvdata_decom static ng_rcvdata_t ng_ppp_rcvdata_encrypt; static ng_rcvdata_t ng_ppp_rcvdata_decrypt; -/* We use integer indicies to refer to the non-link hooks. */ +/* We use integer indices to refer to the non-link hooks. */ static const struct { char *const name; ng_rcvdata_t *fn; @@ -1511,7 +1511,7 @@ done: * discarded, their missing fragments are declared lost and MSEQ * is increased. * - * o If we recieve a fragment with seq# < MSEQ, we throw it away + * o If we receive a fragment with seq# < MSEQ, we throw it away * because we've already delcared it lost. * * This assumes linkNum != NG_PPP_BUNDLE_LINKNUM. Modified: head/sys/netgraph/ng_pppoe.c ============================================================================== --- head/sys/netgraph/ng_pppoe.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_pppoe.c Fri Apr 29 21:25:05 2016 (r298813) @@ -788,7 +788,7 @@ ng_pppoe_rcvmsg(node_p node, item_p item } /* - * PPPOE_SERVICE advertisments are set up + * PPPOE_SERVICE advertisements are set up * on sessions that are in PRIMED state. */ if (msg->header.cmd == NGM_PPPOE_SERVICE) @@ -1729,7 +1729,7 @@ ng_pppoe_rcvdata_debug(hook_p hook, item /* * Do local shutdown processing.. - * If we are a persistant device, we might refuse to go away, and + * If we are a persistent device, we might refuse to go away, and * we'd only remove our links and reset ourself. */ static int Modified: head/sys/netgraph/ng_pptpgre.c ============================================================================== --- head/sys/netgraph/ng_pptpgre.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_pptpgre.c Fri Apr 29 21:25:05 2016 (r298813) @@ -124,7 +124,7 @@ typedef u_int64_t pptptime_t; #define PPTP_MIN_TIMEOUT (PPTP_TIME_SCALE / 83) /* 12 milliseconds */ #define PPTP_MAX_TIMEOUT (3 * PPTP_TIME_SCALE) /* 3 seconds */ -/* When we recieve a packet, we wait to see if there's an outgoing packet +/* When we receive a packet, we wait to see if there's an outgoing packet we can piggy-back the ACK off of. These parameters determine the mimimum and maxmimum length of time we're willing to wait in order to do that. These have no effect unless "enableDelayedAck" is turned on. */ Modified: head/sys/netgraph/ng_sample.c ============================================================================== --- head/sys/netgraph/ng_sample.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_sample.c Fri Apr 29 21:25:05 2016 (r298813) @@ -241,7 +241,7 @@ ng_xxx_newhook(node_p node, hook_p hook, /* * Get a netgraph control message. - * We actually recieve a queue item that has a pointer to the message. + * We actually receive a queue item that has a pointer to the message. * If we free the item, the message will be freed too, unless we remove * it from the item using NGI_GET_MSG(); * The return address is also stored in the item, as an ng_ID_t, @@ -404,8 +404,8 @@ devintr() /* * Do local shutdown processing.. * All our links and the name have already been removed. - * If we are a persistant device, we might refuse to go away. - * In the case of a persistant node we signal the framework that we + * If we are a persistent device, we might refuse to go away. + * In the case of a persistent node we signal the framework that we * are still in business by clearing the NGF_INVALID bit. However * If we find the NGF_REALLY_DIE bit set, this means that * we REALLY need to die (e.g. hardware removed). @@ -426,7 +426,7 @@ ng_xxx_shutdown(node_p node) if (node->nd_flags & NGF_REALLY_DIE) { /* * WE came here because the widget card is being unloaded, - * so stop being persistant. + * so stop being persistent. * Actually undo all the things we did on creation. */ NG_NODE_SET_PRIVATE(node, NULL); Modified: head/sys/netgraph/ng_source.c ============================================================================== --- head/sys/netgraph/ng_source.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_source.c Fri Apr 29 21:25:05 2016 (r298813) @@ -43,7 +43,7 @@ __FBSDID("$FreeBSD$"); /* * This node is used for high speed packet geneneration. It queues - * all data recieved on its 'input' hook and when told to start via + * all data received on its 'input' hook and when told to start via * a control message it sends the packets out its 'output' hook. In * this way this node can be preloaded with a packet stream which it * can then send continuously as fast as possible. Modified: head/sys/netgraph/ng_split.h ============================================================================== --- head/sys/netgraph/ng_split.h Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_split.h Fri Apr 29 21:25:05 2016 (r298813) @@ -40,6 +40,6 @@ /* My hook names */ #define NG_SPLIT_HOOK_MIXED "mixed" /* Mixed stream (in/out) */ #define NG_SPLIT_HOOK_OUT "out" /* Output to outhook (sending out) */ -#define NG_SPLIT_HOOK_IN "in" /* Input from inhook (recieving) */ +#define NG_SPLIT_HOOK_IN "in" /* Input from inhook (receiving) */ #endif /* _NETGRAPH_NG_SPLIT_H_ */ Modified: head/sys/netgraph/ng_tee.c ============================================================================== --- head/sys/netgraph/ng_tee.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_tee.c Fri Apr 29 21:25:05 2016 (r298813) @@ -168,7 +168,7 @@ ng_tee_newhook(node_p node, hook_p hook, sc_p privdata = NG_NODE_PRIVATE(node); hi_p hinfo; - /* Precalculate internal pathes. */ + /* Precalculate internal paths. */ if (strcmp(name, NG_TEE_HOOK_RIGHT) == 0) { hinfo = &privdata->right; if (privdata->left.dest) @@ -371,7 +371,7 @@ ng_tee_disconnect(hook_p hook) KASSERT(hinfo != NULL, ("%s: null info", __func__)); hinfo->hook = NULL; - /* Recalculate internal pathes. */ + /* Recalculate internal paths. */ if (sc->left.dest == hinfo) { sc->left.dest = sc->left.dup; sc->left.dup = NULL; Modified: head/sys/netgraph/ng_tty.c ============================================================================== --- head/sys/netgraph/ng_tty.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_tty.c Fri Apr 29 21:25:05 2016 (r298813) @@ -190,7 +190,7 @@ ngt_newhook(node_p node, hook_p hook, co /* * Set the hook into queueing mode (for outgoing packets), - * so that we wont deliver mbuf thru the whole graph holding + * so that we wont deliver mbuf through the whole graph holding * tty locks. */ static int Modified: head/sys/netgraph/ng_vjc.c ============================================================================== --- head/sys/netgraph/ng_vjc.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_vjc.c Fri Apr 29 21:25:05 2016 (r298813) @@ -348,7 +348,7 @@ ng_vjc_rcvmsg(node_p node, item_p item, sl = (struct slcompress *)resp->data; *sl = *sl0; - /* Replace pointers with integer indicies */ + /* Replace pointers with integer indices */ if (sl->last_cs != NULL) { index = sl0->last_cs - sl0->tstate; bzero(&sl->last_cs, sizeof(sl->last_cs)); Modified: head/sys/netgraph/ng_vlan.c ============================================================================== --- head/sys/netgraph/ng_vlan.c Fri Apr 29 21:18:14 2016 (r298812) +++ head/sys/netgraph/ng_vlan.c Fri Apr 29 21:25:05 2016 (r298813) @@ -387,7 +387,7 @@ ng_vlan_rcvmsg(node_p node, item_p item, vlan_count ++; } - /* Allocate memory for responce. */ + /* Allocate memory for response. */ NG_MKRESPONSE(resp, msg, sizeof(*t) + vlan_count * sizeof(*t->filter), M_NOWAIT); if (resp == NULL) { @@ -395,7 +395,7 @@ ng_vlan_rcvmsg(node_p node, item_p item, break; } - /* Pack data to responce. */ + /* Pack data to response. */ t = (struct ng_vlan_table *)resp->data; t->n = 0; vf = &t->filter[0]; @@ -565,7 +565,7 @@ ng_vlan_rcvdata(hook_p hook, item_p item if (priv->vlan_hook[vid] != NULL) { /* - * VLAN filter: allways remove vlan tags and + * VLAN filter: always remove vlan tags and * decapsulate packet. */ dst_hook = priv->vlan_hook[vid]; From owner-svn-src-head@freebsd.org Fri Apr 29 21:29:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665A5B21669; Fri, 29 Apr 2016 21:29:38 +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 3827C14C8; Fri, 29 Apr 2016 21:29:38 +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 u3TLTbr5028893; Fri, 29 Apr 2016 21:29:37 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TLTb1u028892; Fri, 29 Apr 2016 21:29:37 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201604292129.u3TLTb1u028892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 29 Apr 2016 21:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298814 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 21:29:38 -0000 Author: asomers Date: Fri Apr 29 21:29:37 2016 New Revision: 298814 URL: https://svnweb.freebsd.org/changeset/base/298814 Log: Fix a use-after-free when "zpool import" fails clear vd->vdev_tsd in vdev_geom_close_locked instead of vdev_geom_detach. In the latter function, it would fail to happen in certain circumstances where cp->private was unset. Ideally, the latter should never happen, but it can happen when vdev open fails, or where spares are involved. MFC after: 4 weeks X-MFC-With: 298786 Sponsored by: Spectra Logic Corp Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Apr 29 21:25:05 2016 (r298813) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Apr 29 21:29:37 2016 (r298814) @@ -276,10 +276,6 @@ vdev_geom_detach(struct g_consumer *cp, cp->provider && cp->provider->name ? cp->provider->name : "NULL"); vd = cp->private; - if (vd != NULL) { - vd->vdev_tsd = NULL; - vd->vdev_delayed_close = B_FALSE; - } cp->private = NULL; gp = cp->geom; @@ -311,6 +307,8 @@ vdev_geom_close_locked(vdev_t *vd) g_topology_assert(); cp = vd->vdev_tsd; + vd->vdev_tsd = NULL; + vd->vdev_delayed_close = B_FALSE; if (cp == NULL) return; From owner-svn-src-head@freebsd.org Fri Apr 29 21:38:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C671B219A3; Fri, 29 Apr 2016 21:38:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 59F531D49; Fri, 29 Apr 2016 21:38:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TLcar5031972; Fri, 29 Apr 2016 21:38:36 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TLca8d031971; Fri, 29 Apr 2016 21:38:36 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604292138.u3TLca8d031971@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 29 Apr 2016 21:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298815 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 21:38:37 -0000 Author: avos Date: Fri Apr 29 21:38:36 2016 New Revision: 298815 URL: https://svnweb.freebsd.org/changeset/base/298815 Log: wpi: remove unused variable. Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Fri Apr 29 21:29:37 2016 (r298814) +++ head/sys/dev/wpi/if_wpi.c Fri Apr 29 21:38:36 2016 (r298815) @@ -2074,7 +2074,6 @@ wpi_tx_done(struct wpi_softc *sc, struct struct mbuf *m; struct ieee80211_node *ni; struct ieee80211vap *vap; - struct ieee80211com *ic; uint32_t status = le32toh(stat->status); int ackfailcnt = stat->ackfailcnt / WPI_NTRIES_DEFAULT; @@ -2094,7 +2093,6 @@ wpi_tx_done(struct wpi_softc *sc, struct m = data->m, data->m = NULL; ni = data->ni, data->ni = NULL; vap = ni->ni_vap; - ic = vap->iv_ic; /* * Update rate control statistics for the node. From owner-svn-src-head@freebsd.org Fri Apr 29 21:46:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4154B21CBA; Fri, 29 Apr 2016 21:46:44 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5B441432; Fri, 29 Apr 2016 21:46:44 +0000 (UTC) (envelope-from jmcneill@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TLkh84034971; Fri, 29 Apr 2016 21:46:43 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TLkhjL034970; Fri, 29 Apr 2016 21:46:43 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201604292146.u3TLkhjL034970@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Fri, 29 Apr 2016 21:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298816 - head/sys/dev/dwc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 21:46:44 -0000 Author: jmcneill Date: Fri Apr 29 21:46:43 2016 New Revision: 298816 URL: https://svnweb.freebsd.org/changeset/base/298816 Log: Set txbuf_map array size to TX_DESC_COUNT instead of RX_DESC_COUNT. Modified: head/sys/dev/dwc/if_dwcvar.h Modified: head/sys/dev/dwc/if_dwcvar.h ============================================================================== --- head/sys/dev/dwc/if_dwcvar.h Fri Apr 29 21:38:36 2016 (r298815) +++ head/sys/dev/dwc/if_dwcvar.h Fri Apr 29 21:46:43 2016 (r298816) @@ -90,7 +90,7 @@ struct dwc_softc { struct dwc_hwdesc *txdesc_ring; bus_addr_t txdesc_ring_paddr; bus_dma_tag_t txbuf_tag; - struct dwc_bufmap txbuf_map[RX_DESC_COUNT]; + struct dwc_bufmap txbuf_map[TX_DESC_COUNT]; uint32_t tx_idx_head; uint32_t tx_idx_tail; int txcount; From owner-svn-src-head@freebsd.org Fri Apr 29 21:54:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 941B8B21E88; Fri, 29 Apr 2016 21:54:29 +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 48F4D19C7; Fri, 29 Apr 2016 21:54:29 +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 u3TLsSOH037843; Fri, 29 Apr 2016 21:54:28 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TLsSdV037841; Fri, 29 Apr 2016 21:54:28 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292154.u3TLsSdV037841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 21:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298817 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 21:54:29 -0000 Author: pfg Date: Fri Apr 29 21:54:28 2016 New Revision: 298817 URL: https://svnweb.freebsd.org/changeset/base/298817 Log: sys/kern: spelling fixes. Mostly on comments but affects some debug messages. MFC after: 2 weeks Modified: head/sys/kern/vfs_bio.c head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Fri Apr 29 21:46:43 2016 (r298816) +++ head/sys/kern/vfs_bio.c Fri Apr 29 21:54:28 2016 (r298817) @@ -224,7 +224,7 @@ SYSCTL_INT(_vfs, OID_AUTO, getnewbufcall "Number of calls to getnewbuf"); static int getnewbufrestarts; SYSCTL_INT(_vfs, OID_AUTO, getnewbufrestarts, CTLFLAG_RW, &getnewbufrestarts, 0, - "Number of times getnewbuf has had to restart a buffer aquisition"); + "Number of times getnewbuf has had to restart a buffer acquisition"); static int mappingrestarts; SYSCTL_INT(_vfs, OID_AUTO, mappingrestarts, CTLFLAG_RW, &mappingrestarts, 0, "Number of times getblk has had to restart a buffer mapping for " @@ -975,7 +975,7 @@ kern_vfs_bio_buffer_alloc(caddr_t v, lon else bio_transient_maxcnt = biotmap_sz / MAXPHYS; /* - * Artifically limit to 1024 simultaneous in-flight I/Os + * Artificially limit to 1024 simultaneous in-flight I/Os * using the transient mapping. */ if (bio_transient_maxcnt > 1024) @@ -1084,7 +1084,7 @@ bufinit(void) maxbufmallocspace = hibufspace / 20; /* - * Reduce the chance of a deadlock occuring by limiting the number + * Reduce the chance of a deadlock occurring by limiting the number * of delayed-write dirty buffers we allow to stack up. */ hidirtybuffers = nbuf / 4 + 20; @@ -3470,7 +3470,7 @@ has_addr: * to clear B_INVAL. If the caller does this without issuing an I/O, * the caller should set B_CACHE ( as an optimization ), else the caller * should issue the I/O and biodone() will set B_CACHE if the I/O was - * a write attempt or if it was a successfull read. If the caller + * a write attempt or if it was a successful read. If the caller * intends to issue a READ, the caller must clear B_INVAL and BIO_ERROR * prior to issuing the READ. biodone() will *not* clear B_INVAL. */ @@ -3582,7 +3582,7 @@ loop: bp_unmapped_get_kva(bp, blkno, size, flags); /* - * If the size is inconsistant in the VMIO case, we can resize + * If the size is inconsistent in the VMIO case, we can resize * the buffer. This might lead to B_CACHE getting set or * cleared. If the size has not changed, B_CACHE remains * unchanged from its previous state. @@ -3844,7 +3844,7 @@ vfs_nonvmio_extend(struct buf *bp, int n * resize a buffer up or down. * * Note that this code is tricky, and has many complications to resolve - * deadlock or inconsistant data situations. Tread lightly!!! + * deadlock or inconsistent data situations. Tread lightly!!! * There are B_CACHE and B_DELWRI interactions that must be dealt with by * the caller. Calling this code willy nilly can result in the loss of data. * @@ -4004,11 +4004,11 @@ bufwait(struct buf *bp) * assuming B_INVAL is clear. * * For the VMIO case, we set B_CACHE if the op was a read and no - * read error occured, or if the op was a write. B_CACHE is never + * read error occurred, or if the op was a write. B_CACHE is never * set if the buffer is invalid or otherwise uncacheable. * * biodone does not mess with B_INVAL, allowing the I/O routine or the - * initiator to leave B_INVAL set to brelse the buffer out of existance + * initiator to leave B_INVAL set to brelse the buffer out of existence * in the biodone routine. */ void @@ -4053,7 +4053,7 @@ bufdone_finish(struct buf *bp) if (bp->b_flags & B_VMIO) { /* * Set B_CACHE if the op was a normal read and no error - * occured. B_CACHE is set for writes in the b*write() + * occurred. B_CACHE is set for writes in the b*write() * routines. */ if (bp->b_iocmd == BIO_READ && @@ -4081,7 +4081,7 @@ bufdone_finish(struct buf *bp) /* * This routine is called in lieu of iodone in the case of * incomplete I/O. This keeps the busy status for pages - * consistant. + * consistent. */ void vfs_unbusy_pages(struct buf *bp) @@ -4160,7 +4160,7 @@ vfs_page_set_validclean(struct buf *bp, /* * Start and end offsets in buffer. eoff - soff may not cross a - * page boundry or cross the end of the buffer. The end of the + * page boundary or cross the end of the buffer. The end of the * buffer, in this case, is our file EOF, not the allocation size * of the buffer. */ @@ -4217,10 +4217,10 @@ vfs_drain_busy_pages(struct buf *bp) * progress, and treat the pages associated with the buffer * almost as being exclusive busy. Also the object paging_in_progress * flag is handled to make sure that the object doesn't become - * inconsistant. + * inconsistent. * * Since I/O has not been initiated yet, certain buffer flags - * such as BIO_ERROR or B_INVAL may be in an inconsistant state + * such as BIO_ERROR or B_INVAL may be in an inconsistent state * and should be ignored. */ void Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Apr 29 21:46:43 2016 (r298816) +++ head/sys/kern/vfs_vnops.c Fri Apr 29 21:54:28 2016 (r298817) @@ -1537,7 +1537,7 @@ _vn_lock(struct vnode *vp, int flags, ch error = VOP_LOCK1(vp, flags, file, line); flags &= ~LK_INTERLOCK; /* Interlock is always dropped. */ KASSERT((flags & LK_RETRY) == 0 || error == 0, - ("LK_RETRY set with incompatible flags (0x%x) or an error occured (%d)", + ("LK_RETRY set with incompatible flags (0x%x) or an error occurred (%d)", flags, error)); /* * Callers specify LK_RETRY if they wish to get dead vnodes. From owner-svn-src-head@freebsd.org Fri Apr 29 22:14:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D39DB2134D; Fri, 29 Apr 2016 22:14:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D327165C; Fri, 29 Apr 2016 22:14:14 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TMEDX5044238; Fri, 29 Apr 2016 22:14:13 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TMEBNV044218; Fri, 29 Apr 2016 22:14:11 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604292214.u3TMEBNV044218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 29 Apr 2016 22:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298818 - in head/sys: dev/bwi dev/if_ndis dev/iwi dev/malo dev/otus dev/ral dev/rtwn dev/urtwn dev/usb/wlan net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 22:14:14 -0000 Author: avos Date: Fri Apr 29 22:14:11 2016 New Revision: 298818 URL: https://svnweb.freebsd.org/changeset/base/298818 Log: net80211 + drivers: hide size of 'bands' array behind a macro. Auto-replace 'howmany(IEEE80211_MODE_MAX, 8)' with 'IEEE80211_MODE_BYTES'. No functional changes. Modified: head/sys/dev/bwi/if_bwi.c head/sys/dev/if_ndis/if_ndis.c head/sys/dev/iwi/if_iwi.c head/sys/dev/malo/if_malo.c head/sys/dev/otus/if_otus.c head/sys/dev/ral/rt2560.c head/sys/dev/ral/rt2661.c head/sys/dev/ral/rt2860.c head/sys/dev/rtwn/if_rtwn.c head/sys/dev/urtwn/if_urtwn.c head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_zyd.c head/sys/net80211/_ieee80211.h Modified: head/sys/dev/bwi/if_bwi.c ============================================================================== --- head/sys/dev/bwi/if_bwi.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/bwi/if_bwi.c Fri Apr 29 22:14:11 2016 (r298818) @@ -356,7 +356,7 @@ bwi_attach(struct bwi_softc *sc) device_t dev = sc->sc_dev; struct bwi_mac *mac; struct bwi_phy *phy; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int i, error; BWI_LOCK_INIT(sc); Modified: head/sys/dev/if_ndis/if_ndis.c ============================================================================== --- head/sys/dev/if_ndis/if_ndis.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/if_ndis/if_ndis.c Fri Apr 29 22:14:11 2016 (r298818) @@ -725,7 +725,7 @@ ndis_80211attach(struct ndis_softc *sc) struct ndis_80211_nettype_list *ntl; uint32_t arg; int mode, i, r, len, nonettypes = 1; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)] = { 0 }; + uint8_t bands[IEEE80211_MODE_BYTES] = { 0 }; callout_init(&sc->ndis_scan_callout, 1); Modified: head/sys/dev/iwi/if_iwi.c ============================================================================== --- head/sys/dev/iwi/if_iwi.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/iwi/if_iwi.c Fri Apr 29 22:14:11 2016 (r298818) @@ -271,7 +271,7 @@ iwi_attach(device_t dev) struct iwi_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint16_t val; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int i, error; sc->sc_dev = dev; Modified: head/sys/dev/malo/if_malo.c ============================================================================== --- head/sys/dev/malo/if_malo.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/malo/if_malo.c Fri Apr 29 22:14:11 2016 (r298818) @@ -174,7 +174,7 @@ malo_attach(uint16_t devid, struct malo_ struct ieee80211com *ic = &sc->malo_ic; struct malo_hal *mh; int error; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; MALO_LOCK_INIT(sc); callout_init_mtx(&sc->malo_watchdog_timer, &sc->malo_mtx, 0); Modified: head/sys/dev/otus/if_otus.c ============================================================================== --- head/sys/dev/otus/if_otus.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/otus/if_otus.c Fri Apr 29 22:14:11 2016 (r298818) @@ -624,7 +624,7 @@ otus_attachhook(struct otus_softc *sc) struct ieee80211com *ic = &sc->sc_ic; usb_device_request_t req; uint32_t in, out; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error; /* Not locked */ Modified: head/sys/dev/ral/rt2560.c ============================================================================== --- head/sys/dev/ral/rt2560.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/ral/rt2560.c Fri Apr 29 22:14:11 2016 (r298818) @@ -199,7 +199,7 @@ rt2560_attach(device_t dev, int id) { struct rt2560_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error; sc->sc_dev = dev; Modified: head/sys/dev/ral/rt2661.c ============================================================================== --- head/sys/dev/ral/rt2661.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/ral/rt2661.c Fri Apr 29 22:14:11 2016 (r298818) @@ -199,7 +199,7 @@ rt2661_attach(device_t dev, int id) struct rt2661_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t val; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error, ac, ntries; sc->sc_id = id; Modified: head/sys/dev/ral/rt2860.c ============================================================================== --- head/sys/dev/ral/rt2860.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/ral/rt2860.c Fri Apr 29 22:14:11 2016 (r298818) @@ -232,7 +232,7 @@ rt2860_attach(device_t dev, int id) struct rt2860_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t tmp; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error, ntries, qid; sc->sc_dev = dev; Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/rtwn/if_rtwn.c Fri Apr 29 22:14:11 2016 (r298818) @@ -251,7 +251,7 @@ rtwn_attach(device_t dev) struct rtwn_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; uint32_t lcsr; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int i, count, error, rid; sc->sc_dev = dev; Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/urtwn/if_urtwn.c Fri Apr 29 22:14:11 2016 (r298818) @@ -490,7 +490,7 @@ urtwn_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct urtwn_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; int error; device_set_usb_desc(self); Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/usb/wlan/if_rsu.c Fri Apr 29 22:14:11 2016 (r298818) @@ -404,7 +404,7 @@ rsu_attach(device_t self) struct rsu_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; int error; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; struct usb_interface *iface; const char *rft; Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/usb/wlan/if_rum.c Fri Apr 29 22:14:11 2016 (r298818) @@ -477,7 +477,7 @@ rum_attach(device_t self) struct rum_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; uint32_t tmp; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int error, ntries; Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/usb/wlan/if_run.c Fri Apr 29 22:14:11 2016 (r298818) @@ -704,7 +704,7 @@ run_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct ieee80211com *ic = &sc->sc_ic; uint32_t ver; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int ntries, error; Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/usb/wlan/if_uath.c Fri Apr 29 22:14:11 2016 (r298818) @@ -328,7 +328,7 @@ uath_attach(device_t dev) struct uath_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index = UATH_IFACE_INDEX; /* XXX */ usb_error_t error; Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/usb/wlan/if_upgt.c Fri Apr 29 22:14:11 2016 (r298818) @@ -243,7 +243,7 @@ upgt_attach(device_t dev) struct upgt_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; struct usb_attach_arg *uaa = device_get_ivars(dev); - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index = UPGT_IFACE_INDEX; int error; Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/usb/wlan/if_ural.c Fri Apr 29 22:14:11 2016 (r298818) @@ -424,7 +424,7 @@ ural_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct ural_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int error; Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/usb/wlan/if_urtw.c Fri Apr 29 22:14:11 2016 (r298818) @@ -785,7 +785,7 @@ urtw_attach(device_t dev) struct urtw_softc *sc = device_get_softc(dev); struct usb_attach_arg *uaa = device_get_ivars(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index = URTW_IFACE_INDEX; /* XXX */ uint16_t n_setup; uint32_t data; Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/dev/usb/wlan/if_zyd.c Fri Apr 29 22:14:11 2016 (r298818) @@ -334,7 +334,7 @@ zyd_attach(device_t dev) struct usb_attach_arg *uaa = device_get_ivars(dev); struct zyd_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; - uint8_t bands[howmany(IEEE80211_MODE_MAX, 8)]; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t iface_index; int error; Modified: head/sys/net80211/_ieee80211.h ============================================================================== --- head/sys/net80211/_ieee80211.h Fri Apr 29 21:54:28 2016 (r298817) +++ head/sys/net80211/_ieee80211.h Fri Apr 29 22:14:11 2016 (r298818) @@ -70,6 +70,7 @@ enum ieee80211_phymode { IEEE80211_MODE_QUARTER = 11, /* OFDM, 1/4x clock */ }; #define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) +#define IEEE80211_MODE_BYTES 2 /* howmany(IEEE80211_MODE_MAX, NBBY) */ /* * Operating mode. Devices do not necessarily support From owner-svn-src-head@freebsd.org Fri Apr 29 22:15:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E22CFB213B6; Fri, 29 Apr 2016 22:15:38 +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 8314317E3; Fri, 29 Apr 2016 22:15:38 +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 u3TMFbIm044370; Fri, 29 Apr 2016 22:15:37 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TMFXeO044326; Fri, 29 Apr 2016 22:15:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604292215.u3TMFXeO044326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 29 Apr 2016 22:15:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298819 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 22:15:39 -0000 Author: pfg Date: Fri Apr 29 22:15:33 2016 New Revision: 298819 URL: https://svnweb.freebsd.org/changeset/base/298819 Log: sys/kern: spelling fixes in comments. No functional change. Modified: head/sys/kern/bus_if.m head/sys/kern/imgact_binmisc.c head/sys/kern/inflate.c head/sys/kern/kern_condvar.c head/sys/kern/kern_descrip.c head/sys/kern/kern_exec.c head/sys/kern/kern_fork.c head/sys/kern/kern_jail.c head/sys/kern/kern_linker.c head/sys/kern/kern_lock.c head/sys/kern/kern_lockf.c head/sys/kern/kern_mbuf.c head/sys/kern/kern_mtxpool.c head/sys/kern/kern_prot.c head/sys/kern/kern_rctl.c head/sys/kern/kern_rmlock.c head/sys/kern/kern_sysctl.c head/sys/kern/kern_tc.c head/sys/kern/kern_timeout.c head/sys/kern/link_elf_obj.c head/sys/kern/linker_if.m head/sys/kern/sched_4bsd.c head/sys/kern/subr_blist.c head/sys/kern/subr_bus.c head/sys/kern/subr_devstat.c head/sys/kern/subr_intr.c head/sys/kern/subr_mbpool.c head/sys/kern/subr_mchain.c head/sys/kern/subr_msgbuf.c head/sys/kern/subr_prof.c head/sys/kern/subr_scanf.c head/sys/kern/subr_uio.c head/sys/kern/subr_witness.c head/sys/kern/sysv_sem.c head/sys/kern/tty.c head/sys/kern/tty_pts.c head/sys/kern/uipc_mbuf2.c head/sys/kern/uipc_socket.c head/sys/kern/vfs_cache.c head/sys/kern/vfs_cluster.c head/sys/kern/vfs_lookup.c head/sys/kern/vfs_mountroot.c head/sys/kern/vfs_subr.c head/sys/kern/vnode_if.src Modified: head/sys/kern/bus_if.m ============================================================================== --- head/sys/kern/bus_if.m Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/bus_if.m Fri Apr 29 22:15:33 2016 (r298819) @@ -121,7 +121,7 @@ METHOD void probe_nomatch { * @param _child the child device whose instance variable is * being read * @param _index the instance variable to read - * @param _result a loction to recieve the instance variable + * @param _result a location to receive the instance variable * value * * @retval 0 success @@ -389,7 +389,7 @@ METHOD int release_resource { * triggers * @param _arg a value to use as the single argument in calls * to @p _intr - * @param _cookiep a pointer to a location to recieve a cookie + * @param _cookiep a pointer to a location to receive a cookie * value that may be used to remove the interrupt * handler */ @@ -460,9 +460,9 @@ METHOD int set_resource { * @param _child the device which owns the resource * @param _type the type of resource * @param _rid the resource identifier - * @param _start the address of a location to recieve the start + * @param _start the address of a location to receive the start * index of the resource range - * @param _count the address of a location to recieve the size + * @param _count the address of a location to receive the size * of the resource range */ METHOD int get_resource { Modified: head/sys/kern/imgact_binmisc.c ============================================================================== --- head/sys/kern/imgact_binmisc.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/imgact_binmisc.c Fri Apr 29 22:15:33 2016 (r298819) @@ -700,7 +700,7 @@ imgact_binmisc_exec(struct image_params break; case ' ': - /* Replace space with NUL to seperate arguments. */ + /* Replace space with NUL to separate arguments. */ *d++ = '\0'; break; Modified: head/sys/kern/inflate.c ============================================================================== --- head/sys/kern/inflate.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/inflate.c Fri Apr 29 22:15:33 2016 (r298819) @@ -206,7 +206,7 @@ extern void kzipfree (void*); end-of-block. Note however that the static length tree defines 288 codes just to fill out the Huffman codes. Codes 286 and 287 cannot be used though, since there is no length base or extra bits - defined for them. Similarily, there are up to 30 distance codes. + defined for them. Similarly, there are up to 30 distance codes. However, static trees define 32 codes (all 5 bits) to fill out the Huffman codes, but the last two had better not show up in the data. 7. Unzip can check dynamic Huffman blocks for complete code sets. @@ -335,7 +335,7 @@ static const ush mask[] = { where NEEDBITS makes sure that b has at least j bits in it, and DUMPBITS removes the bits from b. The macros use the variable k for the number of bits in b. Normally, b and k are register - variables for speed, and are initialized at the begining of a + variables for speed, and are initialized at the beginning of a routine that uses these macros from a global bit buffer and count. In order to not ask for more bits than there are in the compressed Modified: head/sys/kern/kern_condvar.c ============================================================================== --- head/sys/kern/kern_condvar.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_condvar.c Fri Apr 29 22:15:33 2016 (r298819) @@ -156,7 +156,7 @@ _cv_wait(struct cv *cvp, struct lock_obj /* * Wait on a condition variable. This function differs from cv_wait by - * not aquiring the mutex after condition variable was signaled. + * not acquiring the mutex after condition variable was signaled. */ void _cv_wait_unlock(struct cv *cvp, struct lock_object *lock) Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_descrip.c Fri Apr 29 22:15:33 2016 (r298819) @@ -1530,7 +1530,7 @@ fdgrowtable_exp(struct filedesc *fdp, in } /* - * Grow the file table to accomodate (at least) nfd descriptors. + * Grow the file table to accommodate (at least) nfd descriptors. */ static void fdgrowtable(struct filedesc *fdp, int nfd) @@ -1544,7 +1544,7 @@ fdgrowtable(struct filedesc *fdp, int nf /* * If lastfile is -1 this struct filedesc was just allocated and we are - * growing it to accomodate for the one we are going to copy from. There + * growing it to accommodate for the one we are going to copy from. There * is no need to have a lock on this one as it's not visible to anyone. */ if (fdp->fd_lastfile != -1) @@ -1709,7 +1709,7 @@ fdallocn(struct thread *td, int minfd, i } /* - * Create a new open file structure and allocate a file decriptor for the + * Create a new open file structure and allocate a file descriptor for the * process that refers to it. We add one reference to the file for the * descriptor table and one reference for resultfp. This is to prevent us * being preempted and the entry in the descriptor table closed after we @@ -2535,7 +2535,7 @@ fget_unlocked(struct filedesc *fdp, int * * File's rights will be checked against the capability rights mask. * - * If an error occured the non-zero error is returned and *fpp is set to + * If an error occurred the non-zero error is returned and *fpp is set to * NULL. Otherwise *fpp is held and set and zero is returned. Caller is * responsible for fdrop(). */ Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_exec.c Fri Apr 29 22:15:33 2016 (r298819) @@ -413,7 +413,7 @@ do_execve(td, args, mac_p) /* * Translate the file name. namei() returns a vnode pointer - * in ni_vp amoung other things. + * in ni_vp among other things. * * XXXAUDIT: It would be desirable to also audit the name of the * interpreter if this is an interpreted binary. Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_fork.c Fri Apr 29 22:15:33 2016 (r298819) @@ -918,7 +918,7 @@ fork1(struct thread *td, struct fork_req /* * The swap reservation failed. The accounting * from the entries of the copied vm2 will be - * substracted in vmspace_free(), so force the + * subtracted in vmspace_free(), so force the * reservation there. */ swap_reserve_force(mem_charged); Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_jail.c Fri Apr 29 22:15:33 2016 (r298819) @@ -4039,7 +4039,7 @@ prison_priv_check(struct ucred *cred, in return (0); /* - * Allow jailed root to set certian IPv4/6 (option) headers. + * Allow jailed root to set certain IPv4/6 (option) headers. */ case PRIV_NETINET_SETHDROPTS: return (0); @@ -4280,7 +4280,7 @@ SYSCTL_UINT(_security_jail, OID_AUTO, ja #endif /* - * Default parameters for jail(2) compatability. For historical reasons, + * Default parameters for jail(2) compatibility. For historical reasons, * the sysctl names have varying similarity to the parameter names. Prisons * just see their own parameters, and can't change them. */ Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_linker.c Fri Apr 29 22:15:33 2016 (r298819) @@ -949,7 +949,7 @@ linker_debug_search_symbol_name(caddr_t * * Note that we do not obey list locking protocols here. We really don't need * DDB to hang because somebody's got the lock held. We'll take the chance - * that the files list is inconsistant instead. + * that the files list is inconsistent instead. */ #ifdef DDB int @@ -2037,7 +2037,7 @@ linker_load_dependencies(linker_file_t l int ver, error = 0, count; /* - * All files are dependant on /kernel. + * All files are dependent on /kernel. */ sx_assert(&kld_sx, SA_XLOCKED); if (linker_kernel_file) { Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_lock.c Fri Apr 29 22:15:33 2016 (r298819) @@ -281,7 +281,7 @@ wakeupshlk(struct lock *lk, const char * * exclusive waiters bit anyway. * Please note that lk_exslpfail count may be lying about * the real number of waiters with the LK_SLEEPFAIL flag on - * because they may be used in conjuction with interruptible + * because they may be used in conjunction with interruptible * sleeps so lk_exslpfail might be considered an 'upper limit' * bound, including the edge cases. */ @@ -1058,7 +1058,7 @@ __lockmgr_args(struct lock *lk, u_int fl * Please note that lk_exslpfail count may be lying * about the real number of waiters with the * LK_SLEEPFAIL flag on because they may be used in - * conjuction with interruptible sleeps so + * conjunction with interruptible sleeps so * lk_exslpfail might be considered an 'upper limit' * bound, including the edge cases. */ @@ -1171,7 +1171,7 @@ __lockmgr_args(struct lock *lk, u_int fl * Please note that lk_exslpfail count may be * lying about the real number of waiters with * the LK_SLEEPFAIL flag on because they may - * be used in conjuction with interruptible + * be used in conjunction with interruptible * sleeps so lk_exslpfail might be considered * an 'upper limit' bound, including the edge * cases. Modified: head/sys/kern/kern_lockf.c ============================================================================== --- head/sys/kern/kern_lockf.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_lockf.c Fri Apr 29 22:15:33 2016 (r298819) @@ -362,7 +362,7 @@ lf_free_lock(struct lockf_entry *lock) struct lock_owner *lo = lock->lf_owner; if (lo) { KASSERT(LIST_EMPTY(&lock->lf_outedges), - ("freeing lock with dependancies")); + ("freeing lock with dependencies")); KASSERT(LIST_EMPTY(&lock->lf_inedges), ("freeing lock with dependants")); sx_xlock(&lf_lock_owners_lock); @@ -827,7 +827,7 @@ lf_purgelocks(struct vnode *vp, struct l /* * We can just free all the active locks since they - * will have no dependancies (we removed them all + * will have no dependencies (we removed them all * above). We don't need to bother locking since we * are the last thread using this state structure. */ @@ -1112,7 +1112,7 @@ lf_insert_lock(struct lockf *state, stru /* * Wake up a sleeping lock and remove it from the pending list now - * that all its dependancies have been resolved. The caller should + * that all its dependencies have been resolved. The caller should * arrange for the lock to be added to the active list, adjusting any * existing locks for the same owner as needed. */ @@ -1137,9 +1137,9 @@ lf_wakeup_lock(struct lockf *state, stru } /* - * Re-check all dependant locks and remove edges to locks that we no + * Re-check all dependent locks and remove edges to locks that we no * longer block. If 'all' is non-zero, the lock has been removed and - * we must remove all the dependancies, otherwise it has simply been + * we must remove all the dependencies, otherwise it has simply been * reduced but remains active. Any pending locks which have been been * unblocked are added to 'granted' */ @@ -1165,7 +1165,7 @@ lf_update_dependancies(struct lockf *sta } /* - * Set the start of an existing active lock, updating dependancies and + * Set the start of an existing active lock, updating dependencies and * adding any newly woken locks to 'granted'. */ static void @@ -1181,7 +1181,7 @@ lf_set_start(struct lockf *state, struct } /* - * Set the end of an existing active lock, updating dependancies and + * Set the end of an existing active lock, updating dependencies and * adding any newly woken locks to 'granted'. */ static void @@ -1204,7 +1204,7 @@ lf_set_end(struct lockf *state, struct l * pending locks as a result of downgrading/unlocking. We simply * activate the newly granted locks by looping. * - * Since the new lock already has its dependancies set up, we always + * Since the new lock already has its dependencies set up, we always * add it to the list (unless its an unlock request). This may * fragment the lock list in some pathological cases but its probably * not a real problem. @@ -1332,7 +1332,7 @@ lf_cancel_lock(struct lockf *state, stru * may allow some other pending lock to become * active. Consider this case: * - * Owner Action Result Dependancies + * Owner Action Result Dependencies * * A: lock [0..0] succeeds * B: lock [2..2] succeeds @@ -1840,7 +1840,7 @@ lf_split(struct lockf *state, struct loc /* * This cannot cause a deadlock since any edges we would add * to splitlock already exist in lock1. We must be sure to add - * necessary dependancies to splitlock before we reduce lock1 + * necessary dependencies to splitlock before we reduce lock1 * otherwise we may accidentally grant a pending lock that * was blocked by the tail end of lock1. */ Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_mbuf.c Fri Apr 29 22:15:33 2016 (r298819) @@ -92,7 +92,7 @@ __FBSDID("$FreeBSD$"); * * Whenever an object is allocated from the underlying global * memory pool it gets pre-initialized with the _zinit_ functions. - * When the Keg's are overfull objects get decomissioned with + * When the Keg's are overfull objects get decommissioned with * _zfini_ functions and free'd back to the global memory pool. * */ Modified: head/sys/kern/kern_mtxpool.c ============================================================================== --- head/sys/kern/kern_mtxpool.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_mtxpool.c Fri Apr 29 22:15:33 2016 (r298819) @@ -39,7 +39,7 @@ * * Disadvantages: * - should generally only be used as leaf mutexes. - * - pool/pool dependancy ordering cannot be depended on. + * - pool/pool dependency ordering cannot be depended on. * - possible L1 cache mastersip contention between cpus. */ Modified: head/sys/kern/kern_prot.c ============================================================================== --- head/sys/kern/kern_prot.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_prot.c Fri Apr 29 22:15:33 2016 (r298819) @@ -164,7 +164,7 @@ sys_getpgrp(struct thread *td, struct ge return (0); } -/* Get an arbitary pid's process group id */ +/* Get an arbitrary pid's process group id */ #ifndef _SYS_SYSPROTO_H_ struct getpgid_args { pid_t pid; @@ -195,7 +195,7 @@ sys_getpgid(struct thread *td, struct ge } /* - * Get an arbitary pid's session id. + * Get an arbitrary pid's session id. */ #ifndef _SYS_SYSPROTO_H_ struct getsid_args { Modified: head/sys/kern/kern_rctl.c ============================================================================== --- head/sys/kern/kern_rctl.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_rctl.c Fri Apr 29 22:15:33 2016 (r298819) @@ -444,7 +444,7 @@ rctl_pcpu_available(const struct proc *p /* * Return slightly less than actual value of the available - * %cpu resource. This makes %cpu throttling more agressive + * %cpu resource. This makes %cpu throttling more aggressive * and lets us act sooner than the limits are already exceeded. */ if (limit != 0) { Modified: head/sys/kern/kern_rmlock.c ============================================================================== --- head/sys/kern/kern_rmlock.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_rmlock.c Fri Apr 29 22:15:33 2016 (r298819) @@ -375,7 +375,7 @@ _rm_rlock_hard(struct rmlock *rm, struct } /* - * We allow readers to aquire a lock even if a writer is blocked if + * We allow readers to acquire a lock even if a writer is blocked if * the lock is recursive and the reader already holds the lock. */ if ((rm->lock_object.lo_flags & LO_RECURSABLE) != 0) { Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_sysctl.c Fri Apr 29 22:15:33 2016 (r298819) @@ -359,7 +359,7 @@ sysctl_register_oid(struct sysctl_oid *o * * NOTE: DO NOT change the starting value here, change it in * , and make sure it is at least 256 to - * accomodate e.g. net.inet.raw as a static sysctl node. + * accommodate e.g. net.inet.raw as a static sysctl node. */ if (oid_number < 0) { static int newoid; @@ -494,7 +494,7 @@ sysctl_ctx_free(struct sysctl_ctx_list * } /* * Restore deregistered entries, either from the end, - * or from the place where error occured. + * or from the place where error occurred. * e contains the entry that was not unregistered */ if (error) Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_tc.c Fri Apr 29 22:15:33 2016 (r298819) @@ -1898,7 +1898,7 @@ inittimecounter(void *dummy) * Set the initial timeout to * max(1, ). * People should probably not use the sysctl to set the timeout - * to smaller than its inital value, since that value is the + * to smaller than its initial value, since that value is the * smallest reasonable one. If they want better timestamps they * should use the non-"get"* functions. */ Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/kern_timeout.c Fri Apr 29 22:15:33 2016 (r298819) @@ -1446,7 +1446,7 @@ _callout_init_lock(struct callout *c, st * which set the timer can do the maintanence the timer was for as close * as possible to the originally intended time. Testing this code for a * week showed that resuming from a suspend resulted in 22 to 25 timers - * firing, which seemed independant on whether the suspend was 2 hours or + * firing, which seemed independent on whether the suspend was 2 hours or * 2 days. Your milage may vary. - Ken Key */ void Modified: head/sys/kern/link_elf_obj.c ============================================================================== --- head/sys/kern/link_elf_obj.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/link_elf_obj.c Fri Apr 29 22:15:33 2016 (r298819) @@ -1128,7 +1128,7 @@ relocate_file(elf_file_t ef) } /* - * Only clean SHN_FBSD_CACHED for successfull return. If we + * Only clean SHN_FBSD_CACHED for successful return. If we * modified symbol table for the object but found an * unresolved symbol, there is no reason to roll back. */ Modified: head/sys/kern/linker_if.m ============================================================================== --- head/sys/kern/linker_if.m Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/linker_if.m Fri Apr 29 22:15:33 2016 (r298819) @@ -89,7 +89,7 @@ METHOD int lookup_set { }; # -# Unload a file, releasing dependancies and freeing storage. +# Unload a file, releasing dependencies and freeing storage. # METHOD void unload { linker_file_t file; Modified: head/sys/kern/sched_4bsd.c ============================================================================== --- head/sys/kern/sched_4bsd.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/sched_4bsd.c Fri Apr 29 22:15:33 2016 (r298819) @@ -1395,7 +1395,7 @@ sched_add(struct thread *td, int flags) * or kicking off another CPU as it won't help and may hinder. * In the YIEDLING case, we are about to run whoever is being * put in the queue anyhow, and in the OURSELF case, we are - * puting ourself on the run queue which also only happens + * putting ourself on the run queue which also only happens * when we are about to yield. */ if ((flags & SRQ_YIELDING) == 0) { Modified: head/sys/kern/subr_blist.c ============================================================================== --- head/sys/kern/subr_blist.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_blist.c Fri Apr 29 22:15:33 2016 (r298819) @@ -57,8 +57,8 @@ * The non-blocking features of the blist code are used in the swap code * (vm/swap_pager.c). * - * LAYOUT: The radix tree is layed out recursively using a - * linear array. Each meta node is immediately followed (layed out + * LAYOUT: The radix tree is laid out recursively using a + * linear array. Each meta node is immediately followed (laid out * sequentially in memory) by BLIST_META_RADIX lower level nodes. This * is a recursive structure but one that can be easily scanned through * a very simple 'skip' calculation. In order to support large radixes, Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_bus.c Fri Apr 29 22:15:33 2016 (r298819) @@ -4699,7 +4699,7 @@ root_setup_intr(device_t dev, device_t c } /* - * If we get here, assume that the device is permanant and really is + * If we get here, assume that the device is permanent and really is * present in the system. Removable bus drivers are expected to intercept * this call long before it gets here. We return -1 so that drivers that * really care can check vs -1 or some ERRNO returned higher in the food Modified: head/sys/kern/subr_devstat.c ============================================================================== --- head/sys/kern/subr_devstat.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_devstat.c Fri Apr 29 22:15:33 2016 (r298819) @@ -389,7 +389,7 @@ sysctl_devstat(SYSCTL_HANDLER_ARGS) * XXX devstat_generation should really be "volatile" but that * XXX freaks out the sysctl macro below. The places where we * XXX change it and inspect it are bracketed in the mutex which - * XXX guarantees us proper write barriers. I don't belive the + * XXX guarantees us proper write barriers. I don't believe the * XXX compiler is allowed to optimize mygen away across calls * XXX to other functions, so the following is belived to be safe. */ Modified: head/sys/kern/subr_intr.c ============================================================================== --- head/sys/kern/subr_intr.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_intr.c Fri Apr 29 22:15:33 2016 (r298819) @@ -705,7 +705,7 @@ intr_isrc_assign_cpu(void *arg, int cpu) * In NOCPU case, it's up to PIC to either leave ISRC on same CPU or * re-balance it to another CPU or enable it on more CPUs. However, * PIC is expected to change isrc_cpu appropriately to keep us well - * informed if the call is successfull. + * informed if the call is successful. */ if (irq_assign_cpu) { error = PIC_BIND_INTR(isrc->isrc_dev, isrc); @@ -1032,7 +1032,7 @@ intr_setup_irq(device_t dev, struct reso #ifdef INTR_SOLO /* - * Standard handling is done thru MI interrupt framework. However, + * Standard handling is done through MI interrupt framework. However, * some interrupts could request solely own special handling. This * non standard handling can be used for interrupt controllers without * handler (filter only), so in case that interrupt controllers are Modified: head/sys/kern/subr_mbpool.c ============================================================================== --- head/sys/kern/subr_mbpool.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_mbpool.c Fri Apr 29 22:15:33 2016 (r298819) @@ -288,7 +288,7 @@ mbp_ext_free(struct mbuf *m, void *buf, } /* - * Free all buffers that are marked as beeing on the card + * Free all buffers that are marked as being on the card */ void mbp_card_free(struct mbpool *p) Modified: head/sys/kern/subr_mchain.c ============================================================================== --- head/sys/kern/subr_mchain.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_mchain.c Fri Apr 29 22:15:33 2016 (r298819) @@ -102,7 +102,7 @@ mb_fixhdr(struct mbchain *mbp) /* * Check if object of size 'size' fit to the current position and * allocate new mbuf if not. Advance pointers and increase length of mbuf(s). - * Return pointer to the object placeholder or NULL if any error occured. + * Return pointer to the object placeholder or NULL if any error occurred. * Note: size should be <= MLEN */ caddr_t Modified: head/sys/kern/subr_msgbuf.c ============================================================================== --- head/sys/kern/subr_msgbuf.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_msgbuf.c Fri Apr 29 22:15:33 2016 (r298819) @@ -50,7 +50,7 @@ static u_int msgbuf_cksum(struct msgbuf /* * Timestamps in msgbuf are useful when trying to diagnose when core dumps - * or other actions occured. + * or other actions occurred. */ static int msgbuf_show_timestamp = 0; SYSCTL_INT(_kern, OID_AUTO, msgbuf_show_timestamp, CTLFLAG_RWTUN, Modified: head/sys/kern/subr_prof.c ============================================================================== --- head/sys/kern/subr_prof.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_prof.c Fri Apr 29 22:15:33 2016 (r298819) @@ -269,7 +269,7 @@ kmstartup(dummy) * without much risk of reducing the profiling times below what they * would be when profiling is not configured. Abbreviate: * ab = minimum time between MC1 and MC3 - * a = minumum time between MC1 and MC2 + * a = minimum time between MC1 and MC2 * b = minimum time between MC2 and MC3 * cd = minimum time between ME1 and ME3 * c = minimum time between ME1 and ME2 Modified: head/sys/kern/subr_scanf.c ============================================================================== --- head/sys/kern/subr_scanf.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_scanf.c Fri Apr 29 22:15:33 2016 (r298819) @@ -603,7 +603,7 @@ doswitch: * z', but treats `a-a' as `the letter a, the * character -, and the letter a'. * - * For compatibility, the `-' is not considerd + * For compatibility, the `-' is not considered * to define a range if the character following * it is either a close bracket (required by ANSI) * or is not numerically greater than the character Modified: head/sys/kern/subr_uio.c ============================================================================== --- head/sys/kern/subr_uio.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_uio.c Fri Apr 29 22:15:33 2016 (r298819) @@ -466,7 +466,7 @@ copyout_map(struct thread *td, vm_offset *addr = round_page((vm_offset_t)vms->vm_daddr + lim_max(td, RLIMIT_DATA)); - /* round size up to page boundry */ + /* round size up to page boundary */ size = (vm_size_t)round_page(sz); error = vm_mmap(&vms->vm_map, addr, size, VM_PROT_READ | VM_PROT_WRITE, Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/subr_witness.c Fri Apr 29 22:15:33 2016 (r298819) @@ -2971,7 +2971,7 @@ witness_lock_order_add(struct witness *p return (1); } -/* Call this whenver the structure of the witness graph changes. */ +/* Call this whenever the structure of the witness graph changes. */ static void witness_increment_graph_generation(void) { Modified: head/sys/kern/sysv_sem.c ============================================================================== --- head/sys/kern/sysv_sem.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/sysv_sem.c Fri Apr 29 22:15:33 2016 (r298819) @@ -1143,7 +1143,7 @@ sys_semop(struct thread *td, struct semo if ((error = sem_prison_cansee(rpr, semakptr)) != 0) goto done2; /* - * Initial pass thru sops to see what permissions are needed. + * Initial pass through sops to see what permissions are needed. * Also perform any checks that don't need repeating on each * attempt to satisfy the request vector. */ Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/tty.c Fri Apr 29 22:15:33 2016 (r298819) @@ -388,7 +388,7 @@ tty_wait_background(struct tty *tp, stru PROC_LOCK(p); /* * The process should only sleep, when: - * - This terminal is the controling terminal + * - This terminal is the controlling terminal * - Its process group is not the foreground process * group * - The parent process isn't waiting for the child to Modified: head/sys/kern/tty_pts.c ============================================================================== --- head/sys/kern/tty_pts.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/tty_pts.c Fri Apr 29 22:15:33 2016 (r298819) @@ -124,7 +124,7 @@ ptsdev_read(struct file *fp, struct uio /* * Implement packet mode. When packet mode is turned on, * the first byte contains a bitmask of events that - * occured (start, stop, flush, window size, etc). + * occurred (start, stop, flush, window size, etc). */ if (psc->pts_flags & PTS_PKT && psc->pts_pkt) { pkt = psc->pts_pkt; Modified: head/sys/kern/uipc_mbuf2.c ============================================================================== --- head/sys/kern/uipc_mbuf2.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/uipc_mbuf2.c Fri Apr 29 22:15:33 2016 (r298819) @@ -143,7 +143,7 @@ m_pulldown(struct mbuf *m, int off, int * Ideally, the requirement should only be (iii). * * If we're writable, we're sure we're writable, because the ref. count - * cannot increase from 1, as that would require posession of mbuf + * cannot increase from 1, as that would require possession of mbuf * n by someone else (which is impossible). However, if we're _not_ * writable, we may eventually become writable )if the ref. count drops * to 1), but we'll fail to notice it unless we re-evaluate Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/uipc_socket.c Fri Apr 29 22:15:33 2016 (r298819) @@ -194,7 +194,7 @@ VNET_DEFINE(struct hhook_head *, socket_ /* * Limit on the number of connections in the listen queue waiting * for accept(2). - * NB: The orginal sysctl somaxconn is still available but hidden + * NB: The original sysctl somaxconn is still available but hidden * to prevent confusion about the actual purpose of this number. */ static u_int somaxconn = SOMAXCONN; @@ -1164,7 +1164,7 @@ sosend_dgram(struct socket *so, struct s } /* * XXX all the SBS_CANTSENDMORE checks previously done could be out - * of date. We could have recieved a reset packet in an interrupt or + * of date. We could have received a reset packet in an interrupt or * maybe we slept while doing page faults in uiomove() etc. We could * probably recheck again inside the locking protection here, but * there are probably other places that this also happens. We must @@ -1347,7 +1347,7 @@ restart: } /* * XXX all the SBS_CANTSENDMORE checks previously - * done could be out of date. We could have recieved + * done could be out of date. We could have received * a reset packet in an interrupt or maybe we slept * while doing page faults in uiomove() etc. We * could probably recheck again inside the locking Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/vfs_cache.c Fri Apr 29 22:15:33 2016 (r298819) @@ -150,7 +150,7 @@ struct namecache_ts { */ /* - * Structures associated with name cacheing. + * Structures associated with name caching. */ #define NCHHASH(hash) \ (&nchashtbl[(hash) & nchash]) @@ -485,7 +485,7 @@ cache_zap(struct namecache *ncp) * cnp pointing to the name of the entry being sought. If the lookup * succeeds, the vnode is returned in *vpp, and a status of -1 is * returned. If the lookup determines that the name does not exist - * (negative cacheing), a status of ENOENT is returned. If the lookup + * (negative caching), a status of ENOENT is returned. If the lookup * fails, a status of zero is returned. If the directory vnode is * recycled out from under us due to a forced unmount, a status of * ENOENT is returned. Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/vfs_cluster.c Fri Apr 29 22:15:33 2016 (r298819) @@ -563,7 +563,7 @@ cluster_callback(bp) int error = 0; /* - * Must propogate errors to all the components. + * Must propagate errors to all the components. */ if (bp->b_ioflags & BIO_ERROR) error = bp->b_error; Modified: head/sys/kern/vfs_lookup.c ============================================================================== --- head/sys/kern/vfs_lookup.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/vfs_lookup.c Fri Apr 29 22:15:33 2016 (r298819) @@ -1154,7 +1154,7 @@ NDFREE(struct nameidata *ndp, const u_in * Determine if there is a suitable alternate filename under the specified * prefix for the specified path. If the create flag is set, then the * alternate prefix will be used so long as the parent directory exists. - * This is used by the various compatiblity ABIs so that Linux binaries prefer + * This is used by the various compatibility ABIs so that Linux binaries prefer * files under /compat/linux for example. The chosen path (whether under * the prefix or under /) is returned in a kernel malloc'd buffer pointed * to by pathbuf. The caller is responsible for free'ing the buffer from Modified: head/sys/kern/vfs_mountroot.c ============================================================================== --- head/sys/kern/vfs_mountroot.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/vfs_mountroot.c Fri Apr 29 22:15:33 2016 (r298819) @@ -79,7 +79,7 @@ __FBSDID("$FreeBSD$"); * * If the environment variable vfs.root.mountfrom is a space separated list, * each list element is tried in turn and the root filesystem will be mounted - * from the first one that suceeds. + * from the first one that succeeds. * * The environment variable vfs.root.mountfrom.options is a comma delimited * set of string mount options. These mount options must be parseable Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/vfs_subr.c Fri Apr 29 22:15:33 2016 (r298819) @@ -534,7 +534,7 @@ vfs_busy(struct mount *mp, int flags) MNT_ILOCK(mp); MNT_REF(mp); /* - * If mount point is currenly being unmounted, sleep until the + * If mount point is currently being unmounted, sleep until the * mount point fate is decided. If thread doing the unmounting fails, * it will clear MNTK_UNMOUNT flag before waking us up, indicating * that this mount point has survived the unmount attempt and vfs_busy @@ -830,7 +830,7 @@ vattr_null(struct vattr *vap) * the buffer cache may have references on the vnode, a directory * vnode may still have references due to the namei cache representing * underlying files, or the vnode may be in active use. It is not - * desireable to reuse such vnodes. These conditions may cause the + * desirable to reuse such vnodes. These conditions may cause the * number of vnodes to reach some minimum value regardless of what * you set kern.maxvnodes to. Do not set kern.maxvnodes too low. */ @@ -3945,7 +3945,7 @@ destroy_vpollinfo(struct vpollinfo *vi) } /* - * Initalize per-vnode helper structure to hold poll-related state. + * Initialize per-vnode helper structure to hold poll-related state. */ void v_addpollinfo(struct vnode *vp) @@ -4356,7 +4356,7 @@ extattr_check_cred(struct vnode *vp, int #ifdef DEBUG_VFS_LOCKS /* - * This only exists to supress warnings from unlocked specfs accesses. It is + * This only exists to suppress warnings from unlocked specfs accesses. It is * no longer ok to have an unlocked VFS. */ #define IGNORE_LOCK(vp) (panicstr != NULL || (vp) == NULL || \ Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri Apr 29 22:14:11 2016 (r298818) +++ head/sys/kern/vnode_if.src Fri Apr 29 22:15:33 2016 (r298819) @@ -35,7 +35,7 @@ # is a specification of the locking protocol used by each vop call. # The first column is the name of the variable, the remaining three # columns are in, out and error respectively. The "in" column defines -# the lock state on input, the "out" column defines the state on succesful +# the lock state on input, the "out" column defines the state on successful # return, and the "error" column defines the locking state on error exit. # # The locking value can take the following values: From owner-svn-src-head@freebsd.org Fri Apr 29 22:29:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09048B21628; Fri, 29 Apr 2016 22:29:35 +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 CE6051FB9; Fri, 29 Apr 2016 22:29:34 +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 u3TMTYrg048028; Fri, 29 Apr 2016 22:29:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TMTXV8048026; Fri, 29 Apr 2016 22:29:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604292229.u3TMTXV8048026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Apr 2016 22:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298820 - in head/sys: arm/conf powerpc/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 22:29:35 -0000 Author: jhb Date: Fri Apr 29 22:29:33 2016 New Revision: 298820 URL: https://svnweb.freebsd.org/changeset/base/298820 Log: Remove vestiges of IEEE-488/GPIB drivers removed in r276214. Modified: head/sys/arm/conf/NOTES head/sys/powerpc/conf/NOTES Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Fri Apr 29 22:15:33 2016 (r298819) +++ head/sys/arm/conf/NOTES Fri Apr 29 22:29:33 2016 (r298820) @@ -82,9 +82,7 @@ nodevice star_saver nodevice warp_saver nodevice cxgbe -nodevice pcii nodevice snd_cmi -nodevice tnt4882 # # Enable the kernel DTrace hooks which are required to load the DTrace Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Fri Apr 29 22:15:33 2016 (r298819) +++ head/sys/powerpc/conf/NOTES Fri Apr 29 22:29:33 2016 (r298820) @@ -96,9 +96,6 @@ nodevice warp_saver nodevice daemon_saver nodevice star_saver nodevice snake_saver -# isa -nodevice pcii -nodevice tnt4882 # sound nodevice snd_cmi # wants gdb_cur From owner-svn-src-head@freebsd.org Fri Apr 29 22:38:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFA27B217C4; Fri, 29 Apr 2016 22:38:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::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 9B21813C3; Fri, 29 Apr 2016 22:38:32 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22c.google.com with SMTP id u10so36598477igr.1; Fri, 29 Apr 2016 15:38:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=UE3rkAs/Lsl25gjHdK49T+EgHiMzCg755FnHh85jNF0=; b=vHGMH1D6c8pVNX5pCkbvNemdbe+FH1kx6swrUf1o0sveFy0IqAI7Z+mIJPct5JunHh EHGJD/sZ360AZ7UNIUdbz03B7P5fcR2teIqhi2vdruEtM1R9UHqtIWPqLbfdG9PVzv7t cT9k+Lncaep0BtWyf6zPCZwKru0rRXWfRz1nd+nYx6MAMEmmIeXyxFkFidBXEX4zsi09 yOrrTOWubTLkpIM7Z9MBCxr7OGaMelDtYLCDDwtFY228tKa6vVgzK3NT2ahXz+X9KL6b lmff9vohMR3HS9i3UhwZNX7IEZKSS9nl7RnaakumD8CuCi/QVhG7X5uc7TPRPf04Bsc8 zoaw== 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; bh=UE3rkAs/Lsl25gjHdK49T+EgHiMzCg755FnHh85jNF0=; b=Xf1CO1pw1rxDDjQqQbQgwGR3JmYafHxKjj540kfN2+YaT+PsUX4CEH84onzKuedpat T9mS+FWXXT6Xo5bCXkSrZ+vMVyluHvL9D6/jfGHTqts5d6f3dCqeGrJGBpNhP06Q0qs3 cdlCLBCSZNZk5GZNJdJTD+73UXnZzNhMo4HekXdX/kPVVwcvFh0Tu8bk1p4MXqwktXm9 DSCYwdM8/a79Ttub3X/os6BYyZSmbpJF+vijDRYt/8YqvTpwCsIFALctWALp12CH1rkc 3DwtILsFMx/9+zmqco9t3YW+pjun48h4l4ulyZbkoF16G31BsstVM5XIF8NsFDp6oEsp IkYg== X-Gm-Message-State: AOPr4FWmPVLtmjG0SeM2tymAu1ch0hkAxpoIsdUsfQHEp6AHgQK3+oHuubnVq3BEMdXlXG05bSzBFpYaLcm0Uw== MIME-Version: 1.0 X-Received: by 10.50.92.41 with SMTP id cj9mr7286717igb.22.1461969512175; Fri, 29 Apr 2016 15:38:32 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Fri, 29 Apr 2016 15:38:32 -0700 (PDT) In-Reply-To: <201604292214.u3TMEBNV044218@repo.freebsd.org> References: <201604292214.u3TMEBNV044218@repo.freebsd.org> Date: Fri, 29 Apr 2016 15:38:32 -0700 Message-ID: Subject: Re: svn commit: r298818 - in head/sys: dev/bwi dev/if_ndis dev/iwi dev/malo dev/otus dev/ral dev/rtwn dev/urtwn dev/usb/wlan net80211 From: Adrian Chadd To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 22:38:32 -0000 hi, you should likely keep this as a macro: #define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) +#define IEEE80211_MODE_BYTES 2 /* howmany(IEEE80211_MODE_MAX, NBBY) */ .. or as a runtime assert so when we add 11ac modes, we don't forget to bump that. :) -a From owner-svn-src-head@freebsd.org Fri Apr 29 22:43:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 039E5B21B5A; Fri, 29 Apr 2016 22:43:01 +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 B9E1E12A6; Fri, 29 Apr 2016 22:43:00 +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 u3TMh04B055217; Fri, 29 Apr 2016 22:43:00 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TMgxOh055205; Fri, 29 Apr 2016 22:42:59 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201604292242.u3TMgxOh055205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Fri, 29 Apr 2016 22:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298821 - in head/sys/boot: fdt uboot/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 22:43:01 -0000 Author: gonzo Date: Fri Apr 29 22:42:59 2016 New Revision: 298821 URL: https://svnweb.freebsd.org/changeset/base/298821 Log: Add FDT overlays support to ubldr FDT overlays is de-facto standard for describing expansion boards like Beaglebone capes or Raspberry Pi shields. The ides is to have basic DTB for base board and overlays DTB for shields/capes and to construct final DTB either using human-readable configuration or some self-discovery mechanism. I believe this approach can also be expanded to support dynamically loadable FPGA bitstreams on systems like Zedboard/Zybo. Overlaying process is simmilar to executable link process for binaries: each DTB has "exported" symbols and "undefined" symbols, the latter are resolved using information for the former obtained from base DTB or one of the overlays applied earlier (more rare case). This symbols information is not generated by standard dtc that FreeBSD has in base system, patched[1] version required to produces overlay-compatible blobs. So although DTB files generated by buildkernel do not support overlays there are enough vendor/community-provided DTB blobs ciruclating around to justify committing this change to ubldr. This commit introduces handler for "fdt_overlays" variable that can be defined either as a loader env variable or U-Boot env variable. fdt_overlays is comma-separated list of .dtbo files located in /boot/dtb/ directory along with base .dtb. ubldr loads files and applies them one-by-one to base .dtb and then passes result blob to the kernel. [1] https://github.com/RobertCNelson/dtc/commit/dd6a0533e846e8d5e690a618fa35cc15a6103efb Differential Revision: https://reviews.freebsd.org/D3180 Added: head/sys/boot/fdt/fdt_overlay.c (contents, props changed) head/sys/boot/fdt/fdt_overlay.h (contents, props changed) Modified: head/sys/boot/fdt/Makefile head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/fdt/fdt_platform.h head/sys/boot/uboot/fdt/uboot_fdt.c Modified: head/sys/boot/fdt/Makefile ============================================================================== --- head/sys/boot/fdt/Makefile Fri Apr 29 22:29:33 2016 (r298820) +++ head/sys/boot/fdt/Makefile Fri Apr 29 22:42:59 2016 (r298821) @@ -10,7 +10,7 @@ SRCS+= fdt.c fdt_ro.c fdt_wip.c fdt_sw. fdt_empty_tree.c # Loader's fdt commands extension sources. -SRCS+= fdt_loader_cmd.c +SRCS+= fdt_loader_cmd.c fdt_overlay.c CFLAGS+= -I${.CURDIR}/../../contrib/libfdt/ -I${.CURDIR}/../common/ Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Fri Apr 29 22:29:33 2016 (r298820) +++ head/sys/boot/fdt/fdt_loader_cmd.c Fri Apr 29 22:42:59 2016 (r298821) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "fdt_platform.h" +#include "fdt_overlay.h" #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ @@ -276,6 +277,128 @@ fdt_load_dtb_file(const char * filename) return (0); } +static int +fdt_load_dtb_overlay(const char * filename) +{ + struct preloaded_file *bfp, *oldbfp; + struct fdt_header header; + int err; + + debugf("fdt_load_dtb_overlay(%s)\n", filename); + + oldbfp = file_findfile(filename, "dtbo"); + + /* Attempt to load and validate a new dtb from a file. */ + if ((bfp = file_loadraw(filename, "dtbo", 1)) == NULL) { + printf("failed to load file '%s'\n", filename); + return (1); + } + + COPYOUT(bfp->f_addr, &header, sizeof(header)); + err = fdt_check_header(&header); + + if (err < 0) { + file_discard(bfp); + if (err == -FDT_ERR_BADVERSION) + printf("incompatible blob version: %d, should be: %d\n", + fdt_version(fdtp), FDT_LAST_SUPPORTED_VERSION); + + else + printf("error validating blob: %s\n", + fdt_strerror(err)); + return (1); + } + + /* A new dtb was validated, discard any previous file. */ + if (oldbfp) + file_discard(oldbfp); + + return (0); +} + +int +fdt_load_dtb_overlays(const char * filenames) +{ + char *names; + char *name; + char *comaptr; + + debugf("fdt_load_dtb_overlay(%s)\n", filenames); + + names = strdup(filenames); + if (names == NULL) + return (1); + name = names; + do { + comaptr = strchr(name, ','); + if (comaptr) + *comaptr = '\0'; + fdt_load_dtb_overlay(name); + name = comaptr + 1; + } while(comaptr); + + free(names); + return (0); +} + +void +fdt_apply_overlays() +{ + struct preloaded_file *fp; + size_t overlays_size, max_overlay_size, new_fdtp_size; + void *new_fdtp; + void *overlay; + int rv; + + if ((fdtp == NULL) || (fdtp_size == 0)) + return; + + overlays_size = 0; + max_overlay_size = 0; + for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { + if (max_overlay_size < fp->f_size) + max_overlay_size = fp->f_size; + overlays_size += fp->f_size; + } + + /* Nothing to apply */ + if (overlays_size == 0) + return; + + /* It's actually more than enough */ + new_fdtp_size = fdtp_size + overlays_size; + new_fdtp = malloc(new_fdtp_size); + if (new_fdtp == NULL) { + printf("failed to allocate memory for DTB blob with overlays\n"); + return; + } + + overlay = malloc(max_overlay_size); + if (overlay == NULL) { + printf("failed to allocate memory for DTB blob with overlays\n"); + free(new_fdtp); + return; + } + + rv = fdt_open_into(fdtp, new_fdtp, new_fdtp_size); + if (rv != 0) { + printf("failed to open DTB blob for applying overlays\n"); + return; + } + + for (fp = file_findfile(NULL, "dtbo"); fp != NULL; fp = fp->f_next) { + printf("applying DTB overlay '%s'\n", fp->f_name); + COPYOUT(fp->f_addr, overlay, fp->f_size); + fdt_overlay_apply(new_fdtp, overlay, fp->f_size); + } + + free(fdtp); + fdtp = new_fdtp; + fdtp_size = new_fdtp_size; + + free(overlay); +} + int fdt_setup_fdtp() { Added: head/sys/boot/fdt/fdt_overlay.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/fdt_overlay.c Fri Apr 29 22:42:59 2016 (r298821) @@ -0,0 +1,438 @@ +/*- + * 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$"); + +#include +#include + +#include "fdt_overlay.h" + +/* + * Get max phandle + */ +static uint32_t +fdt_max_phandle(void *fdtp) +{ + int o, depth; + uint32_t max_phandle, phandle; + + depth = 1; + o = fdt_path_offset(fdtp, "/"); + max_phandle = fdt_get_phandle(fdtp, o); + for (depth = 0; (o >= 0) && (depth >= 0); o = fdt_next_node(fdtp, o, &depth)) { + phandle = fdt_get_phandle(fdtp, o); + if (max_phandle < phandle) + max_phandle = phandle; + } + + return max_phandle; +} + +/* + * Returns exact memory location specified by fixup in format + * /path/to/node:property:offset + */ +static void * +fdt_get_fixup_location(void *fdtp, const char *fixup) +{ + char *path, *prop, *offsetp, *endp; + int prop_offset, o, proplen; + void *result; + + result = 0; + + path = strdup(fixup); + prop = strchr(path, ':'); + if (prop == NULL) { + printf("missing property part in \"%s\"\n", fixup); + result = NULL; + goto out; + } + + *prop = 0; + prop++; + + offsetp = strchr(prop, ':'); + if (offsetp == NULL) { + printf("missing offset part in \"%s\"\n", fixup); + result = NULL; + goto out; + } + + *offsetp = 0; + offsetp++; + + prop_offset = strtoul(offsetp, &endp, 10); + if (*endp != '\0') { + printf("\"%s\" is not valid number\n", offsetp); + result = NULL; + goto out; + } + + o = fdt_path_offset(fdtp, path); + if (o < 0) { + printf("path \"%s\" not found\n", path); + result = NULL; + goto out; + } + + result = fdt_getprop_w(fdtp, o, prop, &proplen); + if (result == NULL){ + printf("property \"%s\" not found in \"%s\" node\n", prop, path); + result = NULL; + goto out; + } + + if (proplen < prop_offset + sizeof(uint32_t)) { + printf("%s: property length is too small for fixup\n", fixup); + result = NULL; + goto out; + } + + result = (char*)result + prop_offset; + +out: + free(path); + return (result); +} + +/* + * Process one entry in __fixups__ { } node + * @fixups is property value, array of NUL-terminated strings + * with fixup locations + * @fixups_len length of the fixups array in bytes + * @phandle is value for these locations + */ +static int +fdt_do_one_fixup(void *fdtp, const char *fixups, int fixups_len, int phandle) +{ + void *fixup_pos; + uint32_t val; + + val = cpu_to_fdt32(phandle); + + while (fixups_len > 0) { + fixup_pos = fdt_get_fixup_location(fdtp, fixups); + if (fixup_pos != NULL) + memcpy(fixup_pos, &val, sizeof(val)); + + fixups_len -= strlen(fixups) + 1; + fixups += strlen(fixups) + 1; + } + + return (0); +} + +/* + * Increase u32 value at pos by offset + */ +static void +fdt_increase_u32(void *pos, uint32_t offset) +{ + uint32_t val; + + memcpy(&val, pos, sizeof(val)); + val = cpu_to_fdt32(fdt32_to_cpu(val) + offset); + memcpy(pos, &val, sizeof(val)); +} + +/* + * Process local fixups + * @fixups is property value, array of NUL-terminated strings + * with fixup locations + * @fixups_len length of the fixups array in bytes + * @offset value these locations should be increased by + */ +static int +fdt_do_local_fixup(void *fdtp, const char *fixups, int fixups_len, int offset) +{ + void *fixup_pos; + + while (fixups_len > 0) { + fixup_pos = fdt_get_fixup_location(fdtp, fixups); + if (fixup_pos != NULL) + fdt_increase_u32(fixup_pos, offset); + + fixups_len -= strlen(fixups) + 1; + fixups += strlen(fixups) + 1; + } + + return (0); +} + +/* + * Increase node phandle by phandle_offset + */ +static void +fdt_increase_phandle(void *fdtp, int node_offset, uint32_t phandle_offset) +{ + int proplen; + void *phandle_pos, *node_pos; + + node_pos = (char*)fdtp + node_offset; + + phandle_pos = fdt_getprop_w(fdtp, node_offset, "phandle", &proplen); + if (phandle_pos) + fdt_increase_u32(phandle_pos, phandle_offset); + phandle_pos = fdt_getprop_w(fdtp, node_offset, "linux,phandle", &proplen); + if (phandle_pos) + fdt_increase_u32(phandle_pos, phandle_offset); +} + +/* + * Increase all phandles by offset + */ +static void +fdt_increase_phandles(void *fdtp, uint32_t offset) +{ + int o, depth; + + o = fdt_path_offset(fdtp, "/"); + for (depth = 0; (o >= 0) && (depth >= 0); o = fdt_next_node(fdtp, o, &depth)) { + fdt_increase_phandle(fdtp, o, offset); + } +} + +/* + * Overlay one node defined by over + */ +static void +fdt_overlay_node(void *main_fdtp, int target_o, void *overlay_fdtp, int overlay_o) +{ + int len, o, depth; + const char *name; + const void *val; + int target_subnode_o; + + /* Overlay properties */ + for (o = fdt_first_property_offset(overlay_fdtp, overlay_o); + o >= 0; o = fdt_next_property_offset(overlay_fdtp, o)) { + val = fdt_getprop_by_offset(overlay_fdtp, o, &name, &len); + if (val) + fdt_setprop(main_fdtp, target_o, name, val, len); + } + + /* Now overlay nodes */ + o = overlay_o; + for (depth = 0; (o >= 0) && (depth >= 0); + o = fdt_next_node(overlay_fdtp, o, &depth)) { + if (depth != 1) + continue; + /* Check if there is node with the same name */ + name = fdt_get_name(overlay_fdtp, o, NULL); + target_subnode_o = fdt_subnode_offset(main_fdtp, target_o, name); + if (target_subnode_o < 0) { + /* create new subnode and run merge recursively */ + target_subnode_o = fdt_add_subnode(main_fdtp, target_o, name); + if (target_subnode_o < 0) { + printf("failed to create subnode \"%s\": %d\n", + name, target_subnode_o); + return; + } + } + + fdt_overlay_node(main_fdtp, target_subnode_o, + overlay_fdtp, o); + } +} + +/* + * Apply one overlay fragment + */ +static void +fdt_apply_fragment(void *main_fdtp, void *overlay_fdtp, int fragment_o) +{ + uint32_t target; + const char *target_path; + const void *val; + int target_node_o, overlay_node_o; + + target_node_o = -1; + val = fdt_getprop(overlay_fdtp, fragment_o, "target", NULL); + if (val) { + memcpy(&target, val, sizeof(target)); + target = fdt32_to_cpu(target); + target_node_o = fdt_node_offset_by_phandle(main_fdtp, target); + if (target_node_o < 0) { + printf("failed to find target %04x\n", target); + return; + } + } + + if (target_node_o < 0) { + target_path = fdt_getprop(overlay_fdtp, fragment_o, "target-path", NULL); + if (target_path == NULL) + return; + + target_node_o = fdt_path_offset(main_fdtp, target_path); + if (target_node_o < 0) { + printf("failed to find target-path %s\n", target_path); + return; + } + } + + if (target_node_o < 0) + return; + + overlay_node_o = fdt_subnode_offset(overlay_fdtp, fragment_o, "__overlay__"); + if (overlay_node_o < 0) { + printf("missing __overlay__ sub-node\n"); + return; + } + + fdt_overlay_node(main_fdtp, target_node_o, overlay_fdtp, overlay_node_o); +} + +/* + * Handle __fixups__ node in overlay DTB + */ +static int +fdt_overlay_do_fixups(void *main_fdtp, void *overlay_fdtp) +{ + int main_symbols_o, symbol_o, overlay_fixups_o; + int fixup_prop_o; + int len; + const char *fixups, *name; + const char *symbol_path; + uint32_t phandle; + + main_symbols_o = fdt_path_offset(main_fdtp, "/__symbols__"); + overlay_fixups_o = fdt_path_offset(overlay_fdtp, "/__fixups__"); + + if (main_symbols_o < 0) + return (-1); + if (overlay_fixups_o < 0) + return (-1); + + for (fixup_prop_o = fdt_first_property_offset(overlay_fdtp, overlay_fixups_o); + fixup_prop_o >= 0; + fixup_prop_o = fdt_next_property_offset(overlay_fdtp, fixup_prop_o)) { + fixups = fdt_getprop_by_offset(overlay_fdtp, fixup_prop_o, &name, &len); + symbol_path = fdt_getprop(main_fdtp, main_symbols_o, name, NULL); + if (symbol_path == NULL) { + printf("couldn't find \"%s\" symbol in main dtb\n", name); + return (-1); + } + symbol_o = fdt_path_offset(main_fdtp, symbol_path); + if (symbol_o < 0) { + printf("couldn't find \"%s\" path in main dtb\n", symbol_path); + return (-1); + } + phandle = fdt_get_phandle(main_fdtp, symbol_o); + if (fdt_do_one_fixup(overlay_fdtp, fixups, len, phandle) < 0) + return (-1); + } + + return (0); +} + +/* + * Handle __local_fixups__ node in overlay DTB + */ +static int +fdt_overlay_do_local_fixups(void *main_fdtp, void *overlay_fdtp) +{ + int overlay_local_fixups_o; + int len; + const char *fixups; + uint32_t phandle_offset; + + overlay_local_fixups_o = fdt_path_offset(overlay_fdtp, "/__local_fixups__"); + + if (overlay_local_fixups_o < 0) + return (-1); + + phandle_offset = fdt_max_phandle(main_fdtp); + fdt_increase_phandles(overlay_fdtp, phandle_offset); + fixups = fdt_getprop_w(overlay_fdtp, overlay_local_fixups_o, "fixup", &len); + if (fixups) { + if (fdt_do_local_fixup(overlay_fdtp, fixups, len, phandle_offset) < 0) + return (-1); + } + + return (0); +} + +/* + * Apply all fragments to main DTB + */ +static int +fdt_overlay_apply_fragments(void *main_fdtp, void *overlay_fdtp) +{ + int o, depth; + + o = fdt_path_offset(overlay_fdtp, "/"); + for (depth = 0; (o >= 0) && (depth >= 0); o = fdt_next_node(overlay_fdtp, o, &depth)) { + if (depth != 1) + continue; + + fdt_apply_fragment(main_fdtp, overlay_fdtp, o); + } + + return (0); +} + +int +fdt_overlay_apply(void *main_fdtp, void *overlay_fdtp, size_t overlay_length) +{ + void *overlay_copy; + int rv; + + rv = 0; + + /* We modify overlay in-place, so we need writable copy */ + overlay_copy = malloc(overlay_length); + if (overlay_copy == NULL) { + printf("failed to allocate memory for overlay copy\n"); + return (-1); + } + + memcpy(overlay_copy, overlay_fdtp, overlay_length); + + if (fdt_overlay_do_fixups(main_fdtp, overlay_copy) < 0) { + printf("failed to perform fixups in overlay\n"); + rv = -1; + goto out; + } + + if (fdt_overlay_do_local_fixups(main_fdtp, overlay_copy) < 0) { + printf("failed to perform local fixups in overlay\n"); + rv = -1; + goto out; + } + + if (fdt_overlay_apply_fragments(main_fdtp, overlay_copy) < 0) { + printf("failed to apply fragments\n"); + rv = -1; + } + +out: + free(overlay_copy); + + return (rv); +} Added: head/sys/boot/fdt/fdt_overlay.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/fdt/fdt_overlay.h Fri Apr 29 22:42:59 2016 (r298821) @@ -0,0 +1,34 @@ +/*- + * 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 FDT_OVERLAY_H +#define FDT_OVERLAY_H + +int fdt_overlay_apply(void *main_fdtp, void *overlay_fdtp, size_t overlay_length); + +#endif /* FDT_OVERLAY_H */ Modified: head/sys/boot/fdt/fdt_platform.h ============================================================================== --- head/sys/boot/fdt/fdt_platform.h Fri Apr 29 22:29:33 2016 (r298820) +++ head/sys/boot/fdt/fdt_platform.h Fri Apr 29 22:42:59 2016 (r298821) @@ -43,8 +43,10 @@ void fdt_fixup_cpubusfreqs(unsigned long void fdt_fixup_ethernet(const char *, char *, int); void fdt_fixup_memory(struct fdt_mem_region *, size_t); void fdt_fixup_stdout(const char *); +void fdt_apply_overlays(void); int fdt_load_dtb_addr(struct fdt_header *); int fdt_load_dtb_file(const char *); +int fdt_load_dtb_overlays(const char *); int fdt_setup_fdtp(void); /* The platform library needs to implement these functions */ Modified: head/sys/boot/uboot/fdt/uboot_fdt.c ============================================================================== --- head/sys/boot/uboot/fdt/uboot_fdt.c Fri Apr 29 22:29:33 2016 (r298820) +++ head/sys/boot/uboot/fdt/uboot_fdt.c Fri Apr 29 22:42:59 2016 (r298821) @@ -45,6 +45,7 @@ fdt_platform_load_dtb(void) struct fdt_header *hdr; const char *s; char *p; + int rv; /* * If the U-boot environment contains a variable giving the address of a @@ -68,6 +69,8 @@ fdt_platform_load_dtb(void) } } + rv = 1; + /* * Try to get FDT filename first from loader env and then from u-boot env */ @@ -79,11 +82,21 @@ fdt_platform_load_dtb(void) if (s != NULL && *s != '\0') { if (fdt_load_dtb_file(s) == 0) { printf("Loaded DTB from file '%s'.\n", s); - return (0); + rv = 0; } } - return (1); + if (rv == 0) { + s = getenv("fdt_overlays"); + if (s == NULL) + s = ub_env_get("fdt_overlays"); + if (s != NULL && *s != '\0') { + printf("Loading DTB overlays: '%s'\n", s); + fdt_load_dtb_overlays(s); + } + } + + return (rv); } void @@ -99,6 +112,9 @@ fdt_platform_fixups(void) eth_no = 0; ethstr = NULL; + /* Apply overlays before anything else */ + fdt_apply_overlays(); + /* Acquire sys_info */ si = ub_get_sys_info(); From owner-svn-src-head@freebsd.org Fri Apr 29 22:43:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B562B21BEA; Fri, 29 Apr 2016 22:43:13 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 093071747; Fri, 29 Apr 2016 22:43:12 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3TMhCVW055597; Fri, 29 Apr 2016 22:43:12 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TMhC8o055596; Fri, 29 Apr 2016 22:43:12 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201604292243.u3TMhC8o055596@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 29 Apr 2016 22:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298822 - head/sys/dev/wpi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 22:43:13 -0000 Author: avos Date: Fri Apr 29 22:43:11 2016 New Revision: 298822 URL: https://svnweb.freebsd.org/changeset/base/298822 Log: wpi: convert to ieee80211_add_channel() (mostly noop). Tested with Intel 3945BG, STA / HOSTAP modes. Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Fri Apr 29 22:42:59 2016 (r298821) +++ head/sys/dev/wpi/if_wpi.c Fri Apr 29 22:43:11 2016 (r298822) @@ -1412,9 +1412,18 @@ wpi_read_eeprom_band(struct wpi_softc *s { struct wpi_eeprom_chan *channels = sc->eeprom_channels[n]; const struct wpi_chan_band *band = &wpi_bands[n]; - struct ieee80211_channel *c; uint32_t nflags; + uint8_t bands[IEEE80211_MODE_BYTES]; uint8_t chan, i; + int error; + + memset(bands, 0, sizeof(bands)); + + if (n == 0) { + setbit(bands, IEEE80211_MODE_11B); + setbit(bands, IEEE80211_MODE_11G); + } else + setbit(bands, IEEE80211_MODE_11A); for (i = 0; i < band->nchan; i++) { if (!(channels[i].flags & WPI_EEPROM_CHAN_VALID)) { @@ -1424,45 +1433,19 @@ wpi_read_eeprom_band(struct wpi_softc *s continue; } - if (*nchans >= maxchans) - break; - chan = band->chan[i]; nflags = wpi_eeprom_channel_flags(&channels[i]); - - c = &chans[(*nchans)++]; - c->ic_ieee = chan; - c->ic_maxregpower = channels[i].maxpwr; - c->ic_maxpower = 2*c->ic_maxregpower; - - if (n == 0) { /* 2GHz band */ - c->ic_freq = ieee80211_ieee2mhz(chan, - IEEE80211_CHAN_G); - - /* G =>'s B is supported */ - c->ic_flags = IEEE80211_CHAN_B | nflags; - - if (*nchans >= maxchans) - break; - - c = &chans[(*nchans)++]; - c[0] = c[-1]; - c->ic_flags = IEEE80211_CHAN_G | nflags; - } else { /* 5GHz band */ - c->ic_freq = ieee80211_ieee2mhz(chan, - IEEE80211_CHAN_A); - - c->ic_flags = IEEE80211_CHAN_A | nflags; - } + error = ieee80211_add_channel(chans, maxchans, nchans, + chan, 0, channels[i].maxpwr, nflags, bands); + if (error != 0) + break; /* Save maximum allowed TX power for this channel. */ sc->maxpwr[chan] = channels[i].maxpwr; DPRINTF(sc, WPI_DEBUG_EEPROM, - "adding chan %d (%dMHz) flags=0x%x maxpwr=%d passive=%d," - " offset %d\n", chan, c->ic_freq, - channels[i].flags, sc->maxpwr[chan], - IEEE80211_IS_CHAN_PASSIVE(c), *nchans); + "adding chan %d flags=0x%x maxpwr=%d, offset %d\n", + chan, channels[i].flags, sc->maxpwr[chan], *nchans); } } From owner-svn-src-head@freebsd.org Fri Apr 29 23:27:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C0BFB216D2; Fri, 29 Apr 2016 23:27:17 +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 C20831E72; Fri, 29 Apr 2016 23:27:16 +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 u3TNRGC9067733; Fri, 29 Apr 2016 23:27:16 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TNRFVt067723; Fri, 29 Apr 2016 23:27:15 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604292327.u3TNRFVt067723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 29 Apr 2016 23:27:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298823 - in head: gnu/usr.bin gnu/usr.bin/sdiff usr.bin usr.bin/sdiff usr.bin/sdiff/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 23:27:17 -0000 Author: bapt Date: Fri Apr 29 23:27:15 2016 New Revision: 298823 URL: https://svnweb.freebsd.org/changeset/base/298823 Log: import sdiff(1) from GSoC 2012 Import sdiff(1) from the diff version written by Raymond Lai, improved during GSoC 2012 by Jesse Hagewood. Compared to the version done in during that summer of code: - Remove the zlib frontend: zsdiff - Compatible output (column size and separators) with GNU sdiff Compared to GNU sdiff in ports: - The only difference is padding using spaces vs tabs Compared to OpenBSD and NetBSD import: - Implement missing options (including long options) from GNU sdiff - Improved support for the edition mode (signal handling) - Output visually compatible with GNU sdiff: size of columns While here import regression tests from NetBSD adapted to fit the output as expected by GNU sdiff Reviewed by: emaste (in part) Obtained from: OpenBSD, NetBSD, GSoC 2012 Relnotes: yes Differential Revision: https://reviews.freebsd.org/D5981 Differential Revision: https://reviews.freebsd.org/D6032 (diff with NetBSD version) Differential Revision: https://reviews.freebsd.org/D6033 (diff with OpenBSD version) Added: head/usr.bin/sdiff/ head/usr.bin/sdiff/Makefile (contents, props changed) head/usr.bin/sdiff/common.c (contents, props changed) head/usr.bin/sdiff/common.h (contents, props changed) head/usr.bin/sdiff/edit.c (contents, props changed) head/usr.bin/sdiff/extern.h (contents, props changed) head/usr.bin/sdiff/sdiff.1 (contents, props changed) head/usr.bin/sdiff/sdiff.c (contents, props changed) head/usr.bin/sdiff/tests/ head/usr.bin/sdiff/tests/Makefile (contents, props changed) head/usr.bin/sdiff/tests/d_dot.in (contents, props changed) head/usr.bin/sdiff/tests/d_flags_l.out (contents, props changed) head/usr.bin/sdiff/tests/d_flags_s.out (contents, props changed) head/usr.bin/sdiff/tests/d_flags_w.out (contents, props changed) head/usr.bin/sdiff/tests/d_iflags_a1.out (contents, props changed) head/usr.bin/sdiff/tests/d_iflags_a2.out (contents, props changed) head/usr.bin/sdiff/tests/d_iflags_b1.out (contents, props changed) head/usr.bin/sdiff/tests/d_iflags_b2.out (contents, props changed) head/usr.bin/sdiff/tests/d_iflags_c1.out (contents, props changed) head/usr.bin/sdiff/tests/d_iflags_c2.out (contents, props changed) head/usr.bin/sdiff/tests/d_iflags_d1.out (contents, props changed) head/usr.bin/sdiff/tests/d_iflags_d2.out (contents, props changed) head/usr.bin/sdiff/tests/d_input1 (contents, props changed) head/usr.bin/sdiff/tests/d_input2 (contents, props changed) head/usr.bin/sdiff/tests/d_oneline.in (contents, props changed) head/usr.bin/sdiff/tests/d_oneline_a.out (contents, props changed) head/usr.bin/sdiff/tests/d_oneline_b.out (contents, props changed) head/usr.bin/sdiff/tests/d_same.out (contents, props changed) head/usr.bin/sdiff/tests/d_short.out (contents, props changed) head/usr.bin/sdiff/tests/d_tabends.in (contents, props changed) head/usr.bin/sdiff/tests/d_tabends_a.out (contents, props changed) head/usr.bin/sdiff/tests/d_tabends_b.out (contents, props changed) head/usr.bin/sdiff/tests/d_tabends_c.out (contents, props changed) head/usr.bin/sdiff/tests/d_tabs.out (contents, props changed) head/usr.bin/sdiff/tests/d_tabs1.in (contents, props changed) head/usr.bin/sdiff/tests/d_tabs2.in (contents, props changed) head/usr.bin/sdiff/tests/sdiff.sh (contents, props changed) Deleted: head/gnu/usr.bin/sdiff/ Modified: head/gnu/usr.bin/Makefile head/usr.bin/Makefile Modified: head/gnu/usr.bin/Makefile ============================================================================== --- head/gnu/usr.bin/Makefile Fri Apr 29 22:43:11 2016 (r298822) +++ head/gnu/usr.bin/Makefile Fri Apr 29 23:27:15 2016 (r298823) @@ -13,7 +13,6 @@ SUBDIR= ${_binutils} \ grep \ ${_groff} \ ${_rcs} \ - sdiff \ ${_tests} SUBDIR_DEPEND_gdb= ${_binutils} Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Fri Apr 29 22:43:11 2016 (r298822) +++ head/usr.bin/Makefile Fri Apr 29 23:27:15 2016 (r298823) @@ -134,6 +134,7 @@ SUBDIR= alias \ rusers \ rwall \ script \ + sdiff \ sed \ send-pr \ seq \ Added: head/usr.bin/sdiff/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiff/Makefile Fri Apr 29 23:27:15 2016 (r298823) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.include + +PROG= sdiff +SRCS= common.c edit.c sdiff.c +WARNS= 3 + +LIBADD= util +MAN1= sdiff.1 + +.if ${MK_TESTS} != "no" +SUBDIR+= tests +.endif + +.include Added: head/usr.bin/sdiff/common.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiff/common.c Fri Apr 29 23:27:15 2016 (r298823) @@ -0,0 +1,24 @@ +/* $OpenBSD: common.c,v 1.4 2006/05/25 03:20:32 ray Exp $ */ + +/* + * Written by Raymond Lai . + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include "common.h" + +void +cleanup(const char *filename) +{ + + if (unlink(filename)) + err(2, "could not delete: %s", filename); + exit(2); +} Added: head/usr.bin/sdiff/common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiff/common.h Fri Apr 29 23:27:15 2016 (r298823) @@ -0,0 +1,9 @@ +/* $OpenBSD: common.h,v 1.2 2006/05/25 03:20:32 ray Exp $ */ +/* $FreeBSD$ */ + +/* + * Written by Raymond Lai . + * Public domain. + */ + +void cleanup(const char *) __dead2; Added: head/usr.bin/sdiff/edit.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiff/edit.c Fri Apr 29 23:27:15 2016 (r298823) @@ -0,0 +1,209 @@ +/* $OpenBSD: edit.c,v 1.19 2009/06/07 13:29:50 ray Exp $ */ + +/* + * Written by Raymond Lai . + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "extern.h" + +int editit(const char *); + +/* + * Execute an editor on the specified pathname, which is interpreted + * from the shell. This means flags may be included. + * + * Returns -1 on error, or the exit value on success. + */ +int +editit(const char *pathname) +{ + char *argp[] = {"sh", "-c", NULL, NULL}, *ed, *p; + sig_t sighup, sigint, sigquit, sigchld; + pid_t pid; + int saved_errno, st, ret = -1; + + ed = getenv("VISUAL"); + if (ed == NULL || ed[0] == '\0') + ed = getenv("EDITOR"); + if (ed == NULL || ed[0] == '\0') + ed = _PATH_VI; + if (asprintf(&p, "%s %s", ed, pathname) == -1) + return (-1); + argp[2] = p; + + sighup = signal(SIGHUP, SIG_IGN); + sigint = signal(SIGINT, SIG_IGN); + sigquit = signal(SIGQUIT, SIG_IGN); + sigchld = signal(SIGCHLD, SIG_DFL); + if ((pid = fork()) == -1) + goto fail; + if (pid == 0) { + execv(_PATH_BSHELL, argp); + _exit(127); + } + while (waitpid(pid, &st, 0) == -1) + if (errno != EINTR) + goto fail; + if (!WIFEXITED(st)) + errno = EINTR; + else + ret = WEXITSTATUS(st); + + fail: + saved_errno = errno; + (void)signal(SIGHUP, sighup); + (void)signal(SIGINT, sigint); + (void)signal(SIGQUIT, sigquit); + (void)signal(SIGCHLD, sigchld); + free(p); + errno = saved_errno; + return (ret); +} + +/* + * Parse edit command. Returns 0 on success, -1 on error. + */ +int +eparse(const char *cmd, const char *left, const char *right) +{ + FILE *file; + size_t nread; + int fd; + char *filename; + char buf[BUFSIZ], *text; + + /* Skip whitespace. */ + while (isspace(*cmd)) + ++cmd; + + text = NULL; + switch (*cmd) { + case '\0': + /* Edit empty file. */ + break; + + case 'b': + /* Both strings. */ + if (left == NULL) + goto RIGHT; + if (right == NULL) + goto LEFT; + + /* Neither column is blank, so print both. */ + if (asprintf(&text, "%s\n%s\n", left, right) == -1) + err(2, "could not allocate memory"); + break; + + case 'l': +LEFT: + /* Skip if there is no left column. */ + if (left == NULL) + break; + + if (asprintf(&text, "%s\n", left) == -1) + err(2, "could not allocate memory"); + + break; + + case 'r': +RIGHT: + /* Skip if there is no right column. */ + if (right == NULL) + break; + + if (asprintf(&text, "%s\n", right) == -1) + err(2, "could not allocate memory"); + + break; + + default: + return (-1); + } + + /* Create temp file. */ + if (asprintf(&filename, "%s/sdiff.XXXXXXXXXX", tmpdir) == -1) + err(2, "asprintf"); + if ((fd = mkstemp(filename)) == -1) + err(2, "mkstemp"); + if (text != NULL) { + size_t len; + ssize_t nwritten; + + len = strlen(text); + if ((nwritten = write(fd, text, len)) == -1 || + (size_t)nwritten != len) { + warn("error writing to temp file"); + cleanup(filename); + } + } + close(fd); + + /* text is no longer used. */ + free(text); + + /* Edit temp file. */ + if (editit(filename) == -1) { + warn("error editing %s", filename); + cleanup(filename); + } + + /* Open temporary file. */ + if (!(file = fopen(filename, "r"))) { + warn("could not open edited file: %s", filename); + cleanup(filename); + } + + /* Copy temporary file contents to output file. */ + for (nread = sizeof(buf); nread == sizeof(buf);) { + size_t nwritten; + + nread = fread(buf, sizeof(*buf), sizeof(buf), file); + /* Test for error or end of file. */ + if (nread != sizeof(buf) && + (ferror(file) || !feof(file))) { + warnx("error reading edited file: %s", filename); + cleanup(filename); + } + + /* + * If we have nothing to read, break out of loop + * instead of writing nothing. + */ + if (!nread) + break; + + /* Write data we just read. */ + nwritten = fwrite(buf, sizeof(*buf), nread, outfp); + if (nwritten != nread) { + warnx("error writing to output file"); + cleanup(filename); + } + } + + /* We've reached the end of the temporary file, so remove it. */ + if (unlink(filename)) + warn("could not delete: %s", filename); + fclose(file); + + free(filename); + + return (0); +} Added: head/usr.bin/sdiff/extern.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiff/extern.h Fri Apr 29 23:27:15 2016 (r298823) @@ -0,0 +1,12 @@ +/* $OpenBSD: extern.h,v 1.5 2009/06/07 13:29:50 ray Exp $ */ +/* $FreeBSD$ */ + +/* + * Written by Raymond Lai . + * Public domain. + */ + +extern FILE *outfp; /* file to save changes to */ +extern const char *tmpdir; + +int eparse(const char *, const char *, const char *); Added: head/usr.bin/sdiff/sdiff.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiff/sdiff.1 Fri Apr 29 23:27:15 2016 (r298823) @@ -0,0 +1,174 @@ +.\" $FreeBSD$ +.\" $OpenBSD: sdiff.1,v 1.15 2007/06/29 14:48:07 jmc Exp $ +.\" +.\" Written by Raymond Lai . +.\" Public domain. +.\" +.Dd $Mdocdate: July 5 2012 $ +.Dt SDIFF 1 +.Os +.Sh NAME +.Nm sdiff +.Nd side-by-side diff +.Sh SYNOPSIS +.Nm +.Op Fl abdilstW +.Op Fl I Ar regexp +.Op Fl o Ar outfile +.Op Fl w Ar width +.Ar file1 +.Ar file2 +.Sh DESCRIPTION +.Nm +displays two files side by side, +with any differences between the two highlighted as follows: +new lines are marked with +.Sq \*(Gt ; +deleted lines are marked with +.Sq \*(Lt ; +and changed lines are marked with +.Sq \*(Ba . +.Pp +.Nm +can also be used to interactively merge two files, +prompting at each set of differences. +See the +.Fl o +option for an explanation. +.Pp +The options are: +.Bl -tag -width Ds +.It Fl l -left-column +Only print the left column for identical lines. +.It Fl o -output Ar outfile +Interactively merge +.Ar file1 +and +.Ar file2 +into +.Ar outfile . +In this mode, the user is prompted for each set of differences. +See +.Ev EDITOR +and +.Ev VISUAL , +below, +for details of which editor, if any, is invoked. +.Pp +The commands are as follows: +.Bl -tag -width Ds +.It Cm l | 1 +Choose left set of diffs. +.It Cm r | 2 +Choose right set of diffs. +.It Cm s +Silent mode \(en identical lines are not printed. +.It Cm v +Verbose mode \(en identical lines are printed. +.It Cm e +Start editing an empty file, which will be merged into +.Ar outfile +upon exiting the editor. +.It Cm e Cm l +Start editing file with left set of diffs. +.It Cm e Cm r +Start editing file with right set of diffs. +.It Cm e Cm b +Start editing file with both sets of diffs. +.It Cm q +Quit +.Nm . +.El +.It Fl s -suppress-common-lines +Skip identical lines. +.It Fl w -width Ar width +Print a maximum of +.Ar width +characters on each line. +The default is 130 characters. +.El +.Pp +Options passed to +.Xr diff 1 +are: +.Bl -tag -width Ds +.It Fl a -text +Treat +.Ar file1 +and +.Ar file2 +as text files. +.It Fl b -ignore-space-change +Ignore trailing blank spaces. +.It Fl d -minimal +Minimize diff size. +.It Fl I -ignore-matching-lines Ar regexp +Ignore line changes matching +.Ar regexp . +All lines in the change must match +.Ar regexp +for the change to be ignored. +.It Fl i -ignore-case +Do a case-insensitive comparison. +.It Fl t -expand-tabs +Expand tabs to spaces. +.It Fl W -ignore-all-space +Ignore all spaces. +.It Fl B -ignore-blank-lines +Ignore blank lines. +.It Fl E -ignore-tab-expansion +Treat tabs and eight spaces as the same. +.It Fl t -ignore-tabs +Ignore tabs. +.It Fl H -speed-large-files +Assume scattered small changes in a large file. +.It Fl -ignore-file-name-case +Ignore the case of file names. +.It Fl -no-ignore-file-name-case +Do not ignore file name case. +.It Fl -strip-trailing-cr +Skip identical lines. +.It Fl -tabsize Ar NUM +Change the size of tabs (default is 8.) +.El +.Sh ENVIRONMENT +.Bl -tag -width Ds +.It Ev EDITOR , VISUAL +Specifies an editor to use with the +.Fl o +option. +If both +.Ev EDITOR +and +.Ev VISUAL +are set, +.Ev VISUAL +takes precedence. +If neither +.Ev EDITOR +nor +.Ev VISUAL +are set, +the default is +.Xr vi 1 . +.It Ev TMPDIR +Specifies a directory for temporary files to be created. +The default is +.Pa /tmp . +.El +.Sh SEE ALSO +.Xr cmp 1 , +.Xr diff 1 , +.Xr diff3 1 , +.Xr vi 1 , +.Xr re_format 7 +.Sh AUTHORS +.Nm +was written from scratch for the public domain by +.An Ray Lai Aq ray@cyth.net . +.Sh CAVEATS +.Pp +Tabs are treated as anywhere from one to eight characters wide, +depending on the current column. +Terminals that treat tabs as eight characters wide will look best. + Added: head/usr.bin/sdiff/sdiff.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sdiff/sdiff.c Fri Apr 29 23:27:15 2016 (r298823) @@ -0,0 +1,1184 @@ +/* $OpenBSD: sdiff.c,v 1.36 2015/12/29 19:04:46 gsoares Exp $ */ + +/* + * Written by Raymond Lai . + * Public domain. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "extern.h" + +#define DIFF_PATH "/usr/bin/diff" + +#define WIDTH 126 +/* + * Each column must be at least one character wide, plus three + * characters between the columns (space, [<|>], space). + */ +#define WIDTH_MIN 5 + +/* 3 kilobytes of chars */ +#define MAX_CHECK 768 + +/* A single diff line. */ +struct diffline { + STAILQ_ENTRY(diffline) diffentries; + char *left; + char div; + char *right; +}; + +static void astrcat(char **, const char *); +static void enqueue(char *, char, char *); +static char *mktmpcpy(const char *); +static int istextfile(FILE *); +static void binexec(char *, char *, char *) __dead2; +static void freediff(struct diffline *); +static void int_usage(void); +static int parsecmd(FILE *, FILE *, FILE *); +static void printa(FILE *, size_t); +static void printc(FILE *, size_t, FILE *, size_t); +static void printcol(const char *, size_t *, const size_t); +static void printd(FILE *, size_t); +static void println(const char *, const char, const char *); +static void processq(void); +static void prompt(const char *, const char *); +static void usage(void) __dead2; +static char *xfgets(FILE *); + +static STAILQ_HEAD(, diffline) diffhead = STAILQ_HEAD_INITIALIZER(diffhead); +static size_t line_width; /* width of a line (two columns and divider) */ +static size_t width; /* width of each column */ +static size_t file1ln, file2ln; /* line number of file1 and file2 */ +static int Iflag = 0; /* ignore sets matching regexp */ +static int lflag; /* print only left column for identical lines */ +static int sflag; /* skip identical lines */ +FILE *outfp; /* file to save changes to */ +const char *tmpdir; /* TMPDIR or /tmp */ + +enum { + HELP_OPT = CHAR_MAX + 1, + NORMAL_OPT, + FCASE_SENSITIVE_OPT, + FCASE_IGNORE_OPT, + FROMFILE_OPT, + TOFILE_OPT, + UNIDIR_OPT, + STRIPCR_OPT, + HORIZ_OPT, + LEFTC_OPT, + SUPCL_OPT, + LF_OPT, + /* the following groupings must be in sequence */ + OLDGF_OPT, + NEWGF_OPT, + UNCGF_OPT, + CHGF_OPT, + OLDLF_OPT, + NEWLF_OPT, + UNCLF_OPT, + /* end order-sensitive enums */ + TSIZE_OPT, + HLINES_OPT, + LFILES_OPT, + DIFFPROG_OPT, + PIPE_FD, + /* pid from the diff parent (if applicable) */ + DIFF_PID, + + NOOP_OPT, +}; + +static struct option longopts[] = { + /* options only processed in sdiff */ + { "left-column", no_argument, NULL, LEFTC_OPT }, + { "suppress-common-lines", no_argument, NULL, 's' }, + { "width", required_argument, NULL, 'w' }, + + { "output", required_argument, NULL, 'o' }, + { "diff-program", required_argument, NULL, DIFFPROG_OPT }, + + { "pipe-fd", required_argument, NULL, PIPE_FD }, + { "diff-pid", required_argument, NULL, DIFF_PID }, + /* Options processed by diff. */ + { "ignore-file-name-case", no_argument, NULL, FCASE_IGNORE_OPT }, + { "no-ignore-file-name-case", no_argument, NULL, FCASE_SENSITIVE_OPT }, + { "strip-trailing-cr", no_argument, NULL, STRIPCR_OPT }, + { "tabsize", required_argument, NULL, TSIZE_OPT }, + { "help", no_argument, NULL, HELP_OPT }, + { "text", no_argument, NULL, 'a' }, + { "ignore-blank-lines", no_argument, NULL, 'B' }, + { "ignore-space-change", no_argument, NULL, 'b' }, + { "minimal", no_argument, NULL, 'd' }, + { "ignore-tab-expansion", no_argument, NULL, 'E' }, + { "ignore-matching-lines", required_argument, NULL, 'I' }, + { "ignore-case", no_argument, NULL, 'i' }, + { "expand-tabs", no_argument, NULL, 't' }, + { "speed-large-files", no_argument, NULL, 'H' }, + { "ignore-all-space", no_argument, NULL, 'W' }, + + { NULL, 0, NULL, '\0'} +}; + +static const char *help_msg[] = { + "\nusage: sdiff [-abdilstW] [-I regexp] [-o outfile] [-w width] file1 file2\n", + "\t-l, --left-column, Only print the left column for identical lines.", + "\t-o OUTFILE, --output=OUTFILE, nteractively merge file1 and file2 into outfile.", + "\t-s, --suppress-common-lines, Skip identical lines.", + "\t-w WIDTH, --width=WIDTH, Print a maximum of WIDTH characters on each line.", + "\tOptions passed to diff(1) are:", + "\t\t-a, --text, Treat file1 and file2 as text files.", + "\t\t-b, --ignore-trailing-cr, Ignore trailing blank spaces.", + "\t\t-d, --minimal, Minimize diff size.", + "\t\t-I RE, --ignore-matching-lines=RE, Ignore changes whose line matches RE.", + "\t\t-i, --ignore-case, Do a case-insensitive comparison.", + "\t\t-t, --expand-tabs Expand tabs to spaces.", + "\t\t-W, --ignore-all-spaces, Ignore all spaces.", + "\t\t--speed-large-files, Assume large file with scattered changes.", + "\t\t--strip-trailing-cr, Strip trailing carriage return.", + "\t\t--ignore-file-name-case, Ignore case of file names.", + "\t\t--no-ignore-file-name-case, Do not ignore file name case", + "\t\t--tabsize NUM, Change size of tabs (default 8.)", + + NULL, +}; + +/* + * Create temporary file if source_file is not a regular file. + * Returns temporary file name if one was malloced, NULL if unnecessary. + */ +static char * +mktmpcpy(const char *source_file) +{ + struct stat sb; + ssize_t rcount; + int ifd, ofd; + u_char buf[BUFSIZ]; + char *target_file; + + /* Open input and output. */ + ifd = open(source_file, O_RDONLY, 0); + /* File was opened successfully. */ + if (ifd != -1) { + if (fstat(ifd, &sb) == -1) + err(2, "error getting file status from %s", source_file); + + /* Regular file. */ + if (S_ISREG(sb.st_mode)) { + close(ifd); + return (NULL); + } + } else { + /* If ``-'' does not exist the user meant stdin. */ + if (errno == ENOENT && strcmp(source_file, "-") == 0) + ifd = STDIN_FILENO; + else + err(2, "error opening %s", source_file); + } + + /* Not a regular file, so copy input into temporary file. */ + if (asprintf(&target_file, "%s/sdiff.XXXXXXXXXX", tmpdir) == -1) + err(2, "asprintf"); + if ((ofd = mkstemp(target_file)) == -1) { + warn("error opening %s", target_file); + goto FAIL; + } + while ((rcount = read(ifd, buf, sizeof(buf))) != -1 && + rcount != 0) { + ssize_t wcount; + + wcount = write(ofd, buf, (size_t)rcount); + if (-1 == wcount || rcount != wcount) { + warn("error writing to %s", target_file); + goto FAIL; + } + } + if (rcount == -1) { + warn("error reading from %s", source_file); + goto FAIL; + } + + close(ifd); + close(ofd); + + return (target_file); + +FAIL: + unlink(target_file); + exit(2); +} + +int +main(int argc, char **argv) +{ + FILE *diffpipe=NULL, *file1, *file2; + size_t diffargc = 0, wflag = WIDTH; + int ch, fd[2] = {-1}, status; + pid_t pid=0; pid_t ppid =-1; + const char *outfile = NULL; + struct option *popt; + char **diffargv, *diffprog = DIFF_PATH, *filename1, *filename2, + *tmp1, *tmp2, *s1, *s2; + int i; + + /* + * Process diff flags. + */ + /* + * Allocate memory for diff arguments and NULL. + * Each flag has at most one argument, so doubling argc gives an + * upper limit of how many diff args can be passed. argv[0], + * file1, and file2 won't have arguments so doubling them will + * waste some memory; however we need an extra space for the + * NULL at the end, so it sort of works out. + */ + if (!(diffargv = calloc(argc, sizeof(char **) * 2))) + err(2, "main"); + + /* Add first argument, the program name. */ + diffargv[diffargc++] = diffprog; + + /* create a dynamic string for merging single-switch options */ + if ( asprintf(&diffargv[diffargc++], "-") < 0 ) + err(2, "main"); + + while ((ch = getopt_long(argc, argv, "aBbdEHI:ilo:stWw:", + longopts, NULL)) != -1) { + const char *errstr; + + switch (ch) { + /* only compatible --long-name-form with diff */ + case FCASE_IGNORE_OPT: + case FCASE_SENSITIVE_OPT: + case STRIPCR_OPT: + case TSIZE_OPT: + case 'S': + break; + /* combine no-arg single switches */ + case 'a': + case 'B': + case 'b': + case 'd': + case 'E': + case 'i': + case 't': + case 'H': + case 'W': + for(popt = longopts; ch != popt->val && popt->name != NULL; popt++); + diffargv[1] = realloc(diffargv[1], sizeof(char) * strlen(diffargv[1]) + 2); + /* + * In diff, the 'W' option is 'w' and the 'w' is 'W'. + */ + if (ch == 'W') + sprintf(diffargv[1], "%sw", diffargv[1]); + else + sprintf(diffargv[1], "%s%c", diffargv[1], ch); + break; + case DIFFPROG_OPT: + diffargv[0] = diffprog = optarg; + break; + case 'I': + Iflag = 1; + diffargv[diffargc++] = "-I"; + diffargv[diffargc++] = optarg; + break; + case 'l': + lflag = 1; + break; + case 'o': + outfile = optarg; + break; + case 's': + sflag = 1; + break; + case 'w': + wflag = strtonum(optarg, WIDTH_MIN, + INT_MAX, &errstr); + if (errstr) + errx(2, "width is %s: %s", errstr, optarg); + break; + case DIFF_PID: + ppid = strtonum(optarg, 0, INT_MAX, &errstr); + if (errstr) + errx(2, "diff pid value is %s: %s", errstr, optarg); + break; + case HELP_OPT: + for (i = 0; help_msg[i] != NULL; i++) + printf("%s\n", help_msg[i]); + exit(0); + break; + default: + usage(); + break; + } + } + + /* no single switches were used */ + if (strcmp(diffargv[1], "-") == 0 ) { + for ( i = 1; i < argc-1; i++) { + diffargv[i] = diffargv[i+1]; + } + diffargv[diffargc-1] = NULL; + diffargc--; + } + + argc -= optind; + argv += optind; + + if (argc != 2) + usage(); + + if (outfile && (outfp = fopen(outfile, "w")) == NULL) + err(2, "could not open: %s", optarg); + + if ((tmpdir = getenv("TMPDIR")) == NULL || *tmpdir == '\0') + tmpdir = _PATH_TMP; + + filename1 = argv[0]; + filename2 = argv[1]; + + /* + * Create temporary files for diff and sdiff to share if file1 + * or file2 are not regular files. This allows sdiff and diff + * to read the same inputs if one or both inputs are stdin. + * + * If any temporary files were created, their names would be + * saved in tmp1 or tmp2. tmp1 should never equal tmp2. + */ + tmp1 = tmp2 = NULL; + /* file1 and file2 are the same, so copy to same temp file. */ + if (strcmp(filename1, filename2) == 0) { + if ((tmp1 = mktmpcpy(filename1))) + filename1 = filename2 = tmp1; + /* Copy file1 and file2 into separate temp files. */ + } else { + if ((tmp1 = mktmpcpy(filename1))) + filename1 = tmp1; + if ((tmp2 = mktmpcpy(filename2))) + filename2 = tmp2; + } + + diffargv[diffargc++] = filename1; + diffargv[diffargc++] = filename2; + /* Add NULL to end of array to indicate end of array. */ + diffargv[diffargc++] = NULL; + + /* Subtract column divider and divide by two. */ + width = (wflag - 3) / 2; + /* Make sure line_width can fit in size_t. */ + if (width > (SIZE_MAX - 3) / 2) + errx(2, "width is too large: %zu", width); + line_width = width * 2 + 3; + + if (ppid == -1 ) { + if (pipe(fd)) + err(2, "pipe"); + + switch (pid = fork()) { + case 0: + /* child */ + /* We don't read from the pipe. */ + close(fd[0]); + if (dup2(fd[1], STDOUT_FILENO) == -1) + err(2, "child could not duplicate descriptor"); + /* Free unused descriptor. */ + close(fd[1]); + execvp(diffprog, diffargv); + err(2, "could not execute diff: %s", diffprog); + break; + case -1: + err(2, "could not fork"); + break; + } + + /* parent */ + /* We don't write to the pipe. */ + close(fd[1]); + + /* Open pipe to diff command. */ + if ((diffpipe = fdopen(fd[0], "r")) == NULL) + err(2, "could not open diff pipe"); + } + if ((file1 = fopen(filename1, "r")) == NULL) + err(2, "could not open %s", filename1); + if ((file2 = fopen(filename2, "r")) == NULL) + err(2, "could not open %s", filename2); + if (!istextfile(file1) || !istextfile(file2)) { + /* Close open files and pipe, delete temps */ + fclose(file1); + fclose(file2); + fclose(diffpipe); + if (tmp1) + if (unlink(tmp1)) + warn("Error deleting %s.", tmp1); + if (tmp2) + if (unlink(tmp2)) + warn("Error deleting %s.", tmp2); + free(tmp1); + free(tmp2); + binexec(diffprog, filename1, filename2); + } + /* Line numbers start at one. */ + file1ln = file2ln = 1; + + /* Read and parse diff output. */ + while (parsecmd(diffpipe, file1, file2) != EOF) + ; + fclose(diffpipe); + + /* Wait for diff to exit. */ + if (waitpid(pid, &status, 0) == -1 || !WIFEXITED(status) || + WEXITSTATUS(status) >= 2) + err(2, "diff exited abnormally."); + + /* Delete and free unneeded temporary files. */ + if (tmp1) + if (unlink(tmp1)) + warn("Error deleting %s.", tmp1); + if (tmp2) + if (unlink(tmp2)) + warn("Error deleting %s.", tmp2); + free(tmp1); + free(tmp2); + filename1 = filename2 = tmp1 = tmp2 = NULL; + + /* No more diffs, so print common lines. */ + if (lflag) + while ((s1 = xfgets(file1))) + enqueue(s1, ' ', NULL); + else + for (;;) { + s1 = xfgets(file1); + s2 = xfgets(file2); + if (s1 || s2) + enqueue(s1, ' ', s2); + else + break; + } + fclose(file1); + fclose(file2); + /* Process unmodified lines. */ + processq(); + + /* Return diff exit status. */ + return (WEXITSTATUS(status)); +} + +/* + * When sdiff/zsdiff detects a binary file as input, executes them with + * diff/zdiff to maintain the same behavior as GNU sdiff with binary input. + */ +static void +binexec(char *diffprog, char *f1, char *f2) +{ + + char *args[] = {diffprog, f1, f2, (char *) 0}; + execv(diffprog, args); + + /* If execv() fails, sdiff's execution will continue below. */ + errx(1, "Could not execute diff process.\n"); +} + +/* + * Checks whether a file appears to be a text file. + */ +static int +istextfile(FILE *f) +{ + int i; + char ch; + + if (f == NULL) + return (1); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Apr 29 23:53:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B846EB21CD1; Fri, 29 Apr 2016 23:53:57 +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 923441E0B; Fri, 29 Apr 2016 23:53:57 +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 u3TNruib077279; Fri, 29 Apr 2016 23:53:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TNruof077271; Fri, 29 Apr 2016 23:53:56 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604292353.u3TNruof077271@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Apr 2016 23:53:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298824 - in head/sys: amd64/conf arm/conf conf i386/conf pc98/conf powerpc/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 23:53:57 -0000 Author: jhb Date: Fri Apr 29 23:53:55 2016 New Revision: 298824 URL: https://svnweb.freebsd.org/changeset/base/298824 Log: Move 'device pci' for the PCI bus driver to the MI NOTES file. The PCI bus was already listed in all of the MD NOTES files and the driver should at least compile on all platforms. Modified: head/sys/amd64/conf/NOTES head/sys/arm/conf/NOTES head/sys/conf/NOTES head/sys/i386/conf/NOTES head/sys/pc98/conf/NOTES head/sys/powerpc/conf/NOTES head/sys/sparc64/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Fri Apr 29 23:27:15 2016 (r298823) +++ head/sys/amd64/conf/NOTES Fri Apr 29 23:53:55 2016 (r298824) @@ -177,11 +177,6 @@ options MAXMEM=(128*1024) #options BROKEN_KEYBOARD_RESET # -# PCI bus & PCI options: -# -device pci - -# # AGP GART support device agp Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Fri Apr 29 23:27:15 2016 (r298823) +++ head/sys/arm/conf/NOTES Fri Apr 29 23:53:55 2016 (r298824) @@ -36,8 +36,6 @@ options SOC_MV_DISCOVERY options SOC_MV_KIRKWOOD options SOC_MV_ORION -device pci - device at91_board_bwct device at91_board_ethernut5 device at91_board_hl200 Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Apr 29 23:27:15 2016 (r298823) +++ head/sys/conf/NOTES Fri Apr 29 23:53:55 2016 (r298824) @@ -1405,6 +1405,15 @@ options MSGBUF_SIZE=40960 ##################################################################### +# HARDWARE BUS CONFIGURATION + +# +# PCI bus & PCI options: +# +device pci + + +##################################################################### # HARDWARE DEVICE CONFIGURATION # For ISA the required hints are listed. Modified: head/sys/i386/conf/NOTES ============================================================================== --- head/sys/i386/conf/NOTES Fri Apr 29 23:27:15 2016 (r298823) +++ head/sys/i386/conf/NOTES Fri Apr 29 23:53:55 2016 (r298824) @@ -373,11 +373,6 @@ options EISA_SLOTS=12 device mca # -# PCI bus & PCI options: -# -device pci - -# # AGP GART support device agp Modified: head/sys/pc98/conf/NOTES ============================================================================== --- head/sys/pc98/conf/NOTES Fri Apr 29 23:27:15 2016 (r298823) +++ head/sys/pc98/conf/NOTES Fri Apr 29 23:53:55 2016 (r298824) @@ -282,11 +282,6 @@ options EPSON_BOUNCEDMA options EPSON_MEMWIN # -# PCI bus & PCI options: -# -device pci - -# # AGP GART support device agp Modified: head/sys/powerpc/conf/NOTES ============================================================================== --- head/sys/powerpc/conf/NOTES Fri Apr 29 23:27:15 2016 (r298823) +++ head/sys/powerpc/conf/NOTES Fri Apr 29 23:53:55 2016 (r298824) @@ -52,7 +52,6 @@ options SC_OFWFB # OFW frame buffer device cpufreq # Standard busses -device pci device agp device bm # Apple BMAC (Big Mac Ethernet) Modified: head/sys/sparc64/conf/NOTES ============================================================================== --- head/sys/sparc64/conf/NOTES Fri Apr 29 23:27:15 2016 (r298823) +++ head/sys/sparc64/conf/NOTES Fri Apr 29 23:53:55 2016 (r298824) @@ -20,7 +20,6 @@ cpu SUN4U device ebus device isa -device pci device sbus device central device fhc From owner-svn-src-head@freebsd.org Fri Apr 29 23:55:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D559B21D37; Fri, 29 Apr 2016 23:55:23 +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 1F4481F8F; Fri, 29 Apr 2016 23:55:23 +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 u3TNtMY3077408; Fri, 29 Apr 2016 23:55:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3TNtMBS077407; Fri, 29 Apr 2016 23:55:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604292355.u3TNtMBS077407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 29 Apr 2016 23:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298825 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2016 23:55:23 -0000 Author: jhb Date: Fri Apr 29 23:55:22 2016 New Revision: 298825 URL: https://svnweb.freebsd.org/changeset/base/298825 Log: Add PCI_IOV to NOTES. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Apr 29 23:53:55 2016 (r298824) +++ head/sys/conf/NOTES Fri Apr 29 23:55:22 2016 (r298825) @@ -1411,6 +1411,7 @@ options MSGBUF_SIZE=40960 # PCI bus & PCI options: # device pci +options PCI_IOV # PCI SR-IOV support ##################################################################### From owner-svn-src-head@freebsd.org Sat Apr 30 00:26:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 199F3B209E7; Sat, 30 Apr 2016 00:26:42 +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 DDCA414E6; Sat, 30 Apr 2016 00:26:41 +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 u3U0Qfmn087392; Sat, 30 Apr 2016 00:26:41 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U0Qc4N087370; Sat, 30 Apr 2016 00:26:38 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604300026.u3U0Qc4N087370@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 00:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298826 - in head/sys/boot: arm/at91/bootiic arm/at91/bootspi arm/at91/libat91 efi/boot1 efi/include efi/include/amd64 efi/include/arm efi/include/arm64 efi/include/i386 efi/loader fdt ... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 00:26:42 -0000 Author: pfg Date: Sat Apr 30 00:26:38 2016 New Revision: 298826 URL: https://svnweb.freebsd.org/changeset/base/298826 Log: sys/boot: spelling fixes in comments. No functional change. Modified: head/sys/boot/arm/at91/bootiic/env_vars.c head/sys/boot/arm/at91/bootspi/env_vars.c head/sys/boot/arm/at91/libat91/at91rm9200.h head/sys/boot/arm/at91/libat91/mci_device.h head/sys/boot/efi/boot1/boot1.c head/sys/boot/efi/include/amd64/efibind.h head/sys/boot/efi/include/arm/efibind.h head/sys/boot/efi/include/arm64/efibind.h head/sys/boot/efi/include/efiuga.h head/sys/boot/efi/include/i386/efibind.h head/sys/boot/efi/loader/main.c head/sys/boot/fdt/fdt_loader_cmd.c head/sys/boot/i386/libfirewire/dconsole.c head/sys/boot/i386/libfirewire/fwohci.c head/sys/boot/i386/libi386/amd64_tramp.S head/sys/boot/i386/libi386/pxe.h head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/ofw/common/main.c head/sys/boot/pc98/boot0.5/disk.s head/sys/boot/pc98/boot0.5/putssjis.s head/sys/boot/pc98/boot0.5/support.s head/sys/boot/uboot/fdt/uboot_fdt.c Modified: head/sys/boot/arm/at91/bootiic/env_vars.c ============================================================================== --- head/sys/boot/arm/at91/bootiic/env_vars.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/arm/at91/bootiic/env_vars.c Sat Apr 30 00:26:38 2016 (r298826) @@ -41,7 +41,7 @@ static int currentOffset; /* * .KB_C_FN_DEFINITION_START * int ReadCharFromEnvironment(char *) - * This private function reads characters from the enviroment variables + * This private function reads characters from the environment variables * to service the command prompt during auto-boot or just to setup the * default environment. Returns positive value if valid character was * set in the pointer. Returns negative value to signal input stream Modified: head/sys/boot/arm/at91/bootspi/env_vars.c ============================================================================== --- head/sys/boot/arm/at91/bootspi/env_vars.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/arm/at91/bootspi/env_vars.c Sat Apr 30 00:26:38 2016 (r298826) @@ -41,7 +41,7 @@ static int currentOffset; /* * .KB_C_FN_DEFINITION_START * int ReadCharFromEnvironment(char *) - * This private function reads characters from the enviroment variables + * This private function reads characters from the environment variables * to service the command prompt during auto-boot or just to setup the * default environment. Returns positive value if valid character was * set in the pointer. Returns negative value to signal input stream Modified: head/sys/boot/arm/at91/libat91/at91rm9200.h ============================================================================== --- head/sys/boot/arm/at91/libat91/at91rm9200.h Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/arm/at91/libat91/at91rm9200.h Sat Apr 30 00:26:38 2016 (r298826) @@ -474,7 +474,7 @@ typedef struct _AT91S_ST { #define AT91C_ST_CRTV (0xFFFFFu << 0) // (ST) Current Real-time Value // ***************************************************************************** -// SOFTWARE API DEFINITION FOR Power Management Controler +// SOFTWARE API DEFINITION FOR Power Management Controller // ***************************************************************************** typedef struct _AT91S_PMC { AT91_REG PMC_SCER; // System Clock Enable Register @@ -547,7 +547,7 @@ typedef struct _AT91S_PMC { // -------- PMC_IMR : (PMC Offset: 0x6c) PMC Interrupt Mask Register -------- // ***************************************************************************** -// SOFTWARE API DEFINITION FOR Clock Generator Controler +// SOFTWARE API DEFINITION FOR Clock Generator Controller // ***************************************************************************** typedef struct _AT91S_CKGR { AT91_REG CKGR_MOR; // Main Oscillator Register @@ -590,7 +590,7 @@ typedef struct _AT91S_CKGR { #define AT91C_CKGR_USB_PLL (0x1u << 29) // (CKGR) PLL Use // ***************************************************************************** -// SOFTWARE API DEFINITION FOR Parallel Input Output Controler +// SOFTWARE API DEFINITION FOR Parallel Input Output Controller // ***************************************************************************** typedef struct _AT91S_PIO { AT91_REG PIO_PER; // PIO Enable Register Modified: head/sys/boot/arm/at91/libat91/mci_device.h ============================================================================== --- head/sys/boot/arm/at91/libat91/mci_device.h Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/arm/at91/libat91/mci_device.h Sat Apr 30 00:26:38 2016 (r298826) @@ -106,15 +106,15 @@ typedef struct _AT91S_MciDevice /////////////////////////////////////////////////////////////////////////////// #define AT91C_CMD_SEND_OK 0 // Command ok #define AT91C_CMD_SEND_ERROR -1 // Command failed -#define AT91C_INIT_OK 2 // Init Successfull +#define AT91C_INIT_OK 2 // Init Successful #define AT91C_INIT_ERROR 3 // Init Failed -#define AT91C_READ_OK 4 // Read Successfull +#define AT91C_READ_OK 4 // Read Successful #define AT91C_READ_ERROR 5 // Read Failed -#define AT91C_WRITE_OK 6 // Write Successfull +#define AT91C_WRITE_OK 6 // Write Successful #define AT91C_WRITE_ERROR 7 // Write Failed -#define AT91C_ERASE_OK 8 // Erase Successfull +#define AT91C_ERASE_OK 8 // Erase Successful #define AT91C_ERASE_ERROR 9 // Erase Failed -#define AT91C_CARD_SELECTED_OK 10 // Card Selection Successfull +#define AT91C_CARD_SELECTED_OK 10 // Card Selection Successful #define AT91C_CARD_SELECTED_ERROR 11 // Card Selection Failed #define AT91C_MCI_SR_ERROR (AT91C_MCI_UNRE | AT91C_MCI_OVRE | AT91C_MCI_DTOE | \ Modified: head/sys/boot/efi/boot1/boot1.c ============================================================================== --- head/sys/boot/efi/boot1/boot1.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/efi/boot1/boot1.c Sat Apr 30 00:26:38 2016 (r298826) @@ -103,8 +103,8 @@ nodes_match(EFI_DEVICE_PATH *imgpath, EF /* * device_paths_match returns TRUE if the imgpath isn't NULL and all nodes - * in imgpath and devpath match up to their respect occurances of a media - * node, FALSE otherwise. + * in imgpath and devpath match up to their respective occurrences of a + * media node, FALSE otherwise. */ static BOOLEAN device_paths_match(EFI_DEVICE_PATH *imgpath, EFI_DEVICE_PATH *devpath) Modified: head/sys/boot/efi/include/amd64/efibind.h ============================================================================== --- head/sys/boot/efi/include/amd64/efibind.h Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/efi/include/amd64/efibind.h Sat Apr 30 00:26:38 2016 (r298826) @@ -238,7 +238,7 @@ typedef uint64_t UINTN; #else // EFI_NT_EMULATOR // -// When build similiar to FW, then link everything together as +// When building similar to FW, link everything together as // one big module. // Modified: head/sys/boot/efi/include/arm/efibind.h ============================================================================== --- head/sys/boot/efi/include/arm/efibind.h Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/efi/include/arm/efibind.h Sat Apr 30 00:26:38 2016 (r298826) @@ -34,7 +34,7 @@ Abstract: // -// Make sure we are useing the correct packing rules per EFI specification +// Make sure we are using the correct packing rules per EFI specification // #ifndef __GNUC__ #pragma pack() Modified: head/sys/boot/efi/include/arm64/efibind.h ============================================================================== --- head/sys/boot/efi/include/arm64/efibind.h Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/efi/include/arm64/efibind.h Sat Apr 30 00:26:38 2016 (r298826) @@ -176,7 +176,7 @@ typedef uint64_t UINTN; #define VOLATILE volatile // -// BugBug: Need to find out if this is portable accross compliers. +// BugBug: Need to find out if this is portable across compilers. // void __mfa (void); #define MEMORY_FENCE() __mfa() @@ -190,7 +190,7 @@ void __mfa (void); #endif // -// When build similiar to FW, then link everything together as +// When build similar to FW, then link everything together as // one big module. // Modified: head/sys/boot/efi/include/efiuga.h ============================================================================== --- head/sys/boot/efi/include/efiuga.h Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/efi/include/efiuga.h Sat Apr 30 00:26:38 2016 (r298826) @@ -139,7 +139,7 @@ typedef enum { @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. + @retval EFI_DEVICE_ERROR - A hardware error occurred writting to the video buffer. --*/ typedef Modified: head/sys/boot/efi/include/i386/efibind.h ============================================================================== --- head/sys/boot/efi/include/i386/efibind.h Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/efi/include/i386/efibind.h Sat Apr 30 00:26:38 2016 (r298826) @@ -234,7 +234,7 @@ typedef uint32_t UINTN; #else // EFI_NT_EMULATOR // -// When build similiar to FW, then link everything together as +// When build similar to FW, then link everything together as // one big module. // Modified: head/sys/boot/efi/loader/main.c ============================================================================== --- head/sys/boot/efi/loader/main.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/efi/loader/main.c Sat Apr 30 00:26:38 2016 (r298826) @@ -74,7 +74,7 @@ static void efi_zfs_probe(void); /* * Need this because EFI uses UTF-16 unicode string constants, but we - * use UTF-8. We can't use printf due to the possiblity of \0 and we + * use UTF-8. We can't use printf due to the possibility of \0 and we * don't support support wide characters either. */ static void Modified: head/sys/boot/fdt/fdt_loader_cmd.c ============================================================================== --- head/sys/boot/fdt/fdt_loader_cmd.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/fdt/fdt_loader_cmd.c Sat Apr 30 00:26:38 2016 (r298826) @@ -158,7 +158,7 @@ fdt_find_static_dtb() } /* - * The most efficent way to find a symbol would be to calculate a + * The most efficient way to find a symbol would be to calculate a * hash, find proper bucket and chain, and thus find a symbol. * However, that would involve code duplication (e.g. for hash * function). So we're using simpler and a bit slower way: we're @@ -652,7 +652,7 @@ fdt_fixup_memory(struct fdt_mem_region * if (fdt_get_mem_rsv(fdtp, i, &rstart, &rsize)) break; if (rsize) { - /* Ensure endianess, and put cells into a buffer */ + /* Ensure endianness, and put cells into a buffer */ if (addr_cells == 2) *(uint64_t *)buf = cpu_to_fdt64(rstart); @@ -701,7 +701,7 @@ fdt_fixup_memory(struct fdt_mem_region * for (i = 0; i < num; i++) { curmr = ®ion[i]; if (curmr->size != 0) { - /* Ensure endianess, and put cells into a buffer */ + /* Ensure endianness, and put cells into a buffer */ if (addr_cells == 2) *(uint64_t *)buf = cpu_to_fdt64(curmr->start); Modified: head/sys/boot/i386/libfirewire/dconsole.c ============================================================================== --- head/sys/boot/i386/libfirewire/dconsole.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/i386/libfirewire/dconsole.c Sat Apr 30 00:26:38 2016 (r298826) @@ -53,7 +53,7 @@ uint32_t dcons_paddr; * that is mapped at the very early boot state. * - We expect identiy map only for regions before KERNLOAD * (i386:4MB amd64:1MB). - * - It seems that heap in conventional memory(640KB) is not sufficent + * - It seems that heap in conventional memory(640KB) is not sufficient * and we move it to high address as LOADER_SUPPORT_BZIP2. * - BSS is placed in conventional memory. */ Modified: head/sys/boot/i386/libfirewire/fwohci.c ============================================================================== --- head/sys/boot/i386/libfirewire/fwohci.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/i386/libfirewire/fwohci.c Sat Apr 30 00:26:38 2016 (r298826) @@ -217,7 +217,7 @@ fwohci_reset(struct fwohci_softc *sc, de /* Disable interrupts */ OWRITE(sc, FWOHCI_INTMASKCLR, ~0); - /* FLUSH FIFO and reset Transmitter/Reciever */ + /* FLUSH FIFO and reset Transmitter/Receiver */ OWRITE(sc, OHCI_HCCCTL, OHCI_HCC_RESET); if (firewire_debug) device_printf(dev, "resetting OHCI..."); @@ -297,7 +297,7 @@ fwohci_init(struct fwohci_softc *sc, dev return (ENXIO); #if 0 -/* SID recieve buffer must align 2^11 */ +/* SID receive buffer must align 2^11 */ #define OHCI_SIDSIZE (1 << 11) sc->sid_buf = fwdma_malloc(&sc->fc, OHCI_SIDSIZE, OHCI_SIDSIZE, &sc->sid_dma, BUS_DMA_WAITOK); Modified: head/sys/boot/i386/libi386/amd64_tramp.S ============================================================================== --- head/sys/boot/i386/libi386/amd64_tramp.S Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/i386/libi386/amd64_tramp.S Sat Apr 30 00:26:38 2016 (r298826) @@ -96,7 +96,7 @@ amd64_tramp: orl $CR0_PG, %eax movl %eax, %cr0 - /* Now we're in compatability mode. set %cs for long mode */ + /* Now we're in compatibility mode. set %cs for long mode */ movl $VTOP(gdtdesc), %eax movl VTOP(entry_hi), %esi movl VTOP(entry_lo), %edi Modified: head/sys/boot/i386/libi386/pxe.h ============================================================================== --- head/sys/boot/i386/libi386/pxe.h Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/i386/libi386/pxe.h Sat Apr 30 00:26:38 2016 (r298826) @@ -226,7 +226,7 @@ typedef struct { #define PXENV_UNDI_SET_STATION_ADDRESS 0x000A typedef struct { PXENV_STATUS_t Status; - MAC_ADDR StationAddress; /* Temp MAC addres to use */ + MAC_ADDR StationAddress; /* Temp MAC address to use */ } PACKED t_PXENV_UNDI_SET_STATION_ADDR; #define PXENV_UNDI_SET_PACKET_FILTER 0x000B @@ -330,7 +330,7 @@ typedef struct { PXENV_STATUS_t Status; uint16_t FuncFlag; /* PXENV_UNDI_ISR_OUT_xxx */ uint16_t BufferLength; /* Length of Frame */ - uint16_t FrameLength; /* Total length of reciever frame */ + uint16_t FrameLength; /* Total length of receiver frame */ uint16_t FrameHeaderLength; /* Length of the media header in Frame */ SEGOFF16_t Frame; /* receive buffer */ uint8_t ProtType; /* Protocol type */ @@ -344,7 +344,7 @@ typedef struct { # define PXENV_UNDI_ISR_OUT_NOT_OUTS 1 /* - * one of these will bre returnd for PXEND_UNDI_ISR_IN_PROCESS + * one of these will bre returned for PXEND_UNDI_ISR_IN_PROCESS * and PXENV_UNDI_ISR_IN_GET_NEXT */ # define PXENV_UNDI_ISR_OUT_DONE 0 Modified: head/sys/boot/i386/zfsboot/zfsboot.c ============================================================================== --- head/sys/boot/i386/zfsboot/zfsboot.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/i386/zfsboot/zfsboot.c Sat Apr 30 00:26:38 2016 (r298826) @@ -451,7 +451,7 @@ probe_drive(struct dsk *dsk) } /* - * Probe all GPT partitions for the presense of ZFS pools. We + * Probe all GPT partitions for the presence of ZFS pools. We * return the spa_t for the first we find (if requested). This * will have the effect of booting from the first pool on the * disk. Modified: head/sys/boot/ofw/common/main.c ============================================================================== --- head/sys/boot/ofw/common/main.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/ofw/common/main.c Sat Apr 30 00:26:38 2016 (r298826) @@ -98,7 +98,7 @@ main(int (*openfirm)(void *)) char **bargv; /* - * Initalise the Open Firmware routines by giving them the entry point. + * Initialise the Open Firmware routines by giving them the entry point. */ OF_init(openfirm); Modified: head/sys/boot/pc98/boot0.5/disk.s ============================================================================== --- head/sys/boot/pc98/boot0.5/disk.s Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/pc98/boot0.5/disk.s Sat Apr 30 00:26:38 2016 (r298826) @@ -249,7 +249,7 @@ scsi_loop: movb %ah, %bl shlw %bx shlw %bx - addw $0x460, %bx # SCSI paramter block + addw $0x460, %bx # SCSI parameter block call read_biosparam orb %dl, %dl jz no_scsi_unit Modified: head/sys/boot/pc98/boot0.5/putssjis.s ============================================================================== --- head/sys/boot/pc98/boot0.5/putssjis.s Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/pc98/boot0.5/putssjis.s Sat Apr 30 00:26:38 2016 (r298826) @@ -33,7 +33,7 @@ # # Display string with Shift-JIS support - # %si: addres of string, %di: T-VRAM address, %cx: count + # %si: address of string, %di: T-VRAM address, %cx: count # # Absolute address of putssjis_entry must be 0x1243. Modified: head/sys/boot/pc98/boot0.5/support.s ============================================================================== --- head/sys/boot/pc98/boot0.5/support.s Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/pc98/boot0.5/support.s Sat Apr 30 00:26:38 2016 (r298826) @@ -55,7 +55,7 @@ read_biosparam: ret # -# Write one byte to BIOS paramter block +# Write one byte to BIOS parameter block # %bx offset # %dl value # Modified: head/sys/boot/uboot/fdt/uboot_fdt.c ============================================================================== --- head/sys/boot/uboot/fdt/uboot_fdt.c Fri Apr 29 23:55:22 2016 (r298825) +++ head/sys/boot/uboot/fdt/uboot_fdt.c Sat Apr 30 00:26:38 2016 (r298826) @@ -157,7 +157,7 @@ fdt_platform_fixups(void) if (n != 0) { /* - * Find the lenght of the interface id by + * Find the length of the interface id by * taking in to account the first 3 and * last 4 characters. */ From owner-svn-src-head@freebsd.org Sat Apr 30 00:33:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB0B5B20DC6; Sat, 30 Apr 2016 00:33:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::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 B02D01D35; Sat, 30 Apr 2016 00:33:25 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22c.google.com with SMTP id m9so33811225ige.1; Fri, 29 Apr 2016 17:33:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-transfer-encoding; bh=ZUa8iSVoebNC4vHGcTK/gW/b1JRclBtWPaHqgqj2wTc=; b=fflrlDco907tZnIpa/vU/0CNeFMmLoRFzCS6wz6RMACBl8M8n/6MxOhEPJY76yjFVa wgQgI05Rd3+eQulL+Isf2/h9WWWZqCBB9kRMp237PlfLWPz8G/wltECjyPwMpEvaTrlB Ivcv9XgDTyPvMnsPjKBmn5+vL8YLWeYLlpwQbhXADQH5u9vqRcI9j4Ixne2t1dRfkrzJ nLLJijQCeOaKuhILtP8P2of+GiSdLzBoAILs4Nrqil1QHg+BmTKhooIuDJ08PCJw8ykN SHRnwsP5RLjQOAhltN92kpeu6aZiP8KN3ndHNDoNTLtrSMZe/EDoEJU7VH2l3RFOMnjv pOGw== 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-transfer-encoding; bh=ZUa8iSVoebNC4vHGcTK/gW/b1JRclBtWPaHqgqj2wTc=; b=CTafwivg3mn6ckMFyWAWwAhWp9Z0Njm6tP/K6EZUEzsyOnIGUrcSkbDmpqcuDZUJnt V5vxLVCLfaE3Zq7+s5U/wAE5+Jxvro6PuTq6oAmFnpzcumruCC1vPqgOCZXSUlbyVU7m gNubmIuYHYe0KOnvLIAlENqVtFXS2E68c+amVnHhKAirgdHogn3/+1ecAWPtDrbPiQTg kKFbRH0ph17qJignm/Ol9bxXavMsYPSzSR1AlWP70W6aUYuAAQTK6LjsR3/xCEAEdXBf H7X1YkEcaJrjNdH3r2nmIhAWGDTsbMBrYrSivphZkfu09VhO1zy2Hdo1grrOSOfPPrLw owXg== X-Gm-Message-State: AOPr4FWVv7eppBEPNiQUPZRz4O+MRwRgzQmmtNeZ8UkxuYW91te/3mtLpqoBdBT5u01QQwACONa1UaHDWAmJnQ== MIME-Version: 1.0 X-Received: by 10.50.40.234 with SMTP id a10mr7932953igl.37.1461976405269; Fri, 29 Apr 2016 17:33:25 -0700 (PDT) Received: by 10.36.113.3 with HTTP; Fri, 29 Apr 2016 17:33:25 -0700 (PDT) In-Reply-To: References: <201604292214.u3TMEBNV044218@repo.freebsd.org> Date: Fri, 29 Apr 2016 17:33:25 -0700 Message-ID: Subject: Re: svn commit: r298818 - in head/sys: dev/bwi dev/if_ndis dev/iwi dev/malo dev/otus dev/ral dev/rtwn dev/urtwn dev/usb/wlan net80211 From: Adrian Chadd To: Andriy Voskoboinyk Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 00:33:26 -0000 Right -a On 29 April 2016 at 15:47, Andriy Voskoboinyk wrote: > Sat, 30 Apr 2016 01:38:32 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd > : > > hi, > > probably, IEEE80211_CHAN_BYTES should be uncommented too? > > >> hi, >> >> you should likely keep this as a macro: >> >> #define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) >> +#define IEEE80211_MODE_BYTES 2 /* >> howmany(IEEE80211_MODE_MAX, NBBY) */ >> >> .. or as a runtime assert so when we add 11ac modes, we don't forget >> to bump that. :) >> >> >> -a From owner-svn-src-head@freebsd.org Sat Apr 30 00:34:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEA6AB20EB3; Sat, 30 Apr 2016 00:34:05 +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 BF7721F31; Sat, 30 Apr 2016 00:34:05 +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 u3U0Y4x4090486; Sat, 30 Apr 2016 00:34:04 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U0Y45Y090485; Sat, 30 Apr 2016 00:34:04 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604300034.u3U0Y45Y090485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 00:34:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298827 - head/sys/compat/x86bios X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 00:34:06 -0000 Author: pfg Date: Sat Apr 30 00:34:04 2016 New Revision: 298827 URL: https://svnweb.freebsd.org/changeset/base/298827 Log: x86bios: spelling fix in a comment. No functional change. Modified: head/sys/compat/x86bios/x86bios.h Modified: head/sys/compat/x86bios/x86bios.h ============================================================================== --- head/sys/compat/x86bios/x86bios.h Sat Apr 30 00:26:38 2016 (r298826) +++ head/sys/compat/x86bios/x86bios.h Sat Apr 30 00:34:04 2016 (r298827) @@ -27,7 +27,7 @@ */ /* * x86 registers were borrowed from x86emu.h x86emu_regs.h - * for compatability. + * for compatibility. */ #ifndef _X86BIOS_H_ From owner-svn-src-head@freebsd.org Sat Apr 30 00:35:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E074B20FDB; Sat, 30 Apr 2016 00:35:48 +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 D3B1A1108; Sat, 30 Apr 2016 00:35:47 +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 u3U0ZlkH090623; Sat, 30 Apr 2016 00:35:47 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U0Zk9I090617; Sat, 30 Apr 2016 00:35:46 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604300035.u3U0Zk9I090617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 00:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298828 - head/sys/compat/ndis X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 00:35:48 -0000 Author: pfg Date: Sat Apr 30 00:35:46 2016 New Revision: 298828 URL: https://svnweb.freebsd.org/changeset/base/298828 Log: ndis: spelling fixes in comments. No functional change. Modified: head/sys/compat/ndis/kern_ndis.c head/sys/compat/ndis/ndis_var.h head/sys/compat/ndis/ntoskrnl_var.h head/sys/compat/ndis/subr_hal.c head/sys/compat/ndis/subr_ntoskrnl.c head/sys/compat/ndis/subr_pe.c Modified: head/sys/compat/ndis/kern_ndis.c ============================================================================== --- head/sys/compat/ndis/kern_ndis.c Sat Apr 30 00:34:04 2016 (r298827) +++ head/sys/compat/ndis/kern_ndis.c Sat Apr 30 00:35:46 2016 (r298828) @@ -717,7 +717,7 @@ ndis_ptom(m0, p) * send routine. * * NDIS packets consist of two parts: an ndis_packet structure, - * which is vaguely analagous to the pkthdr portion of an mbuf, + * which is vaguely analogous to the pkthdr portion of an mbuf, * and one or more ndis_buffer structures, which define the * actual memory segments in which the packet data resides. * We need to allocate one ndis_buffer for each mbuf in a chain, Modified: head/sys/compat/ndis/ndis_var.h ============================================================================== --- head/sys/compat/ndis/ndis_var.h Sat Apr 30 00:34:04 2016 (r298827) +++ head/sys/compat/ndis/ndis_var.h Sat Apr 30 00:35:46 2016 (r298828) @@ -1042,7 +1042,7 @@ struct ndis_request { uint32_t nr_bytesneeded; } ndis_set_information; } ndis_data; - /* NDIS 5.0 extentions */ + /* NDIS 5.0 extensions */ uint8_t nr_ndis_rsvd[9 * sizeof(void *)]; union { uint8_t nr_callmgr_rsvd[2 * sizeof(void *)]; @@ -1444,7 +1444,7 @@ struct ndis_miniport_characteristics { void * nmc_setinfo_func; void * nmc_transferdata_func; - /* NDIS 4.0 extentions */ + /* NDIS 4.0 extensions */ void * nmc_return_packet_func; void * nmc_sendmulti_func; @@ -1459,7 +1459,7 @@ struct ndis_miniport_characteristics { void * nmc_comultisend_func; void * nmc_corequest_func; - /* NDIS 5.1 extentions */ + /* NDIS 5.1 extensions */ void * nmc_canceltxpkts_handler; void * nmc_pnpevent_handler; Modified: head/sys/compat/ndis/ntoskrnl_var.h ============================================================================== --- head/sys/compat/ndis/ntoskrnl_var.h Sat Apr 30 00:34:04 2016 (r298827) +++ head/sys/compat/ndis/ntoskrnl_var.h Sat Apr 30 00:35:46 2016 (r298828) @@ -670,13 +670,13 @@ struct kuser_shared_data { * created and maintained by bus drivers. For example, the PCI * bus driver might detect two PCI ethernet cards on a given * bus. The PCI bus driver will then allocate two device_objects - * for its own internal bookeeping purposes. This is analagous + * for its own internal bookeeping purposes. This is analogous * to the device_t that the FreeBSD PCI code allocates and passes * into each PCI driver's probe and attach routines. * * When an ethernet driver claims one of the ethernet cards * on the bus, it will create its own device_object. This is - * the Functional Device Object. This object is analagous to the + * the Functional Device Object. This object is analogous to the * device-specific softc structure. */ @@ -962,7 +962,7 @@ struct io_stack_location { /* * There's a big-ass union here in the actual Windows - * definition of the stucture, but it contains stuff + * definition of the structure, but it contains stuff * that doesn't really apply to BSD, and defining it * all properly would require duplicating over a dozen * other structures that we'll never use. Since the Modified: head/sys/compat/ndis/subr_hal.c ============================================================================== --- head/sys/compat/ndis/subr_hal.c Sat Apr 30 00:34:04 2016 (r298827) +++ head/sys/compat/ndis/subr_hal.c Sat Apr 30 00:35:46 2016 (r298828) @@ -274,7 +274,7 @@ READ_PORT_BUFFER_UCHAR(port, val, cnt) * KeAcquireSpinLock() and KeReleaseSpinLock(), but these are just * macros that call KfAcquireSpinLock() and KfReleaseSpinLock(). * KefAcquireSpinLockAtDpcLevel() and KefReleaseSpinLockFromDpcLevel() - * perform the lock aquisition/release functions without doing the + * perform the lock acquisition/release functions without doing the * IRQL manipulation, and are used when one is already running at * DISPATCH_LEVEL. Make sense? Good. * Modified: head/sys/compat/ndis/subr_ntoskrnl.c ============================================================================== --- head/sys/compat/ndis/subr_ntoskrnl.c Sat Apr 30 00:34:04 2016 (r298827) +++ head/sys/compat/ndis/subr_ntoskrnl.c Sat Apr 30 00:35:46 2016 (r298828) @@ -722,7 +722,7 @@ IoGetDriverObjectExtension(drv, clid) /* * Sanity check. Our dummy bus drivers don't have - * any driver extentions. + * any driver extensions. */ if (drv->dro_driverext == NULL) Modified: head/sys/compat/ndis/subr_pe.c ============================================================================== --- head/sys/compat/ndis/subr_pe.c Sat Apr 30 00:34:04 2016 (r298827) +++ head/sys/compat/ndis/subr_pe.c Sat Apr 30 00:35:46 2016 (r298828) @@ -36,7 +36,7 @@ __FBSDID("$FreeBSD$"); /* * This file contains routines for relocating and dynamically linking * executable object code files in the Windows(r) PE (Portable Executable) - * format. In Windows, anything with a .EXE, .DLL or .SYS extention is + * format. In Windows, anything with a .EXE, .DLL or .SYS extension is * considered an executable, and all such files have some structures in * common. The PE format was apparently based largely on COFF but has * mutated significantly over time. We are mainly concerned with .SYS files, From owner-svn-src-head@freebsd.org Sat Apr 30 00:53:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F6C5B2135F; Sat, 30 Apr 2016 00:53:12 +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 1A65F1A6B; Sat, 30 Apr 2016 00:53:12 +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 u3U0rB3u096688; Sat, 30 Apr 2016 00:53:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U0rA4D096679; Sat, 30 Apr 2016 00:53:10 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604300053.u3U0rA4D096679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 00:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298829 - in head/sys/compat: linux linuxkpi/common/include/linux linuxkpi/common/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 00:53:12 -0000 Author: pfg Date: Sat Apr 30 00:53:10 2016 New Revision: 298829 URL: https://svnweb.freebsd.org/changeset/base/298829 Log: sys/compat/linux*: spelling fixes. Mostly on comments but there are some user-visible messages as well. MFC after: 2 weeks Modified: head/sys/compat/linux/check_internal_locks.d head/sys/compat/linux/linux_fork.c head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_socket.h head/sys/compat/linux/trace_futexes.d head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h head/sys/compat/linuxkpi/common/include/linux/dmapool.h head/sys/compat/linuxkpi/common/src/linux_radix.c head/sys/compat/linuxkpi/common/src/linux_usb.c Modified: head/sys/compat/linux/check_internal_locks.d ============================================================================== --- head/sys/compat/linux/check_internal_locks.d Sat Apr 30 00:35:46 2016 (r298828) +++ head/sys/compat/linux/check_internal_locks.d Sat Apr 30 00:53:10 2016 (r298829) @@ -64,7 +64,7 @@ linuxulator*:locks:futex_mtx:locked linuxulator*:locks:futex_mtx:unlock /check[probefunc] == 0/ { - printf("ERROR: unlock attemt of unlocked %s (%p),", probefunc, arg0); + printf("ERROR: unlock attempt of unlocked %s (%p),", probefunc, arg0); printf(" missing SDT probe in kernel, or dtrace program started"); printf(" while the %s was already held (race condition).", probefunc); printf(" Stack trace follows:"); Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Sat Apr 30 00:35:46 2016 (r298828) +++ head/sys/compat/linux/linux_fork.c Sat Apr 30 00:53:10 2016 (r298829) @@ -163,7 +163,7 @@ linux_clone_proc(struct thread *td, stru ff |= RFSIGSHARE; /* * XXX: In Linux, sharing of fs info (chroot/cwd/umask) - * and open files is independant. In FreeBSD, its in one + * and open files is independent. In FreeBSD, its in one * structure but in reality it does not cause any problems * because both of these flags are usually set together. */ Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Sat Apr 30 00:35:46 2016 (r298828) +++ head/sys/compat/linux/linux_misc.c Sat Apr 30 00:53:10 2016 (r298829) @@ -199,7 +199,7 @@ linux_alarm(struct thread *td, struct li #endif secs = args->secs; /* - * Linux alarm() is always successfull. Limit secs to INT32_MAX / 2 + * Linux alarm() is always successful. Limit secs to INT32_MAX / 2 * to match kern_setitimer()'s limit to avoid error from it. * * XXX. Linux limit secs to INT_MAX on 32 and does not limit on 64-bit Modified: head/sys/compat/linux/linux_socket.h ============================================================================== --- head/sys/compat/linux/linux_socket.h Sat Apr 30 00:35:46 2016 (r298828) +++ head/sys/compat/linux/linux_socket.h Sat Apr 30 00:53:10 2016 (r298829) @@ -79,7 +79,7 @@ struct l_cmsghdr { l_int cmsg_type; }; -/* Ancilliary data object information macros */ +/* Ancillary data object information macros */ #define LINUX_CMSG_ALIGN(len) roundup2(len, sizeof(l_ulong)) #define LINUX_CMSG_DATA(cmsg) ((void *)((char *)(cmsg) + \ Modified: head/sys/compat/linux/trace_futexes.d ============================================================================== --- head/sys/compat/linux/trace_futexes.d Sat Apr 30 00:35:46 2016 (r298828) +++ head/sys/compat/linux/trace_futexes.d Sat Apr 30 00:53:10 2016 (r298829) @@ -120,7 +120,7 @@ linuxulator*:locks:futex_mtx:locked linuxulator*:locks:futex_mtx:unlock /check[probefunc, arg0] == 0/ { - printf("ERROR: unlock attemt of unlocked %s (%p),", probefunc, arg0); + printf("ERROR: unlock attempt of unlocked %s (%p),", probefunc, arg0); printf(" missing SDT probe in kernel, or dtrace program started"); printf(" while the %s was already held (race condition).", probefunc); printf(" Stack trace follows:"); Modified: head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Sat Apr 30 00:35:46 2016 (r298828) +++ head/sys/compat/linuxkpi/common/include/linux/dma-mapping.h Sat Apr 30 00:53:10 2016 (r298829) @@ -115,7 +115,7 @@ dma_set_coherent_mask(struct device *dev if (!dma_supported(dev, mask)) return -EIO; - /* XXX Currently we don't support a seperate coherent mask. */ + /* XXX Currently we don't support a separate coherent mask. */ return 0; } Modified: head/sys/compat/linuxkpi/common/include/linux/dmapool.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/dmapool.h Sat Apr 30 00:35:46 2016 (r298828) +++ head/sys/compat/linuxkpi/common/include/linux/dmapool.h Sat Apr 30 00:53:10 2016 (r298829) @@ -50,7 +50,7 @@ dma_pool_create(char *name, struct devic pool = kmalloc(sizeof(*pool), GFP_KERNEL); align--; /* - * XXX Eventually this could use a seperate allocf to honor boundary + * XXX Eventually this could use a separate allocf to honor boundary * and physical address requirements of the device. */ pool->pool_zone = uma_zcreate(name, size, NULL, NULL, NULL, NULL, Modified: head/sys/compat/linuxkpi/common/src/linux_radix.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_radix.c Sat Apr 30 00:35:46 2016 (r298828) +++ head/sys/compat/linuxkpi/common/src/linux_radix.c Sat Apr 30 00:53:10 2016 (r298829) @@ -187,7 +187,7 @@ radix_tree_insert(struct radix_tree_root if (temp[idx] == NULL) { while(idx--) free(temp[idx], M_RADIX); - /* check if we should free the root node aswell */ + /* Check if we should free the root node as well. */ if (root->rnode->count == 0) { free(root->rnode, M_RADIX); root->rnode = NULL; Modified: head/sys/compat/linuxkpi/common/src/linux_usb.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_usb.c Sat Apr 30 00:35:46 2016 (r298828) +++ head/sys/compat/linuxkpi/common/src/linux_usb.c Sat Apr 30 00:53:10 2016 (r298829) @@ -649,7 +649,7 @@ done: * Return values: * 0: Success * < 0: Failure - * > 0: Acutal length + * > 0: Actual length *------------------------------------------------------------------------*/ int usb_control_msg(struct usb_device *dev, struct usb_host_endpoint *uhe, From owner-svn-src-head@freebsd.org Sat Apr 30 01:24:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4B04B21821; Sat, 30 Apr 2016 01:24:28 +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 61CBD16CC; Sat, 30 Apr 2016 01:24:28 +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 u3U1ORta006132; Sat, 30 Apr 2016 01:24:27 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U1OOUk006098; Sat, 30 Apr 2016 01:24:24 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604300124.u3U1OOUk006098@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 01:24:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298830 - in head/lib/libc: amd64/string iconv include locale nameser net posix1e regex resolv rpc sparc64/fpu stdio stdlib string sys tests/nss X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 01:24:28 -0000 Author: pfg Date: Sat Apr 30 01:24:24 2016 New Revision: 298830 URL: https://svnweb.freebsd.org/changeset/base/298830 Log: libc: spelling fixes. Mostly on comments. Modified: head/lib/libc/amd64/string/strcmp.S head/lib/libc/iconv/iconv-internal.h head/lib/libc/include/compat.h head/lib/libc/include/reentrant.h head/lib/libc/locale/collate.c head/lib/libc/locale/nl_langinfo.c head/lib/libc/nameser/ns_samedomain.c head/lib/libc/net/getaddrinfo.c head/lib/libc/net/gethostnamadr.c head/lib/libc/net/getnetnamadr.c head/lib/libc/net/name6.c head/lib/libc/net/nscachedcli.c head/lib/libc/net/res_config.h head/lib/libc/posix1e/acl_delete_entry.c head/lib/libc/posix1e/acl_support.c head/lib/libc/regex/regcomp.c head/lib/libc/resolv/res_comp.c head/lib/libc/resolv/res_findzonecut.c head/lib/libc/resolv/res_init.c head/lib/libc/rpc/README head/lib/libc/rpc/clnt_dg.c head/lib/libc/rpc/clnt_vc.c head/lib/libc/rpc/getnetconfig.c head/lib/libc/rpc/svc.c head/lib/libc/rpc/svc_simple.c head/lib/libc/rpc/svc_vc.c head/lib/libc/sparc64/fpu/fpu_reg.h head/lib/libc/stdio/vfscanf.c head/lib/libc/stdlib/heapsort.c head/lib/libc/stdlib/strfmon.c head/lib/libc/string/wcscoll.c head/lib/libc/sys/wait.2 head/lib/libc/tests/nss/getproto_test.c head/lib/libc/tests/nss/getrpc_test.c Modified: head/lib/libc/amd64/string/strcmp.S ============================================================================== --- head/lib/libc/amd64/string/strcmp.S Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/amd64/string/strcmp.S Sat Apr 30 01:24:24 2016 (r298830) @@ -29,7 +29,7 @@ ENTRY(strcmp) jmp .Ldone /* - * Check whether s2 is aligned to a word boundry. If it is, we + * Check whether s2 is aligned to a word boundary. If it is, we * can compare by words. Otherwise we have to compare by bytes. */ .Ls1aligned: Modified: head/lib/libc/iconv/iconv-internal.h ============================================================================== --- head/lib/libc/iconv/iconv-internal.h Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/iconv/iconv-internal.h Sat Apr 30 01:24:24 2016 (r298830) @@ -27,7 +27,7 @@ */ /* - * Interal prototypes for our back-end functions. + * Internal prototypes for our back-end functions. */ size_t __bsd___iconv(iconv_t, char **, size_t *, char **, size_t *, __uint32_t, size_t *); Modified: head/lib/libc/include/compat.h ============================================================================== --- head/lib/libc/include/compat.h Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/include/compat.h Sat Apr 30 01:24:24 2016 (r298830) @@ -28,7 +28,7 @@ */ /* - * This file defines compatiblity symbol versions for old system calls. It + * This file defines compatibility symbol versions for old system calls. It * is included in all generated system call files. */ Modified: head/lib/libc/include/reentrant.h ============================================================================== --- head/lib/libc/include/reentrant.h Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/include/reentrant.h Sat Apr 30 01:24:24 2016 (r298830) @@ -49,7 +49,7 @@ * One approach for thread safety is to provide discrete versions of the * library: one thread safe, the other not. The disadvantage of this is * that libc is rather large, and two copies of a library which are 99%+ - * identical is not an efficent use of resources. + * identical is not an efficient use of resources. * * Another approach is to provide a single thread safe library. However, * it should not add significant run time or code size overhead to non- Modified: head/lib/libc/locale/collate.c ============================================================================== --- head/lib/libc/locale/collate.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/locale/collate.c Sat Apr 30 01:24:24 2016 (r298830) @@ -322,7 +322,7 @@ _collate_lookup(struct xlocale_collate * *len = 1; /* - * Check for composites such as dipthongs that collate as a + * Check for composites such as diphthongs that collate as a * single element (aka chains or collating-elements). */ if (((p2 = chainsearch(table, t, &l)) != NULL) && Modified: head/lib/libc/locale/nl_langinfo.c ============================================================================== --- head/lib/libc/locale/nl_langinfo.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/locale/nl_langinfo.c Sat Apr 30 01:24:24 2016 (r298830) @@ -153,7 +153,7 @@ nl_langinfo_l(nl_item item, locale_t loc break; /* * YESSTR and NOSTR items marked with LEGACY are available, but not - * recomended by SUSv2 to be used in portable applications since + * recommended by SUSv2 to be used in portable applications since * they're subject to remove in future specification editions. */ case YESSTR: /* LEGACY */ Modified: head/lib/libc/nameser/ns_samedomain.c ============================================================================== --- head/lib/libc/nameser/ns_samedomain.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/nameser/ns_samedomain.c Sat Apr 30 01:24:24 2016 (r298830) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); * Check whether a name belongs to a domain. * * Inputs: - *\li a - the domain whose ancestory is being verified + *\li a - the domain whose ancestry is being verified *\li b - the potential ancestor we're checking against * * Return: Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/net/getaddrinfo.c Sat Apr 30 01:24:24 2016 (r298830) @@ -472,7 +472,7 @@ 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. + * occasions. */ switch (pai->ai_flags & (AI_ALL | AI_V4MAPPED)) { case AI_V4MAPPED: Modified: head/lib/libc/net/gethostnamadr.c ============================================================================== --- head/lib/libc/net/gethostnamadr.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/net/gethostnamadr.c Sat Apr 30 01:24:24 2016 (r298830) @@ -51,7 +51,7 @@ __FBSDID("$FreeBSD$"); static int gethostbyname_internal(const char *, int, struct hostent *, char *, size_t, struct hostent **, int *, res_state); -/* Host lookup order if nsswitch.conf is broken or nonexistant */ +/* Host lookup order if nsswitch.conf is broken or nonexistent */ static const ns_src default_src[] = { { NSSRC_FILES, NS_SUCCESS }, { NSSRC_DNS, NS_SUCCESS }, Modified: head/lib/libc/net/getnetnamadr.c ============================================================================== --- head/lib/libc/net/getnetnamadr.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/net/getnetnamadr.c Sat Apr 30 01:24:24 2016 (r298830) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #include "nscache.h" #endif -/* Network lookup order if nsswitch.conf is broken or nonexistant */ +/* Network lookup order if nsswitch.conf is broken or nonexistent */ static const ns_src default_src[] = { { NSSRC_FILES, NS_SUCCESS }, { NSSRC_DNS, NS_SUCCESS }, Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/net/name6.c Sat Apr 30 01:24:24 2016 (r298830) @@ -239,8 +239,8 @@ getipnodebyname(const char *name, int af /* * TODO: * Note that implementation dependent test for address - * configuration should be done everytime called - * (or apropriate interval), + * configuration should be done every time called + * (or appropriate interval), * because addresses will be dynamically assigned or deleted. */ _close(s); Modified: head/lib/libc/net/nscachedcli.c ============================================================================== --- head/lib/libc/net/nscachedcli.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/net/nscachedcli.c Sat Apr 30 01:24:24 2016 (r298830) @@ -95,7 +95,7 @@ safe_write(struct cached_connection_ *co /* * safe_read reads data from connection and tries to do it in the very safe - * and stable way. It uses kevent to ensure, that the data are availabe for + * and stable way. It uses kevent to ensure, that the data are available for * reading. If the amount of data to be read is too large, then they would * be splitted. */ Modified: head/lib/libc/net/res_config.h ============================================================================== --- head/lib/libc/net/res_config.h Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/net/res_config.h Sat Apr 30 01:24:24 2016 (r298830) @@ -2,5 +2,5 @@ #define DEBUG 1 /* enable debugging code (needed for dig) */ #define RESOLVSORT /* allow sorting of addresses in gethostbyname */ -#undef SUNSECURITY /* verify gethostbyaddr() calls - WE DONT NEED IT */ +#undef SUNSECURITY /* verify gethostbyaddr() calls - WE DON'T NEED IT */ #define MULTI_PTRS_ARE_ALIASES 1 /* fold multiple PTR records into aliases */ Modified: head/lib/libc/posix1e/acl_delete_entry.c ============================================================================== --- head/lib/libc/posix1e/acl_delete_entry.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/posix1e/acl_delete_entry.c Sat Apr 30 01:24:24 2016 (r298830) @@ -111,7 +111,7 @@ acl_delete_entry(acl_t acl, acl_entry_t sizeof(struct acl_entry)); acl->ats_cur_entry = 0; - /* Continue with the loop to remove all maching entries. */ + /* Continue with the loop to remove all matching entries. */ found = 1; } else i++; Modified: head/lib/libc/posix1e/acl_support.c ============================================================================== --- head/lib/libc/posix1e/acl_support.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/posix1e/acl_support.c Sat Apr 30 01:24:24 2016 (r298830) @@ -367,7 +367,7 @@ _posix1e_acl_add_entry(acl_t acl, acl_ta /* * Convert "old" type - ACL_TYPE_{ACCESS,DEFAULT}_OLD - into its "new" - * counterpart. It's neccessary for the old (pre-NFSv4 ACLs) binaries + * counterpart. It's necessary for the old (pre-NFSv4 ACLs) binaries * to work with new libc and kernel. Fixing 'type' for old binaries with * old libc and new kernel is being done by kern/vfs_acl.c:type_unold(). */ Modified: head/lib/libc/regex/regcomp.c ============================================================================== --- head/lib/libc/regex/regcomp.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/regex/regcomp.c Sat Apr 30 01:24:24 2016 (r298830) @@ -578,7 +578,7 @@ p_simp_re(struct parse *p, sopno subno; # define BACKSL (1<. if we get one as an * answer, that just means is a zone top, which is fine. Modified: head/lib/libc/resolv/res_init.c ============================================================================== --- head/lib/libc/resolv/res_init.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/resolv/res_init.c Sat Apr 30 01:24:24 2016 (r298830) @@ -144,7 +144,7 @@ static u_int32_t net_mask(struct in_addr * there will have precedence. Otherwise, the server address is set to * INADDR_ANY and the default domain name comes from the gethostname(). * - * An interrim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1 + * An interim version of this code (BIND 4.9, pre-4.4BSD) used 127.0.0.1 * rather than INADDR_ANY ("0.0.0.0") as the default name server address * since it was noted that INADDR_ANY actually meant ``the first interface * you "ifconfig"'d at boot time'' and if this was a SLIP or PPP interface, @@ -167,7 +167,7 @@ res_ninit(res_state statp) { return (__res_vinit(statp, 0)); } -/*% This function has to be reachable by res_data.c but not publically. */ +/*% This function has to be reachable by res_data.c but not publicly. */ int __res_vinit(res_state statp, int preinit) { FILE *fp; Modified: head/lib/libc/rpc/README ============================================================================== --- head/lib/libc/rpc/README Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/rpc/README Sat Apr 30 01:24:24 2016 (r298830) @@ -72,7 +72,7 @@ WHAT'S NEW IN THIS RELEASE: TIRPCSRC 2.3 The previous release was TIRPCSRC 2.0. 1. This release is based on Solaris 2.3. The previous release was - based on Solaris 2.0. This release contains a siginificant number of + based on Solaris 2.0. This release contains a significant number of bug fixes and other enhancements over TIRPCSRC 2.0. 2. The RPC library is thread safe for all client-side interfaces Modified: head/lib/libc/rpc/clnt_dg.c ============================================================================== --- head/lib/libc/rpc/clnt_dg.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/rpc/clnt_dg.c Sat Apr 30 01:24:24 2016 (r298830) @@ -582,7 +582,7 @@ get_reply: } } /* end successful completion */ /* - * If unsuccesful AND error is an authentication error + * If unsuccessful AND error is an authentication error * then refresh credentials and try again, else break */ else if (cu->cu_error.re_status == RPC_AUTHERROR) @@ -742,7 +742,7 @@ clnt_dg_control(CLIENT *cl, u_int reques /* * This RELIES on the information that, in the call body, * the version number field is the fifth field from the - * begining of the RPC header. MUST be changed if the + * beginning of the RPC header. MUST be changed if the * call_struct is changed */ *(u_int32_t *)info = @@ -759,7 +759,7 @@ clnt_dg_control(CLIENT *cl, u_int reques /* * This RELIES on the information that, in the call body, * the program number field is the fourth field from the - * begining of the RPC header. MUST be changed if the + * beginning of the RPC header. MUST be changed if the * call_struct is changed */ *(u_int32_t *)info = Modified: head/lib/libc/rpc/clnt_vc.c ============================================================================== --- head/lib/libc/rpc/clnt_vc.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/rpc/clnt_vc.c Sat Apr 30 01:24:24 2016 (r298830) @@ -601,7 +601,7 @@ clnt_vc_control(CLIENT *cl, u_int reques /* * This RELIES on the information that, in the call body, * the version number field is the fifth field from the - * begining of the RPC header. MUST be changed if the + * beginning of the RPC header. MUST be changed if the * call_struct is changed */ ntohlp(info, ct->ct_u.ct_mcallc + 4 * BYTES_PER_XDR_UNIT); @@ -615,7 +615,7 @@ clnt_vc_control(CLIENT *cl, u_int reques /* * This RELIES on the information that, in the call body, * the program number field is the fourth field from the - * begining of the RPC header. MUST be changed if the + * beginning of the RPC header. MUST be changed if the * call_struct is changed */ ntohlp(info, ct->ct_u.ct_mcallc + 3 * BYTES_PER_XDR_UNIT); Modified: head/lib/libc/rpc/getnetconfig.c ============================================================================== --- head/lib/libc/rpc/getnetconfig.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/rpc/getnetconfig.c Sat Apr 30 01:24:24 2016 (r298830) @@ -405,7 +405,7 @@ endnetconfig(void *handlep) } /* - * Noone needs these entries anymore, then frees them. + * No one needs these entries anymore, then frees them. * Make sure all info in netconfig_info structure has been reinitialized. */ q = ni.head; Modified: head/lib/libc/rpc/svc.c ============================================================================== --- head/lib/libc/rpc/svc.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/rpc/svc.c Sat Apr 30 01:24:24 2016 (r298830) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); * The services list * Each entry represents a set of procedures (an rpc program). * The dispatch routine takes request structs and runs the - * apropriate procedure. + * appropriate procedure. */ static struct svc_callout { struct svc_callout *sc_next; Modified: head/lib/libc/rpc/svc_simple.c ============================================================================== --- head/lib/libc/rpc/svc_simple.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/rpc/svc_simple.c Sat Apr 30 01:24:24 2016 (r298830) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); /* * This interface creates a virtual listener for all the services - * started thru rpc_reg(). It listens on the same endpoint for + * started through rpc_reg(). It listens on the same endpoint for * all the services and then executes the corresponding service * for the given prognum and procnum. */ @@ -229,7 +229,7 @@ rpc_reg(rpcprog_t prognum, rpcvers_t ver mutex_unlock(&proglst_lock); if (done == FALSE) { - warnx("%s cant find suitable transport for %s", + warnx("%s can't find suitable transport for %s", rpc_reg_msg, nettype); return (-1); } Modified: head/lib/libc/rpc/svc_vc.c ============================================================================== --- head/lib/libc/rpc/svc_vc.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/rpc/svc_vc.c Sat Apr 30 01:24:24 2016 (r298830) @@ -262,7 +262,7 @@ makefd_xprt(int fd, u_int sendsize, u_in xprt, read_vc, write_vc); xprt->xp_p1 = cd; xprt->xp_verf.oa_base = cd->verf_body; - svc_vc_ops(xprt); /* truely deals with calls */ + svc_vc_ops(xprt); /* truly deals with calls */ xprt->xp_port = 0; /* this is a connection, not a rendezvouser */ xprt->xp_fd = fd; if (__rpc_fd2sockinfo(fd, &si) && __rpc_sockinfo2netid(&si, &netid)) Modified: head/lib/libc/sparc64/fpu/fpu_reg.h ============================================================================== --- head/lib/libc/sparc64/fpu/fpu_reg.h Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/sparc64/fpu/fpu_reg.h Sat Apr 30 01:24:24 2016 (r298830) @@ -51,7 +51,7 @@ typedef void (fp_ldst64_fn)(u_int64_t *) /* * These are the functions that are actually used in the fpu emulation code to * access the fp registers. They are usually not used more than once, so - * cacheing needs not be done here. + * caching needs not be done here. */ static __inline u_int32_t __fpu_getreg(int r) Modified: head/lib/libc/stdio/vfscanf.c ============================================================================== --- head/lib/libc/stdio/vfscanf.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/stdio/vfscanf.c Sat Apr 30 01:24:24 2016 (r298830) @@ -864,7 +864,7 @@ doswitch: * z', but treats `a-a' as `the letter a, the * character -, and the letter a'. * - * For compatibility, the `-' is not considerd + * For compatibility, the `-' is not considered * to define a range if the character following * it is either a close bracket (required by ANSI) * or is not numerically greater than the character Modified: head/lib/libc/stdlib/heapsort.c ============================================================================== --- head/lib/libc/stdlib/heapsort.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/stdlib/heapsort.c Sat Apr 30 01:24:24 2016 (r298830) @@ -102,7 +102,7 @@ typedef DECLARE_BLOCK(int, heapsort_bloc * Select the top of the heap and 'heapify'. Since by far the most expensive * action is the call to the compar function, a considerable optimization * in the average case can be achieved due to the fact that k, the displaced - * elememt, is ususally quite small, so it would be preferable to first + * elememt, is usually quite small, so it would be preferable to first * heapify, always maintaining the invariant that the larger child is copied * over its parent's record. * Modified: head/lib/libc/stdlib/strfmon.c ============================================================================== --- head/lib/libc/stdlib/strfmon.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/stdlib/strfmon.c Sat Apr 30 01:24:24 2016 (r298830) @@ -50,7 +50,7 @@ __FBSDID("$FreeBSD$"); #define SIGN_POSN_USED 0x02 /* '+' or '(' usage flag */ #define LOCALE_POSN 0x04 /* use locale defined +/- (default) */ #define PARENTH_POSN 0x08 /* enclose negative amount in () */ -#define SUPRESS_CURR_SYMBOL 0x10 /* supress the currency from output */ +#define SUPRESS_CURR_SYMBOL 0x10 /* suppress the currency from output */ #define LEFT_JUSTIFY 0x20 /* left justify */ #define USE_INTL_CURRENCY 0x40 /* use international currency symbol */ #define IS_NEGATIVE 0x80 /* is argument value negative ? */ @@ -580,7 +580,7 @@ __format_grouped_double(double value, in } bufend = rslt + bufsize - 1; /* reserve space for trailing '\0' */ - /* skip spaces at beggining */ + /* skip spaces at beginning */ padded = 0; while (avalue[padded] == ' ') { padded++; Modified: head/lib/libc/string/wcscoll.c ============================================================================== --- head/lib/libc/string/wcscoll.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/string/wcscoll.c Sat Apr 30 01:24:24 2016 (r298830) @@ -65,7 +65,7 @@ wcscoll_l(const wchar_t *ws1, const wcha * safely. You absolutely have to run this pass by pass, * because some passes will be ignored for a given character, * while others will not. Simpler locales will benefit from - * having fewer passes, and most comparisions should resolve + * having fewer passes, and most comparisons should resolve * during the primary pass anyway. * * Note that we do one final extra pass at the end to pick Modified: head/lib/libc/sys/wait.2 ============================================================================== --- head/lib/libc/sys/wait.2 Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/sys/wait.2 Sat Apr 30 01:24:24 2016 (r298830) @@ -154,7 +154,7 @@ The separate and .Fa id arguments support many other types of -identifers in addition to process IDs and process group IDs. +identifiers in addition to process IDs and process group IDs. .Bl -bullet -offset indent .It If Modified: head/lib/libc/tests/nss/getproto_test.c ============================================================================== --- head/lib/libc/tests/nss/getproto_test.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/tests/nss/getproto_test.c Sat Apr 30 01:24:24 2016 (r298830) @@ -315,8 +315,8 @@ errfin: } /* protoent_check_ambiguity() is needed when one port+proto is associated with - * more than one peice (these cases are usually marked as PROBLEM in - * /etc/peices. This functions is needed also when one peice+proto is + * more than one piece (these cases are usually marked as PROBLEM in + * /etc/peices. This functions is needed also when one piece+proto is * associated with several ports. We have to check all the protoent structures * to make sure that pe really exists and correct */ static int Modified: head/lib/libc/tests/nss/getrpc_test.c ============================================================================== --- head/lib/libc/tests/nss/getrpc_test.c Sat Apr 30 00:53:10 2016 (r298829) +++ head/lib/libc/tests/nss/getrpc_test.c Sat Apr 30 01:24:24 2016 (r298830) @@ -317,8 +317,8 @@ errfin: } /* rpcent_check_ambiguity() is needed when one port+rpc is associated with - * more than one peice (these cases are usually marked as PROBLEM in - * /etc/peices. This functions is needed also when one peice+rpc is + * more than one piece (these cases are usually marked as PROBLEM in + * /etc/peices. This functions is needed also when one piece+rpc is * associated with several ports. We have to check all the rpcent structures * to make sure that rpc really exists and correct */ static int From owner-svn-src-head@freebsd.org Sat Apr 30 02:36:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D0A2B2067C; Sat, 30 Apr 2016 02:36:14 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (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 9E2B51FE4; Sat, 30 Apr 2016 02:36:13 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf0-f52.google.com with SMTP id y84so136774322lfc.0; Fri, 29 Apr 2016 19:36:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:cc:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=1wNN3DTjwQ8d0KFiFwSMK2snISoUTKi3Y4y/mz1FUuU=; b=l0X1tliN+lWDMsmJpTmSUmkS68yWBeI7uCrA6dspgOTGXf5iMoeHjDbRdlO4juZY81 VUNb2S3axmlRnNVjVFvBEKdaATEYW3rfa8V5o51DauB2TYPHmmDe4YH/4/UEcUN4kHm3 OpBVeYTFH6tBp0mpf1VC0Sf66vZWD9INSkE8tyxG+e5TU/fpAlj4vGfb32OALmMyJc+M /1XeZGTPUQnLnBZ30XNaP9wtYyAtkCvs4nfK2sqMzf2G07sNha7ExKWU/WYo+5w7P25/ doWMocFSSfzWfQdlzLTWdwe0PKH5LefK+RZPsB4GwXeHTSiZxGdpm1gkcA2kkmn7LEax F3/Q== X-Gm-Message-State: AOPr4FUym1LEOhM/cqZ074ebQFPcQ05vAqjTf8UsfKekkO/YYwq9XpFg1eUWkkjvKmAbeg== X-Received: by 10.25.158.149 with SMTP id h143mr9996655lfe.135.1461970031091; Fri, 29 Apr 2016 15:47:11 -0700 (PDT) Received: from localhost (host-176-37-109-22.la.net.ua. [176.37.109.22]) by smtp.gmail.com with ESMTPSA id a134sm3290802lfb.1.2016.04.29.15.47.09 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 29 Apr 2016 15:47:10 -0700 (PDT) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Adrian Chadd" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r298818 - in head/sys: dev/bwi dev/if_ndis dev/iwi dev/malo dev/otus dev/ral dev/rtwn dev/urtwn dev/usb/wlan net80211 References: <201604292214.u3TMEBNV044218@repo.freebsd.org> Date: Sat, 30 Apr 2016 01:47:07 +0300 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: User-Agent: Opera Mail/12.16 (FreeBSD) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 02:36:14 -0000 Sat, 30 Apr 2016 01:38:32 +0300 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Adrian Chadd = : hi, probably, IEEE80211_CHAN_BYTES should be uncommented too? > hi, > > you should likely keep this as a macro: > > #define IEEE80211_MODE_MAX (IEEE80211_MODE_QUARTER+1) > +#define IEEE80211_MODE_BYTES 2 /* > howmany(IEEE80211_MODE_MAX, NBBY) */ > > .. or as a runtime assert so when we add 11ac modes, we don't forget > to bump that. :) > > > -a From owner-svn-src-head@freebsd.org Sat Apr 30 02:47:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5C52B20962; Sat, 30 Apr 2016 02:47:42 +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 815A2151A; Sat, 30 Apr 2016 02:47:42 +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 u3U2lfZk029930; Sat, 30 Apr 2016 02:47:41 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U2lfNC029925; Sat, 30 Apr 2016 02:47:41 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604300247.u3U2lfNC029925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 02:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298831 - head/sys/boot/forth X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 02:47:42 -0000 Author: pfg Date: Sat Apr 30 02:47:41 2016 New Revision: 298831 URL: https://svnweb.freebsd.org/changeset/base/298831 Log: boot/forth: spelling fixes. Reviewed by: dteske MFC after: 2 weeks Modified: head/sys/boot/forth/delay.4th head/sys/boot/forth/loader.4th head/sys/boot/forth/loader.conf head/sys/boot/forth/menu.4th head/sys/boot/forth/support.4th Modified: head/sys/boot/forth/delay.4th ============================================================================== --- head/sys/boot/forth/delay.4th Sat Apr 30 01:24:24 2016 (r298830) +++ head/sys/boot/forth/delay.4th Sat Apr 30 02:47:41 2016 (r298831) @@ -66,7 +66,7 @@ only forth definitions also delay-proces false delay_showdots ! \ reset to zero and read from environment s" delay_showdots" getenv dup -1 <> if - 2drop \ don't need the value, just existance + 2drop \ don't need the value, just existence true delay_showdots ! else drop Modified: head/sys/boot/forth/loader.4th ============================================================================== --- head/sys/boot/forth/loader.4th Sat Apr 30 01:24:24 2016 (r298830) +++ head/sys/boot/forth/loader.4th Sat Apr 30 02:47:41 2016 (r298831) @@ -136,7 +136,7 @@ only forth definitions also support-func \ ***** start \ \ Initializes support.4th global variables, sets loader_conf_files, -\ processes conf files, and, if any one such file was succesfully +\ processes conf files, and, if any one such file was successfully \ read to the end, loads kernel and modules. : start ( -- ) ( throws: abort & user-defined ) @@ -144,7 +144,7 @@ only forth definitions also support-func include_conf_files include_nextboot_file \ Will *NOT* try to load kernel and modules if no configuration file - \ was succesfully loaded! + \ was successfully loaded! any_conf_read? if s" loader_delay" getenv -1 = if load_xen_throw Modified: head/sys/boot/forth/loader.conf ============================================================================== --- head/sys/boot/forth/loader.conf Sat Apr 30 01:24:24 2016 (r298830) +++ head/sys/boot/forth/loader.conf Sat Apr 30 02:47:41 2016 (r298831) @@ -159,7 +159,7 @@ module_path="/boot/modules" # Set the mo #kern.cam.boot_delay="10000" # Delay (in ms) of root mount for CAM bus # registration, useful for USB sticks as root #kern.cam.scsi_delay="2000" # Delay (in ms) before probing SCSI -#kern.ipc.maxsockets="" # Set the maximum number of sockets avaliable +#kern.ipc.maxsockets="" # Set the maximum number of sockets available #kern.ipc.nmbclusters="" # Set the number of mbuf clusters #kern.ipc.nsfbufs="" # Set the number of sendfile(2) bufs #net.inet.tcp.tcbhashsize="" # Set the value of TCBHASHSIZE Modified: head/sys/boot/forth/menu.4th ============================================================================== --- head/sys/boot/forth/menu.4th Sat Apr 30 01:24:24 2016 (r298830) +++ head/sys/boot/forth/menu.4th Sat Apr 30 02:47:41 2016 (r298831) @@ -282,7 +282,7 @@ also menu-infrastructure definitions ; \ This function parses $kernels into variables that are used by the menu to -\ display wich kernel to boot when the [overloaded] `boot' word is interpreted. +\ display which kernel to boot when the [overloaded] `boot' word is interpreted. \ Used internally by menu-create, you need not (nor should you) call this \ directly. \ @@ -790,7 +790,7 @@ also menu-infrastructure definitions again ; -: menu-erase ( -- ) \ Erases menu and resets positioning variable to positon 1. +: menu-erase ( -- ) \ Erases menu and resets positioning variable to position 1. \ Clear the screen area associated with the interactive menu menuX @ menuY @ Modified: head/sys/boot/forth/support.4th ============================================================================== --- head/sys/boot/forth/support.4th Sat Apr 30 01:24:24 2016 (r298830) +++ head/sys/boot/forth/support.4th Sat Apr 30 02:47:41 2016 (r298831) @@ -56,7 +56,7 @@ \ string conf_files configuration files to be loaded \ cell modules_options pointer to first module information \ value verbose? indicates if user wants a verbose loading -\ value any_conf_read? indicates if a conf file was succesfully read +\ value any_conf_read? indicates if a conf file was successfully read \ \ Other exported words: \ note, strlen is internal @@ -960,7 +960,7 @@ only forth also support-functions defini string current_file_name_ref \ used to print the file name -\ Indicates if any conf file was succesfully read +\ Indicates if any conf file was successfully read 0 value any_conf_read? @@ -1133,7 +1133,7 @@ string current_file_name_ref \ used to p then else after_load - load_succesful_message true \ Succesful, do not retry + load_succesful_message true \ Successful, do not retry then until ; @@ -1325,7 +1325,7 @@ also builtins \ 1. /boot/path \ 2. path \ -\ The module_path variable is overridden if load is succesful, by +\ The module_path variable is overridden if load is successful, by \ prepending the successful path. : load_from_directory ( path len 1 | flags len' path len 2 -- flag ) @@ -1412,7 +1412,7 @@ also builtins \ will first be tried as a full path, and, next, search on the \ directories pointed by module_path. \ -\ The module_path variable is overridden if load is succesful, by +\ The module_path variable is overridden if load is successful, by \ prepending the successful path. : load_directory_or_file ( path len 1 | flags len' path len 2 -- flag ) From owner-svn-src-head@freebsd.org Sat Apr 30 06:37:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 720B2AD9925; Sat, 30 Apr 2016 06:37: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 435C71FF3; Sat, 30 Apr 2016 06:37: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 u3U6bWnY001696; Sat, 30 Apr 2016 06:37:32 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U6bWSY001695; Sat, 30 Apr 2016 06:37:32 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604300637.u3U6bWSY001695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 Apr 2016 06:37:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298837 - head/etc/mtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 06:37:33 -0000 Author: bapt Date: Sat Apr 30 06:37:32 2016 New Revision: 298837 URL: https://svnweb.freebsd.org/changeset/base/298837 Log: Add sdiff test directory to the tests mtree Modified: head/etc/mtree/BSD.tests.dist Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sat Apr 30 06:35:20 2016 (r298836) +++ head/etc/mtree/BSD.tests.dist Sat Apr 30 06:37:32 2016 (r298837) @@ -608,6 +608,8 @@ .. printf .. + sdiff + .. sed regress.multitest.out .. From owner-svn-src-head@freebsd.org Sat Apr 30 06:48:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2B36AD9BEB; Sat, 30 Apr 2016 06:48:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9576D1865; Sat, 30 Apr 2016 06:48:49 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3U6mm2G005838; Sat, 30 Apr 2016 06:48:48 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U6mmlL005837; Sat, 30 Apr 2016 06:48:48 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201604300648.u3U6mmlL005837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Sat, 30 Apr 2016 06:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298838 - head/sys/contrib/dev/acpica/components/hardware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 06:48:49 -0000 Author: jkim Date: Sat Apr 30 06:48:48 2016 New Revision: 298838 URL: https://svnweb.freebsd.org/changeset/base/298838 Log: Revert AccessWidth/BitOffset support for AcpiHwWrite() and AcpiHwRead() for now. The following upstream commits are reverted from hwregs.c: https://github.com/acpica/acpica/commit/96ece05 https://github.com/acpica/acpica/commit/3d8583a https://github.com/acpica/acpica/commit/48eea5e https://github.com/acpica/acpica/commit/0a212c3 https://github.com/acpica/acpica/commit/41f6aef https://github.com/acpica/acpica/commit/26434b9 https://github.com/acpica/acpica/commit/c23034a https://github.com/acpica/acpica/commit/c49a751 Note this commit will be reverted when the upstream fixes the code properly. Modified: head/sys/contrib/dev/acpica/components/hardware/hwregs.c Modified: head/sys/contrib/dev/acpica/components/hardware/hwregs.c ============================================================================== --- head/sys/contrib/dev/acpica/components/hardware/hwregs.c Sat Apr 30 06:37:32 2016 (r298837) +++ head/sys/contrib/dev/acpica/components/hardware/hwregs.c Sat Apr 30 06:48:48 2016 (r298838) @@ -54,11 +54,6 @@ /* Local Prototypes */ -static UINT8 -AcpiHwGetAccessBitWidth ( - ACPI_GENERIC_ADDRESS *Reg, - UINT8 MaxBitWidth); - static ACPI_STATUS AcpiHwReadMultiple ( UINT32 *Value, @@ -76,43 +71,6 @@ AcpiHwWriteMultiple ( /****************************************************************************** * - * FUNCTION: AcpiHwGetAccessBitWidth - * - * PARAMETERS: Reg - GAS register structure - * MaxBitWidth - Max BitWidth supported (32 or 64) - * - * RETURN: Status - * - * DESCRIPTION: Obtain optimal access bit width - * - ******************************************************************************/ - -static UINT8 -AcpiHwGetAccessBitWidth ( - ACPI_GENERIC_ADDRESS *Reg, - UINT8 MaxBitWidth) -{ - - if (!Reg->AccessWidth) - { - if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_IO) - { - return (32); - } - else - { - return (MaxBitWidth); - } - } - else - { - return (1 << (Reg->AccessWidth + 2)); - } -} - - -/****************************************************************************** - * * FUNCTION: AcpiHwValidateRegister * * PARAMETERS: Reg - GAS register structure @@ -134,6 +92,7 @@ AcpiHwValidateRegister ( UINT64 *Address) { UINT8 BitWidth; + UINT8 BitEnd; UINT8 AccessWidth; @@ -176,8 +135,11 @@ AcpiHwValidateRegister ( /* Validate the BitWidth, convert AccessWidth into number of bits */ - AccessWidth = AcpiHwGetAccessBitWidth (Reg, MaxBitWidth); - BitWidth = ACPI_ROUND_UP (Reg->BitOffset + Reg->BitWidth, AccessWidth); + BitEnd = Reg->BitOffset + Reg->BitWidth; + AccessWidth = Reg->AccessWidth ? Reg->AccessWidth : 1; + AccessWidth = 1 << (AccessWidth + 2); + BitWidth = ACPI_ROUND_UP (BitEnd, AccessWidth) - + ACPI_ROUND_DOWN (Reg->BitOffset, AccessWidth); if (MaxBitWidth < BitWidth) { ACPI_WARNING ((AE_INFO, @@ -204,7 +166,10 @@ AcpiHwValidateRegister ( * 64-bit values is not needed. * * LIMITATIONS: + * BitWidth must be exactly 8, 16, or 32. * SpaceID must be SystemMemory or SystemIO. + * BitOffset and AccessWidth are currently ignored, as there has + * not been a need to implement these. * ******************************************************************************/ @@ -214,12 +179,7 @@ AcpiHwRead ( ACPI_GENERIC_ADDRESS *Reg) { UINT64 Address; - UINT8 AccessWidth; - UINT32 BitWidth; - UINT8 BitOffset; UINT64 Value64; - UINT32 Value32; - UINT8 Index; ACPI_STATUS Status; @@ -234,64 +194,30 @@ AcpiHwRead ( return (Status); } - /* - * Initialize entire 32-bit return value to zero, convert AccessWidth - * into number of bits based - */ + /* Initialize entire 32-bit return value to zero */ + *Value = 0; - AccessWidth = AcpiHwGetAccessBitWidth (Reg, 32); - BitWidth = Reg->BitOffset + Reg->BitWidth; - BitOffset = Reg->BitOffset; /* * Two address spaces supported: Memory or IO. PCI_Config is * not supported here because the GAS structure is insufficient */ - Index = 0; - while (BitWidth) + if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) { - if (BitOffset > AccessWidth) - { - Value32 = 0; - BitOffset -= AccessWidth; - } - else - { - if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) - { - Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS) - Address + Index * ACPI_DIV_8 (AccessWidth), - &Value64, AccessWidth); - Value32 = (UINT32) Value64; - } - else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ - { - Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) - Address + Index * ACPI_DIV_8 (AccessWidth), - &Value32, AccessWidth); - } - - if (BitOffset) - { - Value32 &= ACPI_MASK_BITS_BELOW (BitOffset); - BitOffset = 0; - } - if (BitWidth < AccessWidth) - { - Value32 &= ACPI_MASK_BITS_ABOVE (BitWidth); - } - } + Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS) + Address, &Value64, Reg->BitWidth); - ACPI_SET_BITS (Value, Index * AccessWidth, - ACPI_MASK_BITS_ABOVE_32 (AccessWidth), Value32); - - BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth; - Index++; + *Value = (UINT32) Value64; + } + else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ + { + Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) + Address, Value, Reg->BitWidth); } ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Read: %8.8X width %2d from %8.8X%8.8X (%s)\n", - *Value, AccessWidth, ACPI_FORMAT_UINT64 (Address), + *Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId))); return (Status); @@ -319,12 +245,6 @@ AcpiHwWrite ( ACPI_GENERIC_ADDRESS *Reg) { UINT64 Address; - UINT8 AccessWidth; - UINT32 BitWidth; - UINT8 BitOffset; - UINT64 Value64; - UINT32 NewValue32, OldValue32; - UINT8 Index; ACPI_STATUS Status; @@ -339,109 +259,24 @@ AcpiHwWrite ( return (Status); } - /* Convert AccessWidth into number of bits based */ - - AccessWidth = AcpiHwGetAccessBitWidth (Reg, 32); - BitWidth = Reg->BitOffset + Reg->BitWidth; - BitOffset = Reg->BitOffset; - /* * Two address spaces supported: Memory or IO. PCI_Config is * not supported here because the GAS structure is insufficient */ - Index = 0; - while (BitWidth) + if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) { - NewValue32 = ACPI_GET_BITS (&Value, Index * AccessWidth, - ACPI_MASK_BITS_ABOVE_32 (AccessWidth)); - - if (BitOffset > AccessWidth) - { - BitOffset -= AccessWidth; - } - else - { - if (BitOffset) - { - NewValue32 &= ACPI_MASK_BITS_BELOW (BitOffset); - } - - if (BitWidth < AccessWidth) - { - NewValue32 &= ACPI_MASK_BITS_ABOVE (BitWidth); - } - - if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY) - { - if (BitOffset || BitWidth < AccessWidth) - { - /* - * Read old values in order not to modify the bits that - * are beyond the register BitWidth/BitOffset setting. - */ - Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS) - Address + Index * ACPI_DIV_8 (AccessWidth), - &Value64, AccessWidth); - OldValue32 = (UINT32) Value64; - - if (BitOffset) - { - OldValue32 &= ACPI_MASK_BITS_ABOVE (BitOffset + 1); - BitOffset = 0; - } - - if (BitWidth < AccessWidth) - { - OldValue32 &= ACPI_MASK_BITS_BELOW (BitWidth - 1); - } - - NewValue32 |= OldValue32; - } - - Value64 = (UINT64) NewValue32; - Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) - Address + Index * ACPI_DIV_8 (AccessWidth), - Value64, AccessWidth); - } - else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ - { - if (BitOffset || BitWidth < AccessWidth) - { - /* - * Read old values in order not to modify the bits that - * are beyond the register BitWidth/BitOffset setting. - */ - Status = AcpiHwReadPort ((ACPI_IO_ADDRESS) - Address + Index * ACPI_DIV_8 (AccessWidth), - &OldValue32, AccessWidth); - - if (BitOffset) - { - OldValue32 &= ACPI_MASK_BITS_ABOVE (BitOffset + 1); - BitOffset = 0; - } - - if (BitWidth < AccessWidth) - { - OldValue32 &= ACPI_MASK_BITS_BELOW (BitWidth - 1); - } - - NewValue32 |= OldValue32; - } - - Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) - Address + Index * ACPI_DIV_8 (AccessWidth), - NewValue32, AccessWidth); - } - } - - BitWidth -= BitWidth > AccessWidth ? AccessWidth : BitWidth; - Index++; + Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS) + Address, (UINT64) Value, Reg->BitWidth); + } + else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */ + { + Status = AcpiHwWritePort ((ACPI_IO_ADDRESS) + Address, Value, Reg->BitWidth); } ACPI_DEBUG_PRINT ((ACPI_DB_IO, "Wrote: %8.8X width %2d to %8.8X%8.8X (%s)\n", - Value, AccessWidth, ACPI_FORMAT_UINT64 (Address), + Value, Reg->BitWidth, ACPI_FORMAT_UINT64 (Address), AcpiUtGetRegionName (Reg->SpaceId))); return (Status); From owner-svn-src-head@freebsd.org Sat Apr 30 09:13:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81061B0FB5B; Sat, 30 Apr 2016 09:13:27 +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 53280195E; Sat, 30 Apr 2016 09:13: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 u3U9DQZF051581; Sat, 30 Apr 2016 09:13:26 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U9DQOk051580; Sat, 30 Apr 2016 09:13:26 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604300913.u3U9DQOk051580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Apr 2016 09:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298839 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 09:13:27 -0000 Author: ngie Date: Sat Apr 30 09:13:26 2016 New Revision: 298839 URL: https://svnweb.freebsd.org/changeset/base/298839 Log: Fix memory allocation edgecases in kvm_argv(..) - Don't leak nbufp on realloc failure in kvm_argv - Catch malloc errors with bufp - Set buflen last in the "buflen == 0" case to ensure that bufp/nbufp is properly reallocated on the next go around Differential Revision: https://reviews.freebsd.org/D6051 MFC after: 1 week Reviewed by: jhb, markj Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libkvm/kvm_proc.c Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Sat Apr 30 06:48:48 2016 (r298838) +++ head/lib/libkvm/kvm_proc.c Sat Apr 30 09:13:26 2016 (r298839) @@ -666,6 +666,7 @@ kvm_argv(kvm_t *kd, const struct kinfo_p static char *buf, *p; static char **bufp; static int argc; + char **nbufp; if (!ISALIVE(kd)) { _kvm_err(kd, kd->program, @@ -681,9 +682,15 @@ kvm_argv(kvm_t *kd, const struct kinfo_p _kvm_err(kd, kd->program, "cannot allocate memory"); return (NULL); } - buflen = nchr; argc = 32; bufp = malloc(sizeof(char *) * argc); + if (bufp == NULL) { + free(buf); + buf = NULL; + _kvm_err(kd, kd->program, "cannot allocate memory"); + return (NULL); + } + buflen = nchr; } else if (nchr > buflen) { p = realloc(buf, nchr); if (p != NULL) { @@ -716,8 +723,10 @@ kvm_argv(kvm_t *kd, const struct kinfo_p p += strlen(p) + 1; if (i >= argc) { argc += argc; - bufp = realloc(bufp, - sizeof(char *) * argc); + nbufp = realloc(bufp, sizeof(char *) * argc); + if (nbufp == NULL) + return (NULL); + bufp = nbufp; } } while (p < buf + bufsz); bufp[i++] = 0; From owner-svn-src-head@freebsd.org Sat Apr 30 09:21:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89E7DB0FC06; Sat, 30 Apr 2016 09:21:15 +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 39F071BA2; Sat, 30 Apr 2016 09:21:15 +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 u3U9LEtK053844; Sat, 30 Apr 2016 09:21:14 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U9LExR053840; Sat, 30 Apr 2016 09:21:14 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604300921.u3U9LExR053840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Apr 2016 09:21:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298840 - in head: . lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 09:21:15 -0000 Author: ngie Date: Sat Apr 30 09:21:13 2016 New Revision: 298840 URL: https://svnweb.freebsd.org/changeset/base/298840 Log: Remove kvm_getfiles(3) This libcall has been broken since (at least) r174989/8.0-RELEASE. Bump SHLIB_MAJOR for the change Differential Revision: https://reviews.freebsd.org/D6052 Relnotes: yes Reviewed by: jhb, markj Sponsored by: EMC / Isilon Storage Division Deleted: head/lib/libkvm/kvm_file.c head/lib/libkvm/kvm_getfiles.3 Modified: head/ObsoleteFiles.inc head/lib/libkvm/Makefile head/lib/libkvm/kvm.3 head/lib/libkvm/kvm.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Apr 30 09:13:26 2016 (r298839) +++ head/ObsoleteFiles.inc Sat Apr 30 09:21:13 2016 (r298840) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20160430: kvm_getfiles(3) removed from kvm(3) +OLD_LIBS+=usr/lib/libkvm.so.6 +OLD_FILES+=usr/share/man/man3/kvm_getfiles.3.gz # 20160423: remove mroute6d OLD_FILES+=etc/rc.d/mroute6d # 20160419: rename units.lib -> definitions.units Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Sat Apr 30 09:13:26 2016 (r298839) +++ head/lib/libkvm/Makefile Sat Apr 30 09:21:13 2016 (r298840) @@ -5,12 +5,12 @@ PACKAGE=lib${LIB} LIB= kvm SHLIBDIR?= /lib -SHLIB_MAJOR= 6 +SHLIB_MAJOR= 7 CFLAGS+=-DLIBC_SCCS -I${.CURDIR} WARNS?= 3 -SRCS= kvm.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ +SRCS= kvm.c kvm_cptime.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c \ kvm_minidump_aarch64.c \ kvm_amd64.c kvm_minidump_amd64.c \ @@ -23,7 +23,7 @@ INCS= kvm.h LIBADD= elf -MAN= kvm.3 kvm_getcptime.3 kvm_geterr.3 kvm_getfiles.3 kvm_getloadavg.3 \ +MAN= kvm.3 kvm_getcptime.3 kvm_geterr.3 kvm_getloadavg.3 \ kvm_getpcpu.3 kvm_getprocs.3 kvm_getswapinfo.3 kvm_native.3 \ kvm_nlist.3 kvm_open.3 kvm_read.3 Modified: head/lib/libkvm/kvm.3 ============================================================================== --- head/lib/libkvm/kvm.3 Sat Apr 30 09:13:26 2016 (r298839) +++ head/lib/libkvm/kvm.3 Sat Apr 30 09:21:13 2016 (r298840) @@ -32,7 +32,7 @@ .\" @(#)kvm.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd November 27, 2015 +.Dd April 30, 2016 .Dt KVM 3 .Os .Sh NAME @@ -144,7 +144,6 @@ and .Xr kvm_getargv 3 , .Xr kvm_getenvv 3 , .Xr kvm_geterr 3 , -.Xr kvm_getfiles 3 , .Xr kvm_getloadavg 3 , .Xr kvm_getprocs 3 , .Xr kvm_getswapinfo 3 , Modified: head/lib/libkvm/kvm.h ============================================================================== --- head/lib/libkvm/kvm.h Sat Apr 30 09:13:26 2016 (r298839) +++ head/lib/libkvm/kvm.h Sat Apr 30 09:21:13 2016 (r298840) @@ -82,7 +82,6 @@ char **kvm_getargv(kvm_t *, const struct int kvm_getcptime(kvm_t *, long *); char **kvm_getenvv(kvm_t *, const struct kinfo_proc *, int); char *kvm_geterr(kvm_t *); -char *kvm_getfiles(kvm_t *, int, int, int *); int kvm_getloadavg(kvm_t *, double [], int); int kvm_getmaxcpu(kvm_t *); int kvm_getncpus(kvm_t *); From owner-svn-src-head@freebsd.org Sat Apr 30 09:31:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49768B0FD89; Sat, 30 Apr 2016 09:31: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 1BF8A104B; Sat, 30 Apr 2016 09:31: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 u3U9V1FL054944; Sat, 30 Apr 2016 09:31:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U9V1CJ054943; Sat, 30 Apr 2016 09:31:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604300931.u3U9V1CJ054943@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Apr 2016 09:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298841 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 09:31:02 -0000 Author: ngie Date: Sat Apr 30 09:31:01 2016 New Revision: 298841 URL: https://svnweb.freebsd.org/changeset/base/298841 Log: Remove a -Wunused-but-set-variable variable -- `pa` Reported by: gcc 5.x Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libkvm/kvm_sparc64.c Modified: head/lib/libkvm/kvm_sparc64.c ============================================================================== --- head/lib/libkvm/kvm_sparc64.c Sat Apr 30 09:21:13 2016 (r298840) +++ head/lib/libkvm/kvm_sparc64.c Sat Apr 30 09:31:01 2016 (r298841) @@ -134,7 +134,6 @@ _sparc64_initvtop(kvm_t *kd) struct sparc64_dump_reg *regs; struct vmstate *vm; size_t regsz; - uint64_t pa; int i; vm = (struct vmstate *)_kvm_malloc(kd, sizeof(*vm)); @@ -151,7 +150,6 @@ _sparc64_initvtop(kvm_t *kd) hdr.dh_tsb_size = be64toh(hdr.dh_tsb_size); hdr.dh_tsb_mask = be64toh(hdr.dh_tsb_mask); hdr.dh_nregions = be32toh(hdr.dh_nregions); - pa = hdr.dh_tsb_pa; regsz = hdr.dh_nregions * sizeof(*regs); regs = _kvm_malloc(kd, regsz); From owner-svn-src-head@freebsd.org Sat Apr 30 09:32:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA8B4B0FEF4; Sat, 30 Apr 2016 09:32:20 +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 8B40B12AE; Sat, 30 Apr 2016 09:32:20 +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 u3U9WJhS057614; Sat, 30 Apr 2016 09:32:19 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U9WJDd057613; Sat, 30 Apr 2016 09:32:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604300932.u3U9WJDd057613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Apr 2016 09:32:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298842 - head/lib/libkvm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 09:32:20 -0000 Author: ngie Date: Sat Apr 30 09:32:19 2016 New Revision: 298842 URL: https://svnweb.freebsd.org/changeset/base/298842 Log: Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails MFC after: 1 week Reported by: Coverity CID: 1341474 Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libkvm/kvm_amd64.c Modified: head/lib/libkvm/kvm_amd64.c ============================================================================== --- head/lib/libkvm/kvm_amd64.c Sat Apr 30 09:31:01 2016 (r298841) +++ head/lib/libkvm/kvm_amd64.c Sat Apr 30 09:32:19 2016 (r298842) @@ -159,6 +159,7 @@ _amd64_initvtop(kvm_t *kd) } if (kvm_read2(kd, pa, PML4, AMD64_PAGE_SIZE) != AMD64_PAGE_SIZE) { _kvm_err(kd, kd->program, "cannot read KPML4phys"); + free(PML4); return (-1); } kd->vmst->PML4 = PML4; From owner-svn-src-head@freebsd.org Sat Apr 30 09:50:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E744DAD9230; Sat, 30 Apr 2016 09:50:09 +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 B95961B92; Sat, 30 Apr 2016 09:50:09 +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 u3U9o8D6060948; Sat, 30 Apr 2016 09:50:08 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3U9o8pk060946; Sat, 30 Apr 2016 09:50:08 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604300950.u3U9o8pk060946@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Apr 2016 09:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298844 - 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 09:50:10 -0000 Author: ngie Date: Sat Apr 30 09:50:08 2016 New Revision: 298844 URL: https://svnweb.freebsd.org/changeset/base/298844 Log: Make SERVERS REQUIRE clean when MK_KERBEROS==no Make kdc run BEFORE SERVERS instead of being REQUIREd by SERVERS, so systems that pedantically check REQUIREs function after r270782 MFC after: 1 week X-MFC with: r270782 Sponsored by: EMC / Isilon Storage Division Modified: head/etc/rc.d/SERVERS head/etc/rc.d/kdc Modified: head/etc/rc.d/SERVERS ============================================================================== --- head/etc/rc.d/SERVERS Sat Apr 30 09:43:01 2016 (r298843) +++ head/etc/rc.d/SERVERS Sat Apr 30 09:50:08 2016 (r298844) @@ -4,7 +4,7 @@ # # PROVIDE: SERVERS -# REQUIRE: mountcritremote abi ldconfig savecore watchdogd kdc +# REQUIRE: mountcritremote abi ldconfig savecore watchdogd # This is a dummy dependency, for early-start servers relying on # some basic configuration. Modified: head/etc/rc.d/kdc ============================================================================== --- head/etc/rc.d/kdc Sat Apr 30 09:43:01 2016 (r298843) +++ head/etc/rc.d/kdc Sat Apr 30 09:50:08 2016 (r298844) @@ -5,6 +5,7 @@ # PROVIDE: kdc # REQUIRE: NETWORKING +# BEFORE: SERVERS # KEYWORD: shutdown . /etc/rc.subr From owner-svn-src-head@freebsd.org Sat Apr 30 10:35:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40BDAAD9A05; Sat, 30 Apr 2016 10:35:46 +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 97D231D44; Sat, 30 Apr 2016 10:35:45 +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 u3UAZiiV075563; Sat, 30 Apr 2016 10:35:44 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UAZhaU075544; Sat, 30 Apr 2016 10:35:43 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201604301035.u3UAZhaU075544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 30 Apr 2016 10:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298845 - in head: contrib/subversion contrib/subversion/subversion/include contrib/subversion/subversion/libsvn_client contrib/subversion/subversion/libsvn_diff contrib/subversion/subv... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 10:35:46 -0000 Author: dim Date: Sat Apr 30 10:35:42 2016 New Revision: 298845 URL: https://svnweb.freebsd.org/changeset/base/298845 Log: Update from subversion 1.9.2 to 1.9.4. This contains only bug fixes, no new features. The repository format is also unchanged from 1.9.2. Full list of changes between 1.9.4 and earlier versions: https://svn.apache.org/repos/asf/subversion/tags/1.9.4/CHANGES Note that the two security issues fixed in 1.9.4 (CVE-2016-2167 and CVE-2016-2168) do not affect the version of Subversion in the FreeBSD base system, since neither SASL nor Apache modules are enabled. Relnotes: yes MFC after: 2 weeks Modified: head/contrib/subversion/CHANGES head/contrib/subversion/INSTALL head/contrib/subversion/Makefile.in head/contrib/subversion/NOTICE head/contrib/subversion/build-outputs.mk head/contrib/subversion/configure head/contrib/subversion/subversion/include/svn_client.h head/contrib/subversion/subversion/include/svn_config.h head/contrib/subversion/subversion/include/svn_fs.h head/contrib/subversion/subversion/include/svn_version.h head/contrib/subversion/subversion/libsvn_client/externals.c head/contrib/subversion/subversion/libsvn_client/merge.c head/contrib/subversion/subversion/libsvn_client/patch.c head/contrib/subversion/subversion/libsvn_diff/binary_diff.c head/contrib/subversion/subversion/libsvn_fs_base/dag.c head/contrib/subversion/subversion/libsvn_fs_base/fs.h head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c head/contrib/subversion/subversion/libsvn_fs_fs/dag.c head/contrib/subversion/subversion/libsvn_fs_fs/fs.h head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c head/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.h head/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h head/contrib/subversion/subversion/libsvn_fs_fs/transaction.c head/contrib/subversion/subversion/libsvn_fs_fs/tree.c head/contrib/subversion/subversion/libsvn_fs_x/rep-cache-db.h head/contrib/subversion/subversion/libsvn_ra_local/ra_plugin.c head/contrib/subversion/subversion/libsvn_ra_serf/commit.c head/contrib/subversion/subversion/libsvn_ra_serf/inherited_props.c head/contrib/subversion/subversion/libsvn_ra_serf/merge.c head/contrib/subversion/subversion/libsvn_ra_serf/multistatus.c head/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h head/contrib/subversion/subversion/libsvn_ra_serf/replay.c head/contrib/subversion/subversion/libsvn_ra_serf/serf.c head/contrib/subversion/subversion/libsvn_ra_serf/util.c head/contrib/subversion/subversion/libsvn_ra_svn/client.c head/contrib/subversion/subversion/libsvn_ra_svn/deprecated.c head/contrib/subversion/subversion/libsvn_ra_svn/marshal.c head/contrib/subversion/subversion/libsvn_repos/dump.c head/contrib/subversion/subversion/libsvn_repos/log.c head/contrib/subversion/subversion/libsvn_repos/repos.c head/contrib/subversion/subversion/libsvn_subr/auth.c head/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c head/contrib/subversion/subversion/libsvn_subr/eol.c head/contrib/subversion/subversion/libsvn_subr/gpg_agent.c head/contrib/subversion/subversion/libsvn_subr/internal_statements.h head/contrib/subversion/subversion/libsvn_subr/prompt.c head/contrib/subversion/subversion/libsvn_subr/sqlite.c head/contrib/subversion/subversion/libsvn_subr/string.c head/contrib/subversion/subversion/libsvn_subr/utf_validate.c head/contrib/subversion/subversion/libsvn_subr/version.c head/contrib/subversion/subversion/libsvn_wc/deprecated.c head/contrib/subversion/subversion/libsvn_wc/wc-checks.h head/contrib/subversion/subversion/libsvn_wc/wc-metadata.h head/contrib/subversion/subversion/libsvn_wc/wc-queries.h head/contrib/subversion/subversion/libsvn_wc/wc-queries.sql head/contrib/subversion/subversion/libsvn_wc/wc_db_pristine.c head/contrib/subversion/subversion/svn/conflict-callbacks.c head/contrib/subversion/subversion/svn/diff-cmd.c head/contrib/subversion/subversion/svn/lock-cmd.c head/contrib/subversion/subversion/svn/unlock-cmd.c head/contrib/subversion/subversion/svnlook/svnlook.c head/contrib/subversion/subversion/svnserve/cyrus_auth.c head/contrib/subversion/win-tests.py head/usr.bin/svn/Makefile.inc head/usr.bin/svn/svn_private_config.h Directory Properties: head/contrib/subversion/ (props changed) Modified: head/contrib/subversion/CHANGES ============================================================================== --- head/contrib/subversion/CHANGES Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/CHANGES Sat Apr 30 10:35:42 2016 (r298845) @@ -1,3 +1,91 @@ +Version 1.9.4 +(28 Apr 2016, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.4 + + User-visible changes: + - Client-side bugfixes: + * diff: support '--summarize --ignore-properties' (part of issue #4567) + * checkout: fix performance regression on NFS (r1710167) + * gpg-agent: properly handle passwords with percent characters (issue #4611) + * svn-graph.pl: fix assertion about a non-canonical path (r1729060 et al) + * hot-backup.py: better input validation (r1721174, r1721175) + * commit: abort on Ctrl-C in plaintext password prompt (issue #4624) + * diff: produce proper forward binary diffs with --git (r1704292, r1704573) + * ra_serf: fix deleting directories with many files (issue #4557) + + - Server-side bugfixes: + * improve documentation for AuthzSVNGroupsFile and groups-db (r1730856) + * fsfs: reduce peak memory usage when listing large directories (r1725180) + * fsfs: fix a rare source of incomplete dump files and reports (r1717876) + + - Client-side and server-side bugfixes: + * update INSTALL documentation file (r1703470 et al) + * fix potential memory access bugs (r1722860 et al) + * fix potential out of bounds read in svn_repos_get_logs5() (r1738259) + + - Bindings bugfixes: + * ignore absent nodes in javahl version of svn status -u (r1720643) + + Developer-visible changes: + - General: + * fix ruby test suite to work with test-unit gem (r1714790) + * allow building against KDE4 without conflict with KDE5 (r1734926) + * fix update_tests.py#76 with SVNPathAuthz short_circuit (r1736432) + * build system tweaks: + * tweak how symbolic error names in maintainer mode (r1735179) + * fix inconsistent behavior of inherited property API (r1717874 et al) + + - API changes: + * properly interpret parameters in svn_wc_get_diff_editor6() (r1728308) + + +Version 1.9.3 +(15 Dec 2015, from /branches/1.9.x) +http://svn.apache.org/repos/asf/subversion/tags/1.9.3 + + User-visible changes: + - Client-side bugfixes: + * svn: fix possible crash in auth credentials cache (r1705328) + * cleanup: avoid unneeded memory growth during pristine cleanup (r1706241) + * diff: fix crash when repository is on server root (r1705060 et al) + * fix translations for commit notifications (r1709389, r1709562) + * ra_serf: fix crash in multistatus parser (r1706323, r1706324) + * svn: report lock/unlock errors as failures (r1701598 et al) + * svn: cleanup user deleted external registrations (r1705843, r1710558) + * svn: allow simple resolving of binary file text conflicts (r1703581) + * svnlook: properly remove tempfiles on diff errors (r1711346) + * ra_serf: report built- and run-time versions of libserf (r1704847) + * ra_serf: set Content-Type header in outgoing requests (r1715224 et al) + * svn: fix merging deletes of svn:eol-style CRLF/CR files (r1703689 et al) + * ra_local: disable zero-copy code path (r1718167) + + - Server-side bugfixes: + * mod_dav_svn: fix heap overflow with skel-encoded requests (CVE-2015-5343) + * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602) + * mod_dav_svn: fix display of process ID in cache statistics (r1709553) + * mod_dav_svn: use LimitXMLRequestBody for skel-encoded requests (r1687812) + * svnadmin dump: preserve no-op changes (r1709388 et al, issue #4598) + * fsfs: avoid unneeded I/O when opening transactions (r1715793) + + - Client-side and server-side bugfixes: + * fix heap overflow in svn:// protocol parser (CVE-2015-5259) + + - Bindings bugfixes: + * javahl: fix ABI incompatibilty with 1.8 (r1710104) + * javahl: allow non-absolute paths in SVNClient.vacuum (r1710215, r1710290) + + Developer-visible changes: + - General: + * fix patch filter invocation in svn_client_patch() (r1706783) + * add @since information to config defines (r1706983, r1706999) + * fix running the tests in compatibility mode (r1706375) + * clarify documentation of svn_fs_node_created_rev() (r1717154) + + - API changes: + * fix overflow detection in svn_stringbuf_remove and _replace (r1714358) + * don't ignore some of the parameters to svn_ra_svn_create_conn3 (r1714314) + + Version 1.9.2 (30 Sep 2015, from /branches/1.9.x) http://svn.apache.org/repos/asf/subversion/tags/1.9.2 @@ -118,7 +206,7 @@ http://svn.apache.org/repos/asf/subversi * fsfs: enable dir and prop deltas by default for formats that support it (r1555286) * fsfs: avoid out of date errors from files in a directory changing when - you change a property on the directory (r1558224) + you change a property on the directory (issue #2118) * fsfs: temporary transaction properties are preserved when commit is interrupted (r1549907 et al) * fsfs: speed up transaction creation (r1544719) @@ -794,6 +882,51 @@ http://svn.apache.org/repos/asf/subversi * javahl: allow compiling with a C++11 compiler (r1684412) +Version 1.8.16 +(28 Apr 2016, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.16 + + User-visible changes: + - Server-side bugfixes: + * mod_authz_svn: fix authz with mod_auth_kerb/mod_auth_ntlm (issue #4602) + * dump: don't write broken dump files in some ambiguously encoded fsfs + repositories (issue #4554) + + - Client-side and server-side bugfixes: + * update INSTALL documentation file (r1703470, r1703475) + + Developer-visible changes: + - General: + * fix javahl test suite to work on a symlinked RAM disk (r1539230) + * fix ruby test suite to work with test-unit gem (r1714790) + + +Version 1.8.15 +(15 Dec 2015, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.15 + + User-visible changes: + - Client-side bugfixes: + * gpg-agent: fix crash with non-canonical $HOME (r1691928, issue #4584) + + - Client-side and server-side bugfixes: + * fix a segfault with old style text delta (r1618472 et al) + + - Server-side bugfixes: + * mod_dav_svn: fix heap overflow with skel-encoded requests (CVE-2015-5343) + * fsfs: reduce memory allocation with Apache (r1591005 et al) + * mod_dav_svn: emit first log items as soon as possible (r1666965 et al) + * mod_dav_svn: use LimitXMLRequestBody for skel-encoded requests (r1687812) + + - Bindings bugfixes: + * swig: fix memory corruption in svn_client_copy_source_t (r1694929) + + Developer-visible changes: + - General: + * better configure-time detection of httpd authz fix (r1687304 et al) + * fix compilation with apr 1.2.x (r1701237) + + Version 1.8.14 (5 Aug 2015, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.14 Modified: head/contrib/subversion/INSTALL ============================================================================== --- head/contrib/subversion/INSTALL Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/INSTALL Sat Apr 30 10:35:42 2016 (r298845) @@ -3,7 +3,7 @@ A Quick Guide ====================================== -$LastChangedDate: 2015-07-26 23:03:10 +0000 (Sun, 26 Jul 2015) $ +$LastChangedDate: 2015-12-12 04:00:43 +0000 (Sat, 12 Dec 2015) $ Contents: @@ -199,48 +199,6 @@ I. INTRODUCTION Apache Portable Runtime (APR) and the APR Utility (APR-util) libraries. - - **************************************************************** - ** IMPORTANT ISSUE ABOUT APR VERSIONS: READ THIS ** - ** IF UPGRADING FROM MUCH OLDER SUBVERSION ** - **************************************************************** - | | - | APR 0.9.X and 1.X are binary-incompatible. | - | | - | This means: | - | | - | - if you are already using Subversion with APR 0.9.X, and | - | then upgrade your libapr to 1.X without rebuilding | - | Subversion, things will break and segfault. | - | | - | - if your Subversion server libraries are linked to one | - | version of APR, but your Apache server is linked to a | - | different version, things will break and segfault. | - | | - | Subversion distribution dependencies: | - | ------------------------------------- | - | | - | For a long time, Subversion's main distribution contained | - | APR and APR-UTIL (both 0.9.x), plus a few other things that | - | we couldn't count on the installation system having. But | - | nowadays, Subversion's requirements are no longer exotic, | - | and so our main distribution contains just the Subversion | - | source code itself -- people compiling Subversion are | - | expected to either have the APR libraries already installed | - | on their system, or to be capable of fetching them easily. | - | | - | Note that it's *perfectly* safe to use APR 1.X from the | - | beginning. In fact, we recommend it. If you're building | - | Subversion for the first time, there's no compatibility | - | issue to worry about, so grab the latest version of APR. | - | | - | If you already have a Subversion installation using APR | - | 0.9.x, it's still possible to move to APR 1.X safely. Just | - | be sure to recompile Subversion (and Apache httpd if | - | necessary) after upgrading APR! | - |______________________________________________________________| - - If you do not have a pre-installed APR and APR-util, you will need to get these yourself: @@ -960,14 +918,6 @@ II. INSTALLATION This step is only required for building the server dso modules. - The Subversion gen-make.py script must be run before building Apache or - Apache and Subversion will be running incompatible versions of apr. - - C:>cd src-%DIR% - C:>python gen-make.py -t dsp --with-httpd=..\httpd-2.0.58 - --with-berkeley-db=db4-win32 --with-openssl=..\openssl-0.9.7f - --with-zlib=..\zlib --with-libintl=..\svn-win32-libintl - C:>cd .. C:>set APACHEDIR=C:\Program Files\Apache Group\Apache2 C:>msdev httpd-2.0.58\apache.dsw /MAKE "BuildBin - Win32 Release" @@ -1042,7 +992,6 @@ II. INSTALLATION The Apache/APR projects required by Subversion are: apr-util\libaprutil.dsp, apr\libapr.dsp, apr-iconv\libapriconv.dsp, apr-util\xml\expat\lib\xml.dsp, - apr-util\uri\gen_uri_delims.dsp (for APR 0.9.x), apr-iconv\ccs\libapriconv_ccs_modules.dsp, and apr-iconv\ces\libapriconv_ces_modules.dsp. * If the server dso modules are being built and tested Apache must not @@ -1168,33 +1117,13 @@ III. BUILDING A SUBVERSION SERVER 1. Obtaining and Installing Apache 2 Subversion tries to compile against the latest released version - of Apache httpd 2.X. The easiest thing for you to do is download + of Apache httpd 2.2+. The easiest thing for you to do is download a source tarball of the latest release and unpack that. - - **************************************************************** - ** IMPORTANT ISSUE ABOUT APACHE VERSIONS: READ THIS. ** - ** ** - **************************************************************** - | | - | First, be sure to read the APR version warning box, back in | - | section I.C.1, which explains that APR 0.9.x and 1.X are | - | binary-incompatible. | - | | - | Apache HTTPD 2.0 uses APR 0.9.x. | - | Apache HTTPD 2.2 uses APR 1.2.x. | - | | - | We recommend using the latest Apache. However, whatever | - | version you choose, you *must* ensure that Subversion | - | and Apache are using the same version of APR. If you don't, | - | things will segfault and break. | - |______________________________________________________________| - - - If you have questions about the Apache httpd 2.0 build, please consult + If you have questions about the Apache httpd 2.2 build, please consult the httpd install documentation: - http://httpd.apache.org/docs-2.0/install.html + http://httpd.apache.org/docs-2.2/install.html At the top of the httpd tree: @@ -1240,7 +1169,7 @@ III. BUILDING A SUBVERSION SERVER --------------------------------------------------------- Go back into your subversion working copy and run ./autogen.sh if - you need to. Then, assuming Apache httpd 2.0 is installed in the + you need to. Then, assuming Apache httpd 2.2 is installed in the standard location, run: $ ./configure @@ -1250,7 +1179,7 @@ III. BUILDING A SUBVERSION SERVER look for other libsvn_*.so libraries on your system. If you see a warning message that the build of mod_dav_svn is - being skipped, this may be because you have Apache httpd 2.X + being skipped, this may be because you have Apache httpd 2.x installed in a non-standard location. You can use the "--with-apxs=" option to locate the apxs script: @@ -1292,7 +1221,7 @@ III. BUILDING A SUBVERSION SERVER /usr/local/apache2/conf/httpd.conf to reflect your setup. At a minimum you should look at the User, Group and ServerName directives. Full details on setting up apache can be found at: - http://httpd.apache.org/docs-2.0/ + http://httpd.apache.org/docs-2.2/ First, your httpd.conf needs to load the mod_dav_svn module. If you pass --enable-mod-activation to Subversion's configure, @@ -1346,6 +1275,7 @@ III. BUILDING A SUBVERSION SERVER Require group svn_readers + ### FIXME Tutorials section refers to old 2.0 docs These are only a few simple examples. For a complete tutorial on Apache access control, please consider taking a look at the tutorials found under "Security" on the following page: @@ -1372,7 +1302,7 @@ III. BUILDING A SUBVERSION SERVER NOTE: If you are unfamiliar with an Apache directive, or not exactly sure about what it does, don't hesitate to look it up in the - documentation: http://httpd.apache.org/docs-2.0/mod/directives.html. + documentation: http://httpd.apache.org/docs-2.2/mod/directives.html. NOTE: Make sure that the user 'nobody' (or whatever UID the httpd process runs as) has permission to read and write the Modified: head/contrib/subversion/Makefile.in ============================================================================== --- head/contrib/subversion/Makefile.in Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/Makefile.in Sat Apr 30 10:35:42 2016 (r298845) @@ -917,13 +917,15 @@ swig-rb: autogen-swig-rb check-swig-rb: swig-rb svnserve $(TEST_SHLIB_VAR_SWIG_RB) \ cd $(SWIG_RB_DIR); \ - if [ "$(RUBY_MAJOR)" -eq 1 -a "$(RUBY_MINOR)" -lt 9 ] ; then \ - $(RUBY) -I $(SWIG_RB_SRC_DIR) \ - $(SWIG_RB_SRC_DIR)/test/run-test.rb \ - --verbose=$(SWIG_RB_TEST_VERBOSE); \ - else \ - $(RUBY) -I $(SWIG_RB_SRC_DIR) \ - $(SWIG_RB_SRC_DIR)/test/run-test.rb; \ + check_rb() { \ + $(RUBY) -I $(SWIG_RB_SRC_DIR) $(SWIG_RB_SRC_DIR)/test/run-test.rb "$$@"; \ + }; \ + if check_rb --help 2>&1 | grep -q -- --collector; then \ + check_rb --collector=dir --verbose=$(SWIG_RB_TEST_VERBOSE); \ + elif [ "$(RUBY_MAJOR)" -eq 1 -a "$(RUBY_MINOR)" -lt 9 ] ; then \ + check_rb --verbose=$(SWIG_RB_TEST_VERBOSE); \ + else \ + check_rb; \ fi EXTRACLEAN_SWIG_RB=rm -f $(SWIG_RB_SRC_DIR)/svn_*.c $(SWIG_RB_SRC_DIR)/core.c Modified: head/contrib/subversion/NOTICE ============================================================================== --- head/contrib/subversion/NOTICE Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/NOTICE Sat Apr 30 10:35:42 2016 (r298845) @@ -1,5 +1,5 @@ Apache Subversion -Copyright 2015 The Apache Software Foundation +Copyright 2016 The Apache Software Foundation This product includes software developed by many people, and distributed under Contributor License Agreements to The Apache Software Foundation Modified: head/contrib/subversion/build-outputs.mk ============================================================================== --- head/contrib/subversion/build-outputs.mk Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/build-outputs.mk Sat Apr 30 10:35:42 2016 (r298845) @@ -521,8 +521,8 @@ subversion/bindings/cxxhl/libsvncxxhl-1. cd subversion/bindings/cxxhl && $(LINK_CXX_LIB) $(libsvncxxhl_LDFLAGS) -o libsvncxxhl-1.la $(LT_NO_UNDEFINED) $(libsvncxxhl_OBJECTS) ../../../subversion/libsvn_repos/libsvn_repos-1.la ../../../subversion/libsvn_client/libsvn_client-1.la ../../../subversion/libsvn_wc/libsvn_wc-1.la ../../../subversion/libsvn_ra/libsvn_ra-1.la ../../../subversion/libsvn_delta/libsvn_delta-1.la ../../../subversion/libsvn_diff/libsvn_diff-1.la ../../../subversion/libsvn_subr/libsvn_subr-1.la ../../../subversion/libsvn_fs/libsvn_fs-1.la $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS) $(LIBS) libsvnjavahl_PATH = subversion/bindings/javahl/native -libsvnjavahl_DEPS = $(javahl_java_DEPS) $(javahl_callback_javah_DEPS) $(javahl_remote_javah_DEPS) $(javahl_types_javah_DEPS) $(javahl_util_javah_DEPS) $(javahl_javah_DEPS) subversion/bindings/javahl/native/Array.lo subversion/bindings/javahl/native/AuthnCallback.lo subversion/bindings/javahl/native/BlameCallback.lo subversion/bindings/javahl/native/ChangelistCallback.lo subversion/bindings/javahl/native/ClientContext.lo subversion/bindings/javahl/native/CommitCallback.lo subversion/bindings/javahl/native/CommitEditor.lo subversion/bindings/javahl/native/CommitMessage.lo subversion/bindings/javahl/native/CopySources.lo subversion/bindings/javahl/native/CreateJ.lo subversion/bindings/javahl/native/Credential.lo subversion/bindings/javahl/native/DiffOptions.lo subversion/bindings/javahl/native/DiffSummaryReceiver.lo subversion/bindings/javahl/native/EditorCallbacks.lo subversion/bindings/javahl/native/EditorProxy.lo subversion/bindings/javahl/native/EnumMapper.lo subversion/bindings/ja vahl/native/ExternalItem.lo subversion/bindings/javahl/native/File.lo subversion/bindings/javahl/native/ImportFilterCallback.lo subversion/bindings/javahl/native/InfoCallback.lo subversion/bindings/javahl/native/InputStream.lo subversion/bindings/javahl/native/Iterator.lo subversion/bindings/javahl/native/JNIByteArray.lo subversion/bindings/javahl/native/JNICriticalSection.lo subversion/bindings/javahl/native/JNIMutex.lo subversion/bindings/javahl/native/JNIStackElement.lo subversion/bindings/javahl/native/JNIStringHolder.lo subversion/bindings/javahl/native/JNIUtil.lo subversion/bindings/javahl/native/ListCallback.lo subversion/bindings/javahl/native/LockTokenTable.lo subversion/bindings/javahl/native/LogMessageCallback.lo subversion/bindings/javahl/native/MessageReceiver.lo subversion/bindings/javahl/native/NativeStream.lo subversion/bindings/javahl/native/OperationContext.lo subversion/bindings/javahl/native/OutputStream.lo subversion/bindings/javahl/native/PatchCallback.lo subve rsion/bindings/javahl/native/Path.lo subvers! ion/bindings/javahl/native/Pool.lo subversion/bindings/javahl/native/Prompter.lo subversion/bindings/javahl/native/PropertyTable.lo subversion/bindings/javahl/native/ProplistCallback.lo subversion/bindings/javahl/native/RemoteSession.lo subversion/bindings/javahl/native/RemoteSessionContext.lo subversion/bindings/javahl/native/ReposFreezeAction.lo subversion/bindings/javahl/native/ReposNotifyCallback.lo subversion/bindings/javahl/native/ReposVerifyCallback.lo subversion/bindings/javahl/native/Revision.lo subversion/bindings/javahl/native/RevisionRange.lo subversion/bindings/javahl/native/RevisionRangeList.lo subversion/bindings/javahl/native/SVNBase.lo subversion/bindings/javahl/native/SVNClient.lo subversion/bindings/javahl/native/SVNRepos.lo subversion/bindings/javahl/native/StateReporter.lo subversion/bindings/javahl/native/StatusCallback.lo subversion/bindings/javahl/native/StringArray.lo subversion/bindings/javahl/native/SubversionException.lo subversion/bindings/javahl/native/ Targets.lo subversion/bindings/javahl/native/Utility.lo subversion/bindings/javahl/native/VersionExtended.lo subversion/bindings/javahl/native/deprecated.lo subversion/bindings/javahl/native/jniwrapper/jni_base.lo subversion/bindings/javahl/native/jniwrapper/jni_channel.lo subversion/bindings/javahl/native/jniwrapper/jni_class_cache.lo subversion/bindings/javahl/native/jniwrapper/jni_io_stream.lo subversion/bindings/javahl/native/jniwrapper/jni_iterator.lo subversion/bindings/javahl/native/jniwrapper/jni_list.lo subversion/bindings/javahl/native/jniwrapper/jni_string_map.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_CommitEditor.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteFactory.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteSession.lo subve rsion/bindings/javahl/native/org_apache_subv! ersion_ja! vahl_remote_StateReporter.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_types_RevisionRangeList.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_types_RuntimeVersion.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_types_Version.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_DiffLib.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_TunnelChannel.lo subversion/libsvn_repos/libsvn_repos-1.la subversion/libsvn_client/libsvn_client-1.la subversion/libsvn_wc/libsvn_wc-1.la subver sion/libsvn_ra/libsvn_ra-1.la subversion/libsvn_delta/libsvn_delta-1.la subversion/libsvn_diff/libsvn_diff-1.la subversion/libsvn_subr/libsvn_subr-1.la subversion/libsvn_fs/libsvn_fs-1.la -libsvnjavahl_OBJECTS = Array.lo AuthnCallback.lo BlameCallback.lo ChangelistCallback.lo ClientContext.lo CommitCallback.lo CommitEditor.lo CommitMessage.lo CopySources.lo CreateJ.lo Credential.lo DiffOptions.lo DiffSummaryReceiver.lo EditorCallbacks.lo EditorProxy.lo EnumMapper.lo ExternalItem.lo File.lo ImportFilterCallback.lo InfoCallback.lo InputStream.lo Iterator.lo JNIByteArray.lo JNICriticalSection.lo JNIMutex.lo JNIStackElement.lo JNIStringHolder.lo JNIUtil.lo ListCallback.lo LockTokenTable.lo LogMessageCallback.lo MessageReceiver.lo NativeStream.lo OperationContext.lo OutputStream.lo PatchCallback.lo Path.lo Pool.lo Prompter.lo PropertyTable.lo ProplistCallback.lo RemoteSession.lo RemoteSessionContext.lo ReposFreezeAction.lo ReposNotifyCallback.lo ReposVerifyCallback.lo Revision.lo RevisionRange.lo RevisionRangeList.lo SVNBase.lo SVNClient.lo SVNRepos.lo StateReporter.lo StatusCallback.lo StringArray.lo SubversionException.lo Targets.lo Utility.lo VersionExtended.lo deprecat ed.lo jniwrapper/jni_base.lo jniwrapper/jni_channel.lo jniwrapper/jni_class_cache.lo jniwrapper/jni_io_stream.lo jniwrapper/jni_iterator.lo jniwrapper/jni_list.lo jniwrapper/jni_string_map.lo org_apache_subversion_javahl_SVNClient.lo org_apache_subversion_javahl_SVNRepos.lo org_apache_subversion_javahl_remote_CommitEditor.lo org_apache_subversion_javahl_remote_RemoteFactory.lo org_apache_subversion_javahl_remote_RemoteSession.lo org_apache_subversion_javahl_remote_StateReporter.lo org_apache_subversion_javahl_types_RevisionRangeList.lo org_apache_subversion_javahl_types_RuntimeVersion.lo org_apache_subversion_javahl_types_Version.lo org_apache_subversion_javahl_types_VersionExtended.lo org_apache_subversion_javahl_util_ConfigImpl_Category.lo org_apache_subversion_javahl_util_ConfigLib.lo org_apache_subversion_javahl_util_DiffLib.lo org_apache_subversion_javahl_util_PropLib.lo org_apache_subversion_javahl_util_SubstLib.lo org_apache_subversion_javahl_util_TunnelChannel.lo +libsvnjavahl_DEPS = $(javahl_java_DEPS) $(javahl_callback_javah_DEPS) $(javahl_remote_javah_DEPS) $(javahl_types_javah_DEPS) $(javahl_util_javah_DEPS) $(javahl_javah_DEPS) subversion/bindings/javahl/native/Array.lo subversion/bindings/javahl/native/AuthnCallback.lo subversion/bindings/javahl/native/BlameCallback.lo subversion/bindings/javahl/native/ChangelistCallback.lo subversion/bindings/javahl/native/ClientContext.lo subversion/bindings/javahl/native/CommitCallback.lo subversion/bindings/javahl/native/CommitEditor.lo subversion/bindings/javahl/native/CommitMessage.lo subversion/bindings/javahl/native/CopySources.lo subversion/bindings/javahl/native/CreateJ.lo subversion/bindings/javahl/native/Credential.lo subversion/bindings/javahl/native/DiffOptions.lo subversion/bindings/javahl/native/DiffSummaryReceiver.lo subversion/bindings/javahl/native/EditorCallbacks.lo subversion/bindings/javahl/native/EditorProxy.lo subversion/bindings/javahl/native/EnumMapper.lo subversion/bindings/ja vahl/native/ExternalItem.lo subversion/bindings/javahl/native/File.lo subversion/bindings/javahl/native/ImportFilterCallback.lo subversion/bindings/javahl/native/InfoCallback.lo subversion/bindings/javahl/native/InputStream.lo subversion/bindings/javahl/native/Iterator.lo subversion/bindings/javahl/native/JNIByteArray.lo subversion/bindings/javahl/native/JNICriticalSection.lo subversion/bindings/javahl/native/JNIMutex.lo subversion/bindings/javahl/native/JNIStackElement.lo subversion/bindings/javahl/native/JNIStringHolder.lo subversion/bindings/javahl/native/JNIUtil.lo subversion/bindings/javahl/native/ListCallback.lo subversion/bindings/javahl/native/LockTokenTable.lo subversion/bindings/javahl/native/LogMessageCallback.lo subversion/bindings/javahl/native/MessageReceiver.lo subversion/bindings/javahl/native/NativeStream.lo subversion/bindings/javahl/native/OperationContext.lo subversion/bindings/javahl/native/OutputStream.lo subversion/bindings/javahl/native/PatchCallback.lo subve rsion/bindings/javahl/native/Path.lo subvers! ion/bindings/javahl/native/Pool.lo subversion/bindings/javahl/native/Prompter.lo subversion/bindings/javahl/native/PropertyTable.lo subversion/bindings/javahl/native/ProplistCallback.lo subversion/bindings/javahl/native/RemoteSession.lo subversion/bindings/javahl/native/RemoteSessionContext.lo subversion/bindings/javahl/native/ReposFreezeAction.lo subversion/bindings/javahl/native/ReposNotifyCallback.lo subversion/bindings/javahl/native/ReposVerifyCallback.lo subversion/bindings/javahl/native/Revision.lo subversion/bindings/javahl/native/RevisionRange.lo subversion/bindings/javahl/native/RevisionRangeList.lo subversion/bindings/javahl/native/SVNBase.lo subversion/bindings/javahl/native/SVNClient.lo subversion/bindings/javahl/native/SVNRepos.lo subversion/bindings/javahl/native/StateReporter.lo subversion/bindings/javahl/native/StatusCallback.lo subversion/bindings/javahl/native/StringArray.lo subversion/bindings/javahl/native/SubversionException.lo subversion/bindings/javahl/native/ Targets.lo subversion/bindings/javahl/native/Utility.lo subversion/bindings/javahl/native/VersionExtended.lo subversion/bindings/javahl/native/deprecated.lo subversion/bindings/javahl/native/jniwrapper/jni_base.lo subversion/bindings/javahl/native/jniwrapper/jni_channel.lo subversion/bindings/javahl/native/jniwrapper/jni_class_cache.lo subversion/bindings/javahl/native/jniwrapper/jni_io_stream.lo subversion/bindings/javahl/native/jniwrapper/jni_iterator.lo subversion/bindings/javahl/native/jniwrapper/jni_list.lo subversion/bindings/javahl/native/jniwrapper/jni_string_map.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNRepos.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_CommitEditor.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_RemoteFactory.lo subversion /bindings/javahl/native/org_apache_subversio! n_javahl_! remote_RemoteSession.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_remote_StateReporter.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_types_RevisionRangeList.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_types_RuntimeVersion.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_types_Version.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_types_VersionExtended.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigLib.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_DiffLib.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_PropLib.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_SubstLib.lo subversion/bindings/javahl/native/org_apache_subversion_javahl_util_TunnelChannel.lo subversion/libsvn_repos/libsvn_repos-1.la subv ersion/libsvn_client/libsvn_client-1.la subversion/libsvn_wc/libsvn_wc-1.la subversion/libsvn_ra/libsvn_ra-1.la subversion/libsvn_delta/libsvn_delta-1.la subversion/libsvn_diff/libsvn_diff-1.la subversion/libsvn_subr/libsvn_subr-1.la subversion/libsvn_fs/libsvn_fs-1.la +libsvnjavahl_OBJECTS = Array.lo AuthnCallback.lo BlameCallback.lo ChangelistCallback.lo ClientContext.lo CommitCallback.lo CommitEditor.lo CommitMessage.lo CopySources.lo CreateJ.lo Credential.lo DiffOptions.lo DiffSummaryReceiver.lo EditorCallbacks.lo EditorProxy.lo EnumMapper.lo ExternalItem.lo File.lo ImportFilterCallback.lo InfoCallback.lo InputStream.lo Iterator.lo JNIByteArray.lo JNICriticalSection.lo JNIMutex.lo JNIStackElement.lo JNIStringHolder.lo JNIUtil.lo ListCallback.lo LockTokenTable.lo LogMessageCallback.lo MessageReceiver.lo NativeStream.lo OperationContext.lo OutputStream.lo PatchCallback.lo Path.lo Pool.lo Prompter.lo PropertyTable.lo ProplistCallback.lo RemoteSession.lo RemoteSessionContext.lo ReposFreezeAction.lo ReposNotifyCallback.lo ReposVerifyCallback.lo Revision.lo RevisionRange.lo RevisionRangeList.lo SVNBase.lo SVNClient.lo SVNRepos.lo StateReporter.lo StatusCallback.lo StringArray.lo SubversionException.lo Targets.lo Utility.lo VersionExtended.lo deprecat ed.lo jniwrapper/jni_base.lo jniwrapper/jni_channel.lo jniwrapper/jni_class_cache.lo jniwrapper/jni_io_stream.lo jniwrapper/jni_iterator.lo jniwrapper/jni_list.lo jniwrapper/jni_string_map.lo org_apache_subversion_javahl_NativeResources.lo org_apache_subversion_javahl_SVNClient.lo org_apache_subversion_javahl_SVNRepos.lo org_apache_subversion_javahl_remote_CommitEditor.lo org_apache_subversion_javahl_remote_RemoteFactory.lo org_apache_subversion_javahl_remote_RemoteSession.lo org_apache_subversion_javahl_remote_StateReporter.lo org_apache_subversion_javahl_types_RevisionRangeList.lo org_apache_subversion_javahl_types_RuntimeVersion.lo org_apache_subversion_javahl_types_Version.lo org_apache_subversion_javahl_types_VersionExtended.lo org_apache_subversion_javahl_util_ConfigImpl_Category.lo org_apache_subversion_javahl_util_ConfigLib.lo org_apache_subversion_javahl_util_DiffLib.lo org_apache_subversion_javahl_util_PropLib.lo org_apache_subversion_javahl_util_SubstLib.lo org_apache_sub version_javahl_util_TunnelChannel.lo subversion/bindings/javahl/native/libsvnjavahl-1.la: $(libsvnjavahl_DEPS) cd subversion/bindings/javahl/native && $(LINK_JAVAHL_CXX) $(libsvnjavahl_LDFLAGS) -o libsvnjavahl-1.la $(LT_NO_UNDEFINED) $(libsvnjavahl_OBJECTS) ../../../../subversion/libsvn_repos/libsvn_repos-1.la ../../../../subversion/libsvn_client/libsvn_client-1.la ../../../../subversion/libsvn_wc/libsvn_wc-1.la ../../../../subversion/libsvn_ra/libsvn_ra-1.la ../../../../subversion/libsvn_delta/libsvn_delta-1.la ../../../../subversion/libsvn_diff/libsvn_diff-1.la ../../../../subversion/libsvn_subr/libsvn_subr-1.la ../../../../subversion/libsvn_fs/libsvn_fs-1.la $(SVN_APRUTIL_LIBS) $(SVN_APR_LIBS) $(SVN_JAVA_SDK_LIBS) $(LIBS) @@ -2268,6 +2268,9 @@ subversion/bindings/javahl/native/jniwra subversion/bindings/javahl/native/jniwrapper/jni_string_map.lo: subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp subversion/bindings/javahl/native/jniwrapper/jni_env.hpp subversion/bindings/javahl/native/jniwrapper/jni_globalref.hpp subversion/bindings/javahl/native/jniwrapper/jni_iterator.hpp subversion/bindings/javahl/native/jniwrapper/jni_object.hpp subversion/bindings/javahl/native/jniwrapper/jni_string.hpp subversion/bindings/javahl/native/jniwrapper/jni_string_map.hpp subversion/svn_private_config.h $(COMPILE_JAVAHL_CXX) $(canonicalized_srcdir)subversion/bindings/javahl/native/jniwrapper/jni_string_map.cpp +subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.lo: subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.cpp subversion/bindings/javahl/include/org_apache_subversion_javahl_NativeResources.h + $(COMPILE_JAVAHL_CXX) $(canonicalized_srcdir)subversion/bindings/javahl/native/org_apache_subversion_javahl_NativeResources.cpp + subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.lo: subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp subversion/bindings/javahl/include/org_apache_subversion_javahl_SVNClient.h subversion/bindings/javahl/native/Array.h subversion/bindings/javahl/native/BlameCallback.h subversion/bindings/javahl/native/ChangelistCallback.h subversion/bindings/javahl/native/ClientContext.h subversion/bindings/javahl/native/CommitCallback.h subversion/bindings/javahl/native/CommitMessage.h subversion/bindings/javahl/native/CopySources.h subversion/bindings/javahl/native/CreateJ.h subversion/bindings/javahl/native/DiffOptions.h subversion/bindings/javahl/native/DiffSummaryReceiver.h subversion/bindings/javahl/native/EnumMapper.h subversion/bindings/javahl/native/ImportFilterCallback.h subversion/bindings/javahl/native/InfoCallback.h subversion/bindings/javahl/native/JNIByteArray.h subversion/bindings/javahl/native/JNIStackElement.h subversion/bindings /javahl/native/JNIStringHolder.h subversion/bindings/javahl/native/JNIUtil.h subversion/bindings/javahl/native/ListCallback.h subversion/bindings/javahl/native/LogMessageCallback.h subversion/bindings/javahl/native/OperationContext.h subversion/bindings/javahl/native/OutputStream.h subversion/bindings/javahl/native/PatchCallback.h subversion/bindings/javahl/native/Path.h subversion/bindings/javahl/native/Pool.h subversion/bindings/javahl/native/Prompter.h subversion/bindings/javahl/native/PropertyTable.h subversion/bindings/javahl/native/ProplistCallback.h subversion/bindings/javahl/native/Revision.h subversion/bindings/javahl/native/RevisionRange.h subversion/bindings/javahl/native/SVNBase.h subversion/bindings/javahl/native/SVNClient.h subversion/bindings/javahl/native/StatusCallback.h subversion/bindings/javahl/native/StringArray.h subversion/bindings/javahl/native/Targets.h subversion/bindings/javahl/native/VersionExtended.h subversion/bindings/javahl/native/jniwrapper/jni_env.h pp subversion/bindings/javahl/native/jniwrap! per/jni_globalref.hpp subversion/bindings/javahl/native/version.h subversion/include/private/svn_atomic.h subversion/include/private/svn_debug.h subversion/include/private/svn_dep_compat.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_client.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_diff.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_opt.h subversion/include/svn_pools.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/include/svn_wc.h subversion/svn_private_config.h $(COMPILE_JAVAHL_CXX) $(canonicalized_srcdir)subversion/bindings/javahl/native/org_apache_subversion_javahl_SVNClient.cpp @@ -3139,7 +3142,7 @@ subversion/mod_dav_svn/reports/update.lo subversion/mod_dav_svn/repos.lo: subversion/mod_dav_svn/repos.c subversion/include/mod_authz_svn.h subversion/include/mod_dav_svn.h subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fspath.h subversion/include/private/svn_log.h subversion/include/private/svn_repos_private.h subversion/include/private/svn_skel.h subversion/include/private/svn_sorts_private.h subversion/include/private/svn_string_private.h subversion/include/svn_auth.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_ctype.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_hash.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_pools.h subversion /include/svn_props.h subversion/include/svn_ra.h subversion/include/svn_repos.h subversion/include/svn_sorts.h subversion/include/svn_string.h subversion/include/svn_subst.h subversion/include/svn_time.h subversion/include/svn_types.h subversion/include/svn_version.h subversion/include/svn_xml.h subversion/mod_dav_svn/dav_svn.h if $(INSTALL_APACHE_MODS) ; then $(COMPILE_APACHE_MOD) $(canonicalized_srcdir)subversion/mod_dav_svn/repos.c ; else echo "fake" > subversion/mod_dav_svn/repos.lo ; fi -subversion/mod_dav_svn/status.lo: subversion/mod_dav_svn/status.c subversion/include/mod_authz_svn.h subversion/include/private/svn_cache.h subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_skel.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_xml.h subversion/mod_dav_svn/dav_svn.h +subversion/mod_dav_svn/status.lo: subversion/mod_dav_svn/status.c subversion/include/mod_authz_svn.h subversion/include/private/svn_cache.h subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_editor.h subversion/include/private/svn_fs_private.h subversion/include/private/svn_skel.h subversion/include/svn_checksum.h subversion/include/svn_config.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_iter.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_xml.h subversion/mod_dav_svn/dav_svn.h subversion/svn_private_config.h if $(INSTALL_APACHE_MODS) ; then $(COMPILE_APACHE_MOD) $(canonicalized_srcdir)subversion/mod_dav_svn/status.c ; else echo "fake" > subversion/mod_dav_svn/status.lo ; fi subversion/mod_dav_svn/util.lo: subversion/mod_dav_svn/util.c subversion/include/mod_authz_svn.h subversion/include/private/svn_dav_protocol.h subversion/include/private/svn_debug.h subversion/include/private/svn_fspath.h subversion/include/private/svn_skel.h subversion/include/svn_base64.h subversion/include/svn_checksum.h subversion/include/svn_dav.h subversion/include/svn_delta.h subversion/include/svn_dirent_uri.h subversion/include/svn_error.h subversion/include/svn_error_codes.h subversion/include/svn_fs.h subversion/include/svn_io.h subversion/include/svn_mergeinfo.h subversion/include/svn_path.h subversion/include/svn_repos.h subversion/include/svn_string.h subversion/include/svn_types.h subversion/include/svn_xml.h subversion/mod_dav_svn/dav_svn.h Modified: head/contrib/subversion/configure ============================================================================== --- head/contrib/subversion/configure Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/configure Sat Apr 30 10:35:42 2016 (r298845) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for subversion 1.9.2. +# Generated by GNU Autoconf 2.69 for subversion 1.9.4. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='subversion' PACKAGE_TARNAME='subversion' -PACKAGE_VERSION='1.9.2' -PACKAGE_STRING='subversion 1.9.2' +PACKAGE_VERSION='1.9.4' +PACKAGE_STRING='subversion 1.9.4' PACKAGE_BUGREPORT='http://subversion.apache.org/' PACKAGE_URL='' @@ -1471,7 +1471,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 subversion 1.9.2 to adapt to many kinds of systems. +\`configure' configures subversion 1.9.4 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1537,7 +1537,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of subversion 1.9.2:";; + short | recursive ) echo "Configuration of subversion 1.9.4:";; esac cat <<\_ACEOF @@ -1751,7 +1751,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -subversion configure 1.9.2 +subversion configure 1.9.4 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2295,7 +2295,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 subversion $as_me 1.9.2, which was +It was created by subversion $as_me 1.9.4, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2675,8 +2675,8 @@ ac_configure="$SHELL $ac_aux_dir/configu -{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.2" >&5 -$as_echo "$as_me: Configuring Subversion 1.9.2" >&6;} +{ $as_echo "$as_me:${as_lineno-$LINENO}: Configuring Subversion 1.9.4" >&5 +$as_echo "$as_me: Configuring Subversion 1.9.4" >&6;} abs_srcdir="`cd $srcdir && pwd`" @@ -20314,16 +20314,16 @@ $as_echo_n "checking for KWallet... " >& fi done qt_include_dirs="`$PKG_CONFIG --cflags-only-I QtCore QtDBus QtGui`" - kde_dir="`$KDE4_CONFIG --prefix`" - SVN_KWALLET_INCLUDES="$DBUS_CPPFLAGS $qt_include_dirs -I$kde_dir/include" + kde_incdir="`$KDE4_CONFIG --install include`" + SVN_KWALLET_INCLUDES="$DBUS_CPPFLAGS $qt_include_dirs -I$kde_incdir" qt_libs_other_options="`$PKG_CONFIG --libs-only-other QtCore QtDBus QtGui`" SVN_KWALLET_LIBS="$DBUS_LIBS -lQtCore -lQtDBus -lQtGui -lkdecore -lkdeui $qt_libs_other_options" CXXFLAGS="$CXXFLAGS $SVN_KWALLET_INCLUDES" LIBS="$LIBS $SVN_KWALLET_LIBS" qt_lib_dirs="`$PKG_CONFIG --libs-only-L QtCore QtDBus QtGui`" - kde_lib_suffix="`$KDE4_CONFIG --libsuffix`" + kde_libdir="`$KDE4_CONFIG --install lib`" LDFLAGS="$old_LDFLAGS ` - input_flags="$qt_lib_dirs -L$kde_dir/lib$kde_lib_suffix" + input_flags="$qt_lib_dirs -L$kde_libdir" output_flags="" filtered_dirs="/lib /lib64 /usr/lib /usr/lib64" for flag in $input_flags; do @@ -26750,7 +26750,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by subversion $as_me 1.9.2, which was +This file was extended by subversion $as_me 1.9.4, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26816,7 +26816,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -subversion config.status 1.9.2 +subversion config.status 1.9.4 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: head/contrib/subversion/subversion/include/svn_client.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_client.h Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/include/svn_client.h Sat Apr 30 10:35:42 2016 (r298845) @@ -4098,16 +4098,16 @@ svn_client_mergeinfo_log_eligible(const * @{ */ -/** Recursively vacuum a working copy directory @a dir, removing unnecessary - * data. +/** Recursively vacuum a working copy directory @a dir_abspath, + * removing unnecessary data. * * If @a include_externals is @c TRUE, recurse into externals and vacuum them * as well. * * If @a remove_unversioned_items is @c TRUE, remove unversioned items - * in @a dir after successful working copy cleanup. + * in @a dir_abspath after successful working copy cleanup. * If @a remove_ignored_items is @c TRUE, remove ignored unversioned items - * in @a dir after successful working copy cleanup. + * in @a dir_abspath after successful working copy cleanup. * * If @a fix_recorded_timestamps is @c TRUE, this function fixes recorded * timestamps for unmodified files in the working copy, reducing comparision Modified: head/contrib/subversion/subversion/include/svn_config.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_config.h Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/include/svn_config.h Sat Apr 30 10:35:42 2016 (r298845) @@ -76,18 +76,27 @@ typedef struct svn_config_t svn_config_t #define SVN_CONFIG_OPTION_HTTP_PROXY_EXCEPTIONS "http-proxy-exceptions" #define SVN_CONFIG_OPTION_HTTP_TIMEOUT "http-timeout" #define SVN_CONFIG_OPTION_HTTP_COMPRESSION "http-compression" +/** @deprecated Not used since 1.8. */ #define SVN_CONFIG_OPTION_NEON_DEBUG_MASK "neon-debug-mask" +/** @since New in 1.5. */ #define SVN_CONFIG_OPTION_HTTP_AUTH_TYPES "http-auth-types" #define SVN_CONFIG_OPTION_SSL_AUTHORITY_FILES "ssl-authority-files" #define SVN_CONFIG_OPTION_SSL_TRUST_DEFAULT_CA "ssl-trust-default-ca" #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE "ssl-client-cert-file" #define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_PASSWORD "ssl-client-cert-password" +/** @deprecated Not used since 1.8. + * @since New in 1.5. */ #define SVN_CONFIG_OPTION_SSL_PKCS11_PROVIDER "ssl-pkcs11-provider" +/** @since New in 1.5. */ #define SVN_CONFIG_OPTION_HTTP_LIBRARY "http-library" +/** @since New in 1.1. */ #define SVN_CONFIG_OPTION_STORE_PASSWORDS "store-passwords" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_STORE_PLAINTEXT_PASSWORDS "store-plaintext-passwords" #define SVN_CONFIG_OPTION_STORE_AUTH_CREDS "store-auth-creds" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP "store-ssl-client-cert-pp" +/** @since New in 1.6. */ #define SVN_CONFIG_OPTION_STORE_SSL_CLIENT_CERT_PP_PLAINTEXT \ "store-ssl-client-cert-pp-plaintext" #define SVN_CONFIG_OPTION_USERNAME "username" @@ -123,6 +132,7 @@ typedef struct svn_config_t svn_config_t #define SVN_CONFIG_OPTION_DIFF_EXTENSIONS "diff-extensions" #define SVN_CONFIG_OPTION_DIFF3_CMD "diff3-cmd" #define SVN_CONFIG_OPTION_DIFF3_HAS_PROGRAM_ARG "diff3-has-program-arg" +/** @since New in 1.5. */ #define SVN_CONFIG_OPTION_MERGE_TOOL_CMD "merge-tool-cmd" #define SVN_CONFIG_SECTION_MISCELLANY "miscellany" #define SVN_CONFIG_OPTION_GLOBAL_IGNORES "global-ignores" @@ -133,8 +143,11 @@ typedef struct svn_config_t svn_config_t #define SVN_CONFIG_OPTION_ENABLE_AUTO_PROPS "enable-auto-props" /** @since New in 1.9. */ #define SVN_CONFIG_OPTION_ENABLE_MAGIC_FILE "enable-magic-file" +/** @since New in 1.2. */ #define SVN_CONFIG_OPTION_NO_UNLOCK "no-unlock" +/** @since New in 1.5. */ #define SVN_CONFIG_OPTION_MIMETYPES_FILE "mime-types-file" +/** @since New in 1.5. */ #define SVN_CONFIG_OPTION_PRESERVED_CF_EXTS "preserved-conflict-file-exts" /** @since New in 1.7. */ #define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts" @@ -172,9 +185,13 @@ typedef struct svn_config_t svn_config_t #define SVN_CONFIG_OPTION_FORCE_USERNAME_CASE "force-username-case" /** @since New in 1.8. */ #define SVN_CONFIG_OPTION_HOOKS_ENV "hooks-env" +/** @since New in 1.5. */ #define SVN_CONFIG_SECTION_SASL "sasl" +/** @since New in 1.5. */ #define SVN_CONFIG_OPTION_USE_SASL "use-sasl" +/** @since New in 1.5. */ #define SVN_CONFIG_OPTION_MIN_SSF "min-encryption" +/** @since New in 1.5. */ #define SVN_CONFIG_OPTION_MAX_SSF "max-encryption" /* For repository password database */ Modified: head/contrib/subversion/subversion/include/svn_fs.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_fs.h Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/include/svn_fs.h Sat Apr 30 10:35:42 2016 (r298845) @@ -1759,12 +1759,15 @@ svn_fs_node_relation(svn_fs_node_relatio const char *path_b, apr_pool_t *scratch_pool); -/** Set @a *revision to the revision in which @a path under @a root was - * created. Use @a pool for any temporary allocations. @a *revision will +/** Set @a *revision to the revision in which the node-revision identified + * by @a path under @a root was created; that is, to the revision in which + * @a path under @a root was last modified. @a *revision will * be set to #SVN_INVALID_REVNUM for uncommitted nodes (i.e. modified nodes * under a transaction root). Note that the root of an unmodified transaction * is not itself considered to be modified; in that case, return the revision * upon which the transaction was based. + * + * Use @a pool for any temporary allocations. */ svn_error_t * svn_fs_node_created_rev(svn_revnum_t *revision, @@ -1861,6 +1864,15 @@ svn_fs_change_node_prop(svn_fs_root_t *r * both roots must be in the same filesystem. * Do any necessary temporary allocation in @a scratch_pool. * + * @note For the purposes of preserving accurate history, certain bits of + * code (such as the repository dump code) need to care about the distinction + * between situations when the properties are "different" and "have changed + * across two points in history". We have a pair of functions that can + * answer both of these questions, svn_fs_props_different() and + * svn_fs_props_changed(). See issue 4598 for more details. + * + * @see svn_fs_props_changed + * * @since New in 1.9. */ svn_error_t * @@ -1872,9 +1884,7 @@ svn_fs_props_different(svn_boolean_t *di apr_pool_t *scratch_pool); -/** Determine if the properties of two path/root combinations are different. - * In contrast to #svn_fs_props_different, we only perform a quick test and - * allow for false positives. +/** Determine if the properties of two path/root combinations have changed. * * Set @a *changed_p to #TRUE if the properties at @a path1 under @a root1 * differ from those at @a path2 under @a root2, or set it to #FALSE if they @@ -1882,15 +1892,19 @@ svn_fs_props_different(svn_boolean_t *di * both roots must be in the same filesystem. * Do any necessary temporary allocation in @a pool. * - * @note The behavior is implementation dependent in that the false - * positives reported may differ from release to release and backend to - * backend. There is also no guarantee that there will be false positives - * at all. - * - * @note Prior to Subversion 1.9, this function would return false negatives - * for FSFS: If @a root1 and @a root2 were both transaction roots - * and the proplists of both paths had been changed in their respective - * transactions, @a changed_p would be set to #FALSE. + * @note For the purposes of preserving accurate history, certain bits of + * code (such as the repository dump code) need to care about the distinction + * between situations when the properties are "different" and "have changed + * across two points in history". We have a pair of functions that can + * answer both of these questions, svn_fs_props_different() and + * svn_fs_props_changed(). See issue 4598 for more details. + * + * @note This function can currently return false negatives for FSFS: + * If @a root1 and @a root2 were both transaction roots and the proplists + * of both paths had been changed in their respective transactions, + * @a changed_p would be set to #FALSE. + * + * @see svn_fs_props_different */ svn_error_t * svn_fs_props_changed(svn_boolean_t *changed_p, @@ -2410,7 +2424,7 @@ svn_fs_apply_text(svn_stream_t **content apr_pool_t *pool); -/** Check if the contents of two root/path combos have changed. +/** Check if the contents of two root/path combos are different. * * Set @a *different_p to #TRUE if the file contents at @a path1 under * @a root1 differ from those at @a path2 under @a root2, or set it to @@ -2418,6 +2432,16 @@ svn_fs_apply_text(svn_stream_t **content * respective roots, and both roots must be in the same filesystem. * Do any necessary temporary allocation in @a scratch_pool. * + * @note For the purposes of preserving accurate history, certain bits of + * code (such as the repository dump code) need to care about the distinction + * between situations when two files have "different" content and when the + * contents of a given file "have changed" across two points in its history. + * We have a pair of functions that can answer both of these questions, + * svn_fs_contents_different() and svn_fs_contents_changed(). See issue + * 4598 for more details. + * + * @see svn_fs_contents_changed + * * @since New in 1.9. */ svn_error_t * @@ -2428,9 +2452,7 @@ svn_fs_contents_different(svn_boolean_t const char *path2, apr_pool_t *scratch_pool); -/** Check if the contents of two root/path combos have changed. In - * contrast to #svn_fs_contents_different, we only perform a quick test - * and allow for false positives. +/** Check if the contents of two root/path combos have changed. * * Set @a *changed_p to #TRUE if the file contents at @a path1 under * @a root1 differ from those at @a path2 under @a root2, or set it to @@ -2438,10 +2460,18 @@ svn_fs_contents_different(svn_boolean_t * respective roots, and both roots must be in the same filesystem. * Do any necessary temporary allocation in @a pool. * - * @note The behavior is implementation dependent in that the false - * positives reported may differ from release to release and backend to - * backend. There is also no guarantee that there will be false positives - * at all. + * @note svn_fs_contents_changed() was not designed to be used to detect + * when two files have different content, but really to detect when the + * contents of a given file have changed across two points in its history. + * For the purposes of preserving accurate history, certain bits of code + * (such as the repository dump code) need to care about this distinction. + * For example, it's not an error from the FS API point of view to call + * svn_fs_apply_textdelta() and explicitly set a file's contents to exactly + * what they were before the edit was made. We have a pair of functions + * that can answer both of these questions, svn_fs_contents_changed() and + * svn_fs_contents_different(). See issue 4598 for more details. + * + * @see svn_fs_contents_different */ svn_error_t * svn_fs_contents_changed(svn_boolean_t *changed_p, Modified: head/contrib/subversion/subversion/include/svn_version.h ============================================================================== --- head/contrib/subversion/subversion/include/svn_version.h Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/include/svn_version.h Sat Apr 30 10:35:42 2016 (r298845) @@ -70,7 +70,7 @@ extern "C" { * * @since New in 1.1. */ -#define SVN_VER_PATCH 2 +#define SVN_VER_PATCH 4 /** @deprecated Provided for backward compatibility with the 1.0 API. */ @@ -93,7 +93,7 @@ extern "C" { * * Always change this at the same time as SVN_VER_NUMTAG. */ -#define SVN_VER_TAG " (r1703836)" +#define SVN_VER_TAG " (r1740329)" /** Number tag: a string describing the version. @@ -117,7 +117,7 @@ extern "C" { * file version. Its value remains 0 in the repository except in release * tags where it is the revision from which the tag was created. */ -#define SVN_VER_REVISION 1703836 +#define SVN_VER_REVISION 1740329 /* Version strings composed from the above definitions. */ Modified: head/contrib/subversion/subversion/libsvn_client/externals.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_client/externals.c Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/libsvn_client/externals.c Sat Apr 30 10:35:42 2016 (r298845) @@ -231,6 +231,42 @@ switch_dir_external(const char *local_ab if (node_url) { + svn_boolean_t is_wcroot; + + SVN_ERR(svn_wc__is_wcroot(&is_wcroot, ctx->wc_ctx, local_abspath, + pool)); + + if (! is_wcroot) + { + /* This can't be a directory external! */ + + err = svn_wc__external_remove(ctx->wc_ctx, defining_abspath, + local_abspath, + TRUE /* declaration_only */, + ctx->cancel_func, ctx->cancel_baton, + pool); + + if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND) + { + /* New external... No problem that we can't remove it */ + svn_error_clear(err); + err = NULL; + } + else if (err) + return svn_error_trace(err); + + return svn_error_createf(SVN_ERR_WC_PATH_UNEXPECTED_STATUS, NULL, + _("The external '%s' defined in %s at '%s' " + "cannot be checked out because '%s' is " + "already a versioned path."), + url_from_externals_definition, + SVN_PROP_EXTERNALS, + svn_dirent_local_style(defining_abspath, + pool), + svn_dirent_local_style(local_abspath, + pool)); + } + /* If we have what appears to be a version controlled subdir, and its top-level URL matches that of our externals definition, perform an update. */ Modified: head/contrib/subversion/subversion/libsvn_client/merge.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_client/merge.c Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/libsvn_client/merge.c Sat Apr 30 10:35:42 2016 (r298845) @@ -2349,17 +2349,47 @@ files_same_p(svn_boolean_t *same, { svn_stream_t *mine_stream; svn_stream_t *older_stream; - svn_opt_revision_t working_rev = { svn_opt_revision_working, { 0 } }; + svn_string_t *special = svn_hash_gets(working_props, SVN_PROP_SPECIAL); + svn_string_t *eol_style = svn_hash_gets(working_props, SVN_PROP_EOL_STYLE); + svn_string_t *keywords = svn_hash_gets(working_props, SVN_PROP_KEYWORDS); /* Compare the file content, translating 'mine' to 'normal' form. */ - if (svn_prop_get_value(working_props, SVN_PROP_SPECIAL) != NULL) + if (special != NULL) SVN_ERR(svn_subst_read_specialfile(&mine_stream, mine_abspath, scratch_pool, scratch_pool)); else - SVN_ERR(svn_client__get_normalized_stream(&mine_stream, wc_ctx, - mine_abspath, &working_rev, - FALSE, TRUE, NULL, NULL, - scratch_pool, scratch_pool)); + SVN_ERR(svn_stream_open_readonly(&mine_stream, mine_abspath, + scratch_pool, scratch_pool)); + + if (!special && (eol_style || keywords)) + { + apr_hash_t *kw = NULL; + const char *eol = NULL; + svn_subst_eol_style_t style; + + /* We used to use svn_client__get_normalized_stream() here, but + that doesn't work in 100% of the cases because it doesn't + convert EOLs to the repository form; just to '\n'. + */ + + if (eol_style) + { + svn_subst_eol_style_from_value(&style, &eol, eol_style->data); + + if (style == svn_subst_eol_style_native) + eol = SVN_SUBST_NATIVE_EOL_STR; + else if (style != svn_subst_eol_style_fixed + && style != svn_subst_eol_style_none) + return svn_error_create(SVN_ERR_IO_UNKNOWN_EOL, NULL, NULL); + } + + if (keywords) + SVN_ERR(svn_subst_build_keywords3(&kw, keywords->data, "", "", + "", 0, "", scratch_pool)); + + mine_stream = svn_subst_stream_translated( + mine_stream, eol, FALSE, kw, FALSE, scratch_pool); + } SVN_ERR(svn_stream_open_readonly(&older_stream, older_abspath, scratch_pool, scratch_pool)); Modified: head/contrib/subversion/subversion/libsvn_client/patch.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_client/patch.c Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/libsvn_client/patch.c Sat Apr 30 10:35:42 2016 (r298845) @@ -209,9 +209,6 @@ typedef struct patch_target_t { /* True if the target had to be skipped for some reason. */ svn_boolean_t skipped; - /* True if the target has been filtered by the patch callback. */ - svn_boolean_t filtered; - /* True if at least one hunk was rejected. */ svn_boolean_t had_rejects; @@ -489,6 +486,8 @@ resolve_target_path(patch_target_t *targ SVN_ERR(svn_wc__node_was_moved_away(&moved_to_abspath, NULL, wc_ctx, target->local_abspath, result_pool, scratch_pool)); + /* ### BUG: moved_to_abspath contains the target where the op-root was + ### moved to... not the target itself! */ if (moved_to_abspath) { target->local_abspath = moved_to_abspath; @@ -2264,8 +2263,6 @@ apply_one_patch(patch_target_t **patch_t int strip_count, svn_boolean_t ignore_whitespace, svn_boolean_t remove_tempfiles, - svn_client_patch_func_t patch_func, - void *patch_baton, svn_cancel_func_t cancel_func, void *cancel_baton, apr_pool_t *result_pool, apr_pool_t *scratch_pool) @@ -2285,19 +2282,6 @@ apply_one_patch(patch_target_t **patch_t return SVN_NO_ERROR; } - if (patch_func) - { - SVN_ERR(patch_func(patch_baton, &target->filtered, - target->canon_path_from_patchfile, - target->patched_path, target->reject_path, - scratch_pool)); - if (target->filtered) - { - *patch_target = target; - return SVN_NO_ERROR; - } - } - iterpool = svn_pool_create(scratch_pool); /* Match hunks. */ for (i = 0; i < patch->hunks->nelts; i++) @@ -3164,14 +3148,23 @@ apply_patches(/* The path to the patch f if (patch) { patch_target_t *target; + svn_boolean_t filtered = FALSE; SVN_ERR(apply_one_patch(&target, patch, abs_wc_path, ctx->wc_ctx, strip_count, ignore_whitespace, remove_tempfiles, - patch_func, patch_baton, ctx->cancel_func, ctx->cancel_baton, iterpool, iterpool)); - if (! target->filtered) + + if (!target->skipped && patch_func) + { + SVN_ERR(patch_func(patch_baton, &filtered, + target->canon_path_from_patchfile, + target->patched_path, target->reject_path, + iterpool)); + } + + if (! filtered) { /* Save info we'll still need when we're done patching. */ patch_target_info_t *target_info = Modified: head/contrib/subversion/subversion/libsvn_diff/binary_diff.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_diff/binary_diff.c Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/libsvn_diff/binary_diff.c Sat Apr 30 10:35:42 2016 (r298845) @@ -194,22 +194,22 @@ svn_diff_output_binary(svn_stream_t *out SVN_ERR(svn_stream_puts(output_stream, "GIT binary patch" APR_EOL_STR)); - /* ### git would first calculate if a git-delta original->latest would be + /* ### git would first calculate if a git-delta latest->original would be shorter than the zipped data. For now lets assume that it is not and just dump the literal data */ - SVN_ERR(write_literal(original_full, - svn_stream_from_aprfile2(original_apr, FALSE, subpool), + SVN_ERR(write_literal(latest_full, + svn_stream_from_aprfile2(latest_apr, FALSE, subpool), output_stream, cancel_func, cancel_baton, scratch_pool)); svn_pool_clear(subpool); SVN_ERR(svn_stream_puts(output_stream, APR_EOL_STR)); - /* ### git would first calculate if a git-delta latest->original would be + /* ### git would first calculate if a git-delta original->latest would be shorter than the zipped data. For now lets assume that it is not and just dump the literal data */ - SVN_ERR(write_literal(latest_full, - svn_stream_from_aprfile2(latest_apr, FALSE, subpool), + SVN_ERR(write_literal(original_full, + svn_stream_from_aprfile2(original_apr, FALSE, subpool), output_stream, cancel_func, cancel_baton, scratch_pool)); Modified: head/contrib/subversion/subversion/libsvn_fs_base/dag.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_base/dag.c Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/libsvn_fs_base/dag.c Sat Apr 30 10:35:42 2016 (r298845) @@ -1657,8 +1657,14 @@ svn_fs_base__things_different(svn_boolea /* Compare contents keys and their (optional) uniquifiers. */ if (contents_changed != NULL) - *contents_changed = (! svn_fs_base__same_keys(noderev1->data_key, - noderev2->data_key)); + *contents_changed = + (! (svn_fs_base__same_keys(noderev1->data_key, + noderev2->data_key) + /* Technically, these uniquifiers aren't used and "keys", + but keys are base-36 stringified numbers, so we'll take + this liberty. */ + && (svn_fs_base__same_keys(noderev1->data_key_uniquifier, + noderev2->data_key_uniquifier)))); return SVN_NO_ERROR; } Modified: head/contrib/subversion/subversion/libsvn_fs_base/fs.h ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_base/fs.h Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/libsvn_fs_base/fs.h Sat Apr 30 10:35:42 2016 (r298845) @@ -195,11 +195,7 @@ typedef struct node_revision_t only because one or both of us decided to pick up a shared representation after-the-fact." May be NULL (if this node revision isn't using a shared rep, or isn't the original - "assignee" of a shared rep). - - This is no longer used by the 1.9 code but we have to keep - reading and writing it to remain compatible with 1.8, and - earlier, that require it. */ + "assignee" of a shared rep). */ const char *data_key_uniquifier; /* representation key for this node's text-data-in-progess (files Modified: head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c ============================================================================== --- head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Sat Apr 30 09:50:08 2016 (r298844) +++ head/contrib/subversion/subversion/libsvn_fs_fs/cached_data.c Sat Apr 30 10:35:42 2016 (r298845) @@ -2558,8 +2558,12 @@ svn_fs_fs__rep_contents_dir(apr_array_he SVN_ERR(get_dir_contents(entries_p, fs, noderev, result_pool, scratch_pool)); - /* Update the cache, if we are to use one. */ - if (cache) + /* Update the cache, if we are to use one. + * + * Don't even attempt to serialize very large directories; it would cause + * an unnecessary memory allocation peak. 150 bytes/entry is about right. + */ + if (cache && svn_cache__is_cachable(cache, 150 * (*entries_p)->nelts)) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Apr 30 12:44:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A607B1CC52; Sat, 30 Apr 2016 12:44: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 4633B10FC; Sat, 30 Apr 2016 12:44: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 u3UCi3S7014255; Sat, 30 Apr 2016 12:44:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UCi3fg014253; Sat, 30 Apr 2016 12:44:03 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604301244.u3UCi3fg014253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 30 Apr 2016 12:44:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298846 - head/sys/fs/fdescfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 12:44:04 -0000 Author: emaste Date: Sat Apr 30 12:44:03 2016 New Revision: 298846 URL: https://svnweb.freebsd.org/changeset/base/298846 Log: ANSIfy fdescfs(5) Modified: head/sys/fs/fdescfs/fdesc_vfsops.c head/sys/fs/fdescfs/fdesc_vnops.c Modified: head/sys/fs/fdescfs/fdesc_vfsops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vfsops.c Sat Apr 30 10:35:42 2016 (r298845) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Sat Apr 30 12:44:03 2016 (r298846) @@ -119,9 +119,7 @@ fdesc_mount(struct mount *mp) } static int -fdesc_unmount(mp, mntflags) - struct mount *mp; - int mntflags; +fdesc_unmount(struct mount *mp, int mntflags) { struct fdescmount *fmp; caddr_t data; @@ -162,10 +160,7 @@ fdesc_unmount(mp, mntflags) } static int -fdesc_root(mp, flags, vpp) - struct mount *mp; - int flags; - struct vnode **vpp; +fdesc_root(struct mount *mp, int flags, struct vnode **vpp) { struct vnode *vp; @@ -179,9 +174,7 @@ fdesc_root(mp, flags, vpp) } static int -fdesc_statfs(mp, sbp) - struct mount *mp; - struct statfs *sbp; +fdesc_statfs(struct mount *mp, struct statfs *sbp) { struct thread *td; struct filedesc *fdp; Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Sat Apr 30 10:35:42 2016 (r298845) +++ head/sys/fs/fdescfs/fdesc_vnops.c Sat Apr 30 12:44:03 2016 (r298846) @@ -92,8 +92,7 @@ static void fdesc_remove_entry(struct fd * Initialise cache headers */ int -fdesc_init(vfsp) - struct vfsconf *vfsp; +fdesc_init(struct vfsconf *vfsp) { mtx_init(&fdesc_hashmtx, "fdescfs_hash", NULL, MTX_DEF); @@ -105,8 +104,7 @@ fdesc_init(vfsp) * Uninit ready for unload. */ int -fdesc_uninit(vfsp) - struct vfsconf *vfsp; +fdesc_uninit(struct vfsconf *vfsp) { hashdestroy(fdhashtbl, M_CACHE, fdhash); @@ -146,12 +144,8 @@ fdesc_remove_entry(struct fdescnode *fd) } int -fdesc_allocvp(ftype, fd_fd, ix, mp, vpp) - fdntype ftype; - unsigned fd_fd; - int ix; - struct mount *mp; - struct vnode **vpp; +fdesc_allocvp(fdntype ftype, unsigned fd_fd, int ix, struct mount *mp, + struct vnode **vpp) { struct fdescmount *fmp; struct fdhashhead *fc; @@ -274,12 +268,7 @@ fdesc_get_ino_alloc(struct mount *mp, vo * ndp is the name to locate in that directory... */ static int -fdesc_lookup(ap) - struct vop_lookup_args /* { - struct vnode * a_dvp; - struct vnode ** a_vpp; - struct componentname * a_cnp; - } */ *ap; +fdesc_lookup(struct vop_lookup_args *ap) { struct vnode **vpp = ap->a_vpp; struct vnode *dvp = ap->a_dvp; @@ -381,13 +370,7 @@ bad: } static int -fdesc_open(ap) - struct vop_open_args /* { - struct vnode *a_vp; - int a_mode; - struct ucred *a_cred; - struct thread *a_td; - } */ *ap; +fdesc_open(struct vop_open_args *ap) { struct vnode *vp = ap->a_vp; @@ -407,12 +390,7 @@ fdesc_open(ap) } static int -fdesc_getattr(ap) - struct vop_getattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - } */ *ap; +fdesc_getattr(struct vop_getattr_args *ap) { struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; @@ -456,12 +434,7 @@ fdesc_getattr(ap) } static int -fdesc_setattr(ap) - struct vop_setattr_args /* { - struct vnode *a_vp; - struct vattr *a_vap; - struct ucred *a_cred; - } */ *ap; +fdesc_setattr(struct vop_setattr_args *ap) { struct vattr *vap = ap->a_vap; struct vnode *vp; @@ -513,15 +486,7 @@ fdesc_setattr(ap) #define UIO_MX 16 static int -fdesc_readdir(ap) - struct vop_readdir_args /* { - struct vnode *a_vp; - struct uio *a_uio; - struct ucred *a_cred; - int *a_eofflag; - u_long *a_cookies; - int a_ncookies; - } */ *ap; +fdesc_readdir(struct vop_readdir_args *ap) { struct uio *uio = ap->a_uio; struct filedesc *fdp; @@ -588,10 +553,7 @@ done: } static int -fdesc_reclaim(ap) - struct vop_reclaim_args /* { - struct vnode *a_vp; - } */ *ap; +fdesc_reclaim(struct vop_reclaim_args *ap) { struct vnode *vp; struct fdescnode *fd; From owner-svn-src-head@freebsd.org Sat Apr 30 14:25:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 714E3B22289; Sat, 30 Apr 2016 14:25:02 +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 260131B6D; Sat, 30 Apr 2016 14:25:02 +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 u3UEP1CZ044529; Sat, 30 Apr 2016 14:25:01 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UEP0qQ044523; Sat, 30 Apr 2016 14:25:00 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201604301425.u3UEP0qQ044523@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 30 Apr 2016 14:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298847 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 14:25:02 -0000 Author: tuexen Date: Sat Apr 30 14:25:00 2016 New Revision: 298847 URL: https://svnweb.freebsd.org/changeset/base/298847 Log: Add the UDP encaps port as a parameter to sctp_add_remote_addr(). This is currently only a code change without any functional change. But this allows to set the remote encapsulation port in a more detailed way, which will be provided in a follow-up commit. MFC after: 1 week Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sat Apr 30 12:44:03 2016 (r298846) +++ head/sys/netinet/sctp_asconf.c Sat Apr 30 14:25:00 2016 (r298847) @@ -244,7 +244,8 @@ sctp_process_asconf_add_ip(struct sockad m_reply = sctp_asconf_error_response(aph->correlation_id, SCTP_CAUSE_INVALID_PARAM, (uint8_t *) aph, aparam_length); - } else if (sctp_add_remote_addr(stcb, sa, &net, SCTP_DONOT_SETSCOPE, + } else if (sctp_add_remote_addr(stcb, sa, &net, stcb->asoc.port, + SCTP_DONOT_SETSCOPE, SCTP_ADDR_DYNAMIC_ADDED) != 0) { SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: error adding address\n"); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Apr 30 12:44:03 2016 (r298846) +++ head/sys/netinet/sctp_input.c Sat Apr 30 14:25:00 2016 (r298847) @@ -2718,7 +2718,8 @@ sctp_handle_cookie_echo(struct mbuf *m, */ if (netl == NULL) { /* TSNH! Huh, why do I need to add this address here? */ - if (sctp_add_remote_addr(*stcb, to, NULL, SCTP_DONOT_SETSCOPE, SCTP_IN_COOKIE_PROC)) { + if (sctp_add_remote_addr(*stcb, to, NULL, (*stcb)->asoc.port, + SCTP_DONOT_SETSCOPE, SCTP_IN_COOKIE_PROC)) { return (NULL); } netl = sctp_findnet(*stcb, to); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Apr 30 12:44:03 2016 (r298846) +++ head/sys/netinet/sctp_output.c Sat Apr 30 14:25:00 2016 (r298847) @@ -3677,7 +3677,7 @@ sctp_process_cmsgs_for_init(struct sctp_ *error = EINVAL; return (1); } - if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { *error = ENOBUFS; return (1); @@ -3709,14 +3709,14 @@ sctp_process_cmsgs_for_init(struct sctp_ *error = EINVAL; return (1); } - if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { *error = ENOBUFS; return (1); } } else #endif - if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin6, NULL, + if (sctp_add_remote_addr(stcb, (struct sockaddr *)&sin6, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { *error = ENOBUFS; return (1); Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Apr 30 12:44:03 2016 (r298846) +++ head/sys/netinet/sctp_pcb.c Sat Apr 30 14:25:00 2016 (r298847) @@ -3766,7 +3766,7 @@ sctp_is_address_on_local_host(struct soc */ int sctp_add_remote_addr(struct sctp_tcb *stcb, struct sockaddr *newaddr, - struct sctp_nets **netp, int set_scope, int from) + struct sctp_nets **netp, uint16_t port, int set_scope, int from) { /* * The following is redundant to the same lines in the @@ -3944,7 +3944,7 @@ sctp_add_remote_addr(struct sctp_tcb *st stcb->asoc.numnets++; net->ref_count = 1; net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; - net->port = stcb->asoc.port; + net->port = port; net->dscp = stcb->asoc.default_dscp; #ifdef INET6 net->flowlabel = stcb->asoc.default_flowlabel; @@ -4384,7 +4384,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, LIST_INSERT_HEAD(head, stcb, sctp_asocs); SCTP_INP_INFO_WUNLOCK(); - if ((err = sctp_add_remote_addr(stcb, firstaddr, NULL, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC))) { + if ((err = sctp_add_remote_addr(stcb, firstaddr, NULL, asoc->port, SCTP_DO_SETSCOPE, SCTP_ALLOC_ASOC))) { /* failure.. memory error? */ if (asoc->strmout) { SCTP_FREE(asoc->strmout, SCTP_M_STRMO); @@ -6159,7 +6159,7 @@ sctp_load_addresses_from_init(struct sct #ifdef INET case AF_INET: if (stcb->asoc.scope.ipv4_addr_legal) { - if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_2)) { + if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_2)) { return (-1); } } @@ -6168,7 +6168,7 @@ sctp_load_addresses_from_init(struct sct #ifdef INET6 case AF_INET6: if (stcb->asoc.scope.ipv6_addr_legal) { - if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_3)) { + if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_3)) { return (-2); } } @@ -6253,7 +6253,7 @@ sctp_load_addresses_from_init(struct sct /* the assoc was freed? */ return (-7); } - if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_4)) { + if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_4)) { return (-8); } } else if (stcb_tmp == stcb) { @@ -6348,7 +6348,7 @@ sctp_load_addresses_from_init(struct sct * we must add the address, no scope * set */ - if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_5)) { + if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, SCTP_DONOT_SETSCOPE, SCTP_LOAD_ADDR_5)) { return (-17); } } else if (stcb_tmp == stcb) { Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sat Apr 30 12:44:03 2016 (r298846) +++ head/sys/netinet/sctp_pcb.h Sat Apr 30 14:25:00 2016 (r298847) @@ -601,7 +601,7 @@ void sctp_add_local_addr_ep(struct sctp_ void sctp_del_local_addr_ep(struct sctp_inpcb *, struct sctp_ifa *); -int sctp_add_remote_addr(struct sctp_tcb *, struct sockaddr *, struct sctp_nets **, int, int); +int sctp_add_remote_addr(struct sctp_tcb *, struct sockaddr *, struct sctp_nets **, uint16_t, int, int); void sctp_remove_net(struct sctp_tcb *, struct sctp_nets *); Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Apr 30 12:44:03 2016 (r298846) +++ head/sys/netinet/sctputil.c Sat Apr 30 14:25:00 2016 (r298847) @@ -6277,7 +6277,9 @@ sctp_connectx_helper_add(struct sctp_tcb *error = EINVAL; goto out_now; } - if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, + SCTP_DONOT_SETSCOPE, + SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS); (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, @@ -6300,7 +6302,9 @@ sctp_connectx_helper_add(struct sctp_tcb *error = EINVAL; goto out_now; } - if (sctp_add_remote_addr(stcb, sa, NULL, SCTP_DONOT_SETSCOPE, SCTP_ADDR_IS_CONFIRMED)) { + if (sctp_add_remote_addr(stcb, sa, NULL, stcb->asoc.port, + SCTP_DONOT_SETSCOPE, + SCTP_ADDR_IS_CONFIRMED)) { /* assoc gone no un-lock */ SCTP_LTRACE_ERR_RET(NULL, stcb, NULL, SCTP_FROM_SCTPUTIL, ENOBUFS); (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, From owner-svn-src-head@freebsd.org Sat Apr 30 14:41:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03008B225EE; Sat, 30 Apr 2016 14:41:22 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C6C8112FD; Sat, 30 Apr 2016 14:41:21 +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 u3UEfLTh047703; Sat, 30 Apr 2016 14:41:21 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UEfIlC047682; Sat, 30 Apr 2016 14:41:18 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604301441.u3UEfIlC047682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 14:41:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298848 - in head/sys: arm/at91 ddb dev/acpi_support dev/cxgbe dev/fb dev/iwn dev/kbd dev/syscons dev/vt dev/vt/hw/vga dev/wpi fs/nandfs geom/virstor libkern mips/atheros rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 14:41:22 -0000 Author: pfg Date: Sat Apr 30 14:41:18 2016 New Revision: 298848 URL: https://svnweb.freebsd.org/changeset/base/298848 Log: sys: Make use of our rounddown() macro when sys/param.h is available. No functional change. Modified: head/sys/arm/at91/at91_pmc.c head/sys/ddb/db_output.c head/sys/dev/acpi_support/acpi_hp.c head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/fb/fb.c head/sys/dev/fb/vesa.c head/sys/dev/fb/vga.c head/sys/dev/iwn/if_iwn.c head/sys/dev/kbd/kbd.c head/sys/dev/syscons/scmouse.c head/sys/dev/syscons/scvgarndr.c head/sys/dev/vt/hw/vga/vt_vga.c head/sys/dev/vt/vt_core.c head/sys/dev/wpi/if_wpi.c head/sys/fs/nandfs/nandfs_vfsops.c head/sys/geom/virstor/g_virstor.c head/sys/libkern/crc32.c head/sys/mips/atheros/ar934x_chip.c head/sys/mips/atheros/qca953x_chip.c head/sys/mips/atheros/qca955x_chip.c head/sys/rpc/clnt_dg.c Modified: head/sys/arm/at91/at91_pmc.c ============================================================================== --- head/sys/arm/at91/at91_pmc.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/arm/at91/at91_pmc.c Sat Apr 30 14:41:18 2016 (r298848) @@ -506,7 +506,7 @@ at91_pmc_sense_main_clock(void) * AT91C_MAIN_CLOCK in the kernel config file. */ if (ckgr_val >= 21000000) - return ((ckgr_val + 250) / 500 * 500); + return (rounddown(ckgr_val + 250, 500)); /* * Try to find the standard frequency that match best. Modified: head/sys/ddb/db_output.c ============================================================================== --- head/sys/ddb/db_output.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/ddb/db_output.c Sat Apr 30 14:41:18 2016 (r298848) @@ -71,8 +71,7 @@ struct dbputchar_arg { static int db_output_position = 0; /* output column */ static int db_last_non_space = 0; /* last non-space character */ db_expr_t db_tab_stop_width = 8; /* how wide are tab stops? */ -#define NEXT_TAB(i) \ - ((((i) + db_tab_stop_width) / db_tab_stop_width) * db_tab_stop_width) +#define NEXT_TAB(i) rounddown((i) + db_tab_stop_width, db_tab_stop_width) db_expr_t db_max_width = 79; /* output line width */ db_expr_t db_lines_per_page = 20; /* lines per page */ volatile int db_pager_quit; /* user requested quit */ Modified: head/sys/dev/acpi_support/acpi_hp.c ============================================================================== --- head/sys/dev/acpi_support/acpi_hp.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/acpi_support/acpi_hp.c Sat Apr 30 14:41:18 2016 (r298848) @@ -1033,7 +1033,8 @@ acpi_hp_hex_decode(char* buffer) UINT8 *uin; UINT8 uout; - if (((int)length/2)*2 == length || length < 10) return; + if (rounddown((int)length, 2) == length || length < 10) + return; for (i = 0; iqsize_rxq / 8) * 8; + na.num_rx_desc = rounddown(vi->qsize_rxq, 8); na.nm_txsync = cxgbe_netmap_txsync; na.nm_rxsync = cxgbe_netmap_rxsync; na.nm_register = cxgbe_netmap_reg; Modified: head/sys/dev/fb/fb.c ============================================================================== --- head/sys/dev/fb/fb.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/fb/fb.c Sat Apr 30 14:41:18 2016 (r298848) @@ -86,7 +86,7 @@ vid_realloc_array(void) return ENOMEM; s = spltty(); - newsize = ((adapters + ARRAY_DELTA)/ARRAY_DELTA)*ARRAY_DELTA; + newsize = rounddown(adapters + ARRAY_DELTA, ARRAY_DELTA); new_adp = malloc(sizeof(*new_adp)*newsize, M_DEVBUF, M_WAITOK | M_ZERO); new_vidsw = malloc(sizeof(*new_vidsw)*newsize, M_DEVBUF, M_WAITOK | M_ZERO); Modified: head/sys/dev/fb/vesa.c ============================================================================== --- head/sys/dev/fb/vesa.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/fb/vesa.c Sat Apr 30 14:41:18 2016 (r298848) @@ -1581,7 +1581,7 @@ vesa_set_origin(video_adapter_t *adp, of regs.R_DX = offset / adp->va_window_gran; x86bios_intr(®s, 0x10); - adp->va_window_orig = (offset/adp->va_window_gran)*adp->va_window_gran; + adp->va_window_orig = rounddown(offset, adp->va_window_gran); return (0); /* XXX */ } Modified: head/sys/dev/fb/vga.c ============================================================================== --- head/sys/dev/fb/vga.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/fb/vga.c Sat Apr 30 14:41:18 2016 (r298848) @@ -1252,7 +1252,7 @@ set_line_length(video_adapter_t *adp, in break; case V_INFO_MM_PACKED: count = (pixel + 7)/8; - bpl = ((pixel + 7)/8)*8; + bpl = rounddown(pixel + 7, 8); break; case V_INFO_MM_TEXT: count = (pixel + 7)/8; /* columns */ Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/iwn/if_iwn.c Sat Apr 30 14:41:18 2016 (r298848) @@ -6335,7 +6335,7 @@ iwn_set_pslevel(struct iwn_softc *sc, in if (max == (uint32_t)-1) max = dtim * (skip_dtim + 1); else if (max > dtim) - max = (max / dtim) * dtim; + max = rounddown(max, dtim); } else max = dtim; for (i = 0; i < 5; i++) Modified: head/sys/dev/kbd/kbd.c ============================================================================== --- head/sys/dev/kbd/kbd.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/kbd/kbd.c Sat Apr 30 14:41:18 2016 (r298848) @@ -96,7 +96,7 @@ kbd_realloc_array(void) int s; s = spltty(); - newsize = ((keyboards + ARRAY_DELTA)/ARRAY_DELTA)*ARRAY_DELTA; + newsize = rounddown(keyboards + ARRAY_DELTA, ARRAY_DELTA); new_kbd = malloc(sizeof(*new_kbd)*newsize, M_DEVBUF, M_NOWAIT|M_ZERO); if (new_kbd == NULL) { splx(s); Modified: head/sys/dev/syscons/scmouse.c ============================================================================== --- head/sys/dev/syscons/scmouse.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/syscons/scmouse.c Sat Apr 30 14:41:18 2016 (r298848) @@ -495,7 +495,7 @@ mouse_cut_start(scr_stat *scp) i = skip_spc_left(scp, scp->mouse_pos) + 1; s = spltty(); scp->mouse_cut_start = - (scp->mouse_pos / scp->xsize) * scp->xsize + i; + rounddown(scp->mouse_pos, scp->xsize) + i; scp->mouse_cut_end = (scp->mouse_pos / scp->xsize + 1) * scp->xsize - 1; splx(s); @@ -540,7 +540,7 @@ mouse_cut_word(scr_stat *scp) * unless user specified SC_CUT_SEPCHARS in his kernel config file. */ if (scp->status & MOUSE_VISIBLE) { - sol = (scp->mouse_pos / scp->xsize) * scp->xsize; + sol = rounddown(scp->mouse_pos, scp->xsize); eol = sol + scp->xsize; c = sc_vtb_getc(&scp->vtb, scp->mouse_pos); if (IS_SEP_CHAR(c)) { @@ -589,7 +589,7 @@ mouse_cut_line(scr_stat *scp) int from; if (scp->status & MOUSE_VISIBLE) { - from = (scp->mouse_pos / scp->xsize) * scp->xsize; + from = rounddown(scp->mouse_pos, scp->xsize); mouse_do_cut(scp, from, from + scp->xsize - 1); len = strlen(cut_buffer); if (cut_buffer[len - 1] == '\r') Modified: head/sys/dev/syscons/scvgarndr.c ============================================================================== --- head/sys/dev/syscons/scvgarndr.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/syscons/scvgarndr.c Sat Apr 30 14:41:18 2016 (r298848) @@ -1035,7 +1035,7 @@ draw_pxlmouse_planar(scr_stat *scp, int line_width = scp->sc->adp->va_line_width; xoff = (x - scp->xoff*8)%8; - yoff = y - (y/line_width)*line_width; + yoff = y - rounddown(y, line_width); ymax = imin(y + 16, scp->ypixel); outw(GDCIDX, 0x0805); /* read mode 1, write mode 0 */ Modified: head/sys/dev/vt/hw/vga/vt_vga.c ============================================================================== --- head/sys/dev/vt/hw/vga/vt_vga.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/vt/hw/vga/vt_vga.c Sat Apr 30 14:41:18 2016 (r298848) @@ -912,7 +912,7 @@ vga_bitblt_bitmap(struct vt_device *vd, uint8_t pattern_2colors; /* Align coordinates with the 8-pxels grid. */ - x1 = x / VT_VGA_PIXELS_BLOCK * VT_VGA_PIXELS_BLOCK; + x1 = rounddown(x, VT_VGA_PIXELS_BLOCK); y1 = y; x2 = roundup(x + width, VT_VGA_PIXELS_BLOCK); Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/vt/vt_core.c Sat Apr 30 14:41:18 2016 (r298848) @@ -640,9 +640,9 @@ vt_compute_drawable_area(struct vt_windo if (vt_draw_logo_cpus) vw->vw_draw_area.tr_begin.tp_row += vt_logo_sprite_height; vw->vw_draw_area.tr_end.tp_col = vw->vw_draw_area.tr_begin.tp_col + - vd->vd_width / vf->vf_width * vf->vf_width; + rounddown(vd->vd_width, vf->vf_width); vw->vw_draw_area.tr_end.tp_row = vw->vw_draw_area.tr_begin.tp_row + - height / vf->vf_height * vf->vf_height; + rounddown(height, vf->vf_height); } static void Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/dev/wpi/if_wpi.c Sat Apr 30 14:41:18 2016 (r298848) @@ -3814,7 +3814,7 @@ wpi_set_pslevel(struct wpi_softc *sc, ui if (max == (uint32_t)-1) max = dtim * (skip_dtim + 1); else if (max > dtim) - max = (max / dtim) * dtim; + max = rounddown(max, dtim); } else max = dtim; Modified: head/sys/fs/nandfs/nandfs_vfsops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vfsops.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/fs/nandfs/nandfs_vfsops.c Sat Apr 30 14:41:18 2016 (r298848) @@ -331,8 +331,8 @@ nandfs_write_superblock_at(struct nandfs super->s_last_pseg, super->s_last_cno, super->s_last_seq, super->s_wtime, index)); - read_block = btodb(offset + ((index / sb_per_sector) * sb_per_sector) - * sizeof(struct nandfs_super_block)); + read_block = btodb(offset + rounddown(index, sb_per_sector) * + sizeof(struct nandfs_super_block)); DPRINTF(SYNC, ("%s: read_block %#x\n", __func__, read_block)); Modified: head/sys/geom/virstor/g_virstor.c ============================================================================== --- head/sys/geom/virstor/g_virstor.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/geom/virstor/g_virstor.c Sat Apr 30 14:41:18 2016 (r298848) @@ -1257,7 +1257,7 @@ virstor_check_and_run(struct g_virstor_s bs = MIN(MAXPHYS, sc->map_size - count); if (bs % sc->sectorsize != 0) { /* Check for alignment errors */ - bs = (bs / sc->sectorsize) * sc->sectorsize; + bs = rounddown(bs, sc->sectorsize); if (bs == 0) break; LOG_MSG(LVL_ERROR, "Trouble: map is not sector-aligned " @@ -1723,13 +1723,12 @@ g_virstor_start(struct bio *b) * sc_offset will end up pointing to the drive * sector. */ s_offset = chunk_index * sizeof *me; - s_offset = (s_offset / sc->sectorsize) * - sc->sectorsize; + s_offset = rounddown(s_offset, sc->sectorsize); /* data_me points to map entry sector - * in memory (analoguos to offset) */ - data_me = &sc->map[(chunk_index / - sc->me_per_sector) * sc->me_per_sector]; + * in memory (analogous to offset) */ + data_me = &sc->map[rounddown(chunk_index, + sc->me_per_sector)]; /* Commit sector with map entry to storage */ cb->bio_to = sc->components[0].gcons->provider; Modified: head/sys/libkern/crc32.c ============================================================================== --- head/sys/libkern/crc32.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/libkern/crc32.c Sat Apr 30 14:41:18 2016 (r298848) @@ -684,7 +684,7 @@ crc32c_sb8_64_bit(uint32_t crc, uint32_t running_length; uint32_t end_bytes; - running_length = ((length - init_bytes) / 8) * 8; + running_length = rounddown(length - init_bytes, 8); end_bytes = length - init_bytes - running_length; for (li = 0; li < init_bytes; li++) Modified: head/sys/mips/atheros/ar934x_chip.c ============================================================================== --- head/sys/mips/atheros/ar934x_chip.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/mips/atheros/ar934x_chip.c Sat Apr 30 14:41:18 2016 (r298848) @@ -437,7 +437,7 @@ ar934x_chip_gpio_output_configure(int gp if (gpio > AR934X_GPIO_COUNT) return; - reg = AR934X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); + reg = AR934X_GPIO_REG_OUT_FUNC0 + rounddown(gpio, 4); s = 8 * (gpio % 4); /* read-modify-write */ Modified: head/sys/mips/atheros/qca953x_chip.c ============================================================================== --- head/sys/mips/atheros/qca953x_chip.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/mips/atheros/qca953x_chip.c Sat Apr 30 14:41:18 2016 (r298848) @@ -360,7 +360,7 @@ qca953x_chip_gpio_output_configure(int g if (gpio > QCA953X_GPIO_COUNT) return; - reg = QCA953X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); + reg = QCA953X_GPIO_REG_OUT_FUNC0 + rounddown(gpio, 4); s = 8 * (gpio % 4); /* read-modify-write */ Modified: head/sys/mips/atheros/qca955x_chip.c ============================================================================== --- head/sys/mips/atheros/qca955x_chip.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/mips/atheros/qca955x_chip.c Sat Apr 30 14:41:18 2016 (r298848) @@ -369,7 +369,7 @@ qca955x_chip_gpio_output_configure(int g if (gpio > QCA955X_GPIO_COUNT) return; - reg = QCA955X_GPIO_REG_OUT_FUNC0 + 4 * (gpio / 4); + reg = QCA955X_GPIO_REG_OUT_FUNC0 + rounddown(gpio, 4); s = 8 * (gpio % 4); /* read-modify-write */ Modified: head/sys/rpc/clnt_dg.c ============================================================================== --- head/sys/rpc/clnt_dg.c Sat Apr 30 14:25:00 2016 (r298847) +++ head/sys/rpc/clnt_dg.c Sat Apr 30 14:41:18 2016 (r298848) @@ -219,8 +219,8 @@ clnt_dg_create( /* * Should be multiple of 4 for XDR. */ - sendsz = ((sendsz + 3) / 4) * 4; - recvsz = ((recvsz + 3) / 4) * 4; + sendsz = rounddown(sendsz + 3, 4); + recvsz = rounddown(recvsz + 3, 4); cu = mem_alloc(sizeof (*cu)); cu->cu_threads = 0; cu->cu_closing = FALSE; From owner-svn-src-head@freebsd.org Sat Apr 30 14:43:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F78EB2290D; Sat, 30 Apr 2016 14:43:44 +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 01E1D16E9; Sat, 30 Apr 2016 14:43:43 +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 u3UEhhWT050494; Sat, 30 Apr 2016 14:43:43 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UEhhQd050492; Sat, 30 Apr 2016 14:43:43 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604301443.u3UEhhQd050492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 14:43:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298849 - in head/include: arpa rpcsvc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 14:43:44 -0000 Author: pfg Date: Sat Apr 30 14:43:42 2016 New Revision: 298849 URL: https://svnweb.freebsd.org/changeset/base/298849 Log: include: minor spelling fixes. No functional change. Modified: head/include/arpa/nameser.h head/include/rpcsvc/klm_prot.x Modified: head/include/arpa/nameser.h ============================================================================== --- head/include/arpa/nameser.h Sat Apr 30 14:41:18 2016 (r298848) +++ head/include/arpa/nameser.h Sat Apr 30 14:43:42 2016 (r298849) @@ -106,7 +106,7 @@ typedef enum __ns_sect { } ns_sect; /*% - * Network name (compressed or not) type. Equivilent to a pointer when used + * Network name (compressed or not) type. Equivalent to a pointer when used * in a function prototype. Can be const'd. */ typedef u_char ns_nname[NS_MAXNNAME]; Modified: head/include/rpcsvc/klm_prot.x ============================================================================== --- head/include/rpcsvc/klm_prot.x Sat Apr 30 14:41:18 2016 (r298848) +++ head/include/rpcsvc/klm_prot.x Sat Apr 30 14:43:42 2016 (r298849) @@ -34,7 +34,7 @@ * Copyright (C) 1986 Sun Microsystems, Inc. * * protocol used between the UNIX kernel (the "client") and the - * local lock manager. The local lock manager is a deamon running + * local lock manager. The local lock manager is a daemon running * above the kernel. */ From owner-svn-src-head@freebsd.org Sat Apr 30 14:48:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 987B4B22AEE; Sat, 30 Apr 2016 14:48:31 +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 6A2F11AB2; Sat, 30 Apr 2016 14:48:31 +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 u3UEmUha050760; Sat, 30 Apr 2016 14:48:30 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UEmUQm050759; Sat, 30 Apr 2016 14:48:30 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201604301448.u3UEmUQm050759@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 30 Apr 2016 14:48:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298851 - head/usr.bin/sdiff X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 14:48:31 -0000 Author: bapt Date: Sat Apr 30 14:48:30 2016 New Revision: 298851 URL: https://svnweb.freebsd.org/changeset/base/298851 Log: When checking for binary file, check if ch is not EOF only ch actually got a value assigned Reported by: pfg Modified: head/usr.bin/sdiff/sdiff.c Modified: head/usr.bin/sdiff/sdiff.c ============================================================================== --- head/usr.bin/sdiff/sdiff.c Sat Apr 30 14:47:45 2016 (r298850) +++ head/usr.bin/sdiff/sdiff.c Sat Apr 30 14:48:30 2016 (r298851) @@ -514,12 +514,14 @@ istextfile(FILE *f) if (f == NULL) return (1); rewind(f); - for (i = 0; i <= MAX_CHECK || ch != EOF; i++) { + for (i = 0; i <= MAX_CHECK; i++) { ch = fgetc(f); if (ch == '\0') { rewind(f); return (0); } + if (ch == EOF) + break; } rewind(f); return (1); From owner-svn-src-head@freebsd.org Sat Apr 30 16:01:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8040BB0FD18; Sat, 30 Apr 2016 16:01:39 +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 370A01AE7; Sat, 30 Apr 2016 16:01:39 +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 u3UG1cAl072572; Sat, 30 Apr 2016 16:01:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UG1cWX072568; Sat, 30 Apr 2016 16:01:38 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201604301601.u3UG1cWX072568@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 30 Apr 2016 16:01:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298853 - head/sys/fs/fdescfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 16:01:39 -0000 Author: emaste Date: Sat Apr 30 16:01:37 2016 New Revision: 298853 URL: https://svnweb.freebsd.org/changeset/base/298853 Log: Rationalize license numbering in fdescfs(5) Modified: head/sys/fs/fdescfs/fdesc.h head/sys/fs/fdescfs/fdesc_vfsops.c head/sys/fs/fdescfs/fdesc_vnops.c Modified: head/sys/fs/fdescfs/fdesc.h ============================================================================== --- head/sys/fs/fdescfs/fdesc.h Sat Apr 30 15:06:18 2016 (r298852) +++ head/sys/fs/fdescfs/fdesc.h Sat Apr 30 16:01:37 2016 (r298853) @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/fdescfs/fdesc_vfsops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vfsops.c Sat Apr 30 15:06:18 2016 (r298852) +++ head/sys/fs/fdescfs/fdesc_vfsops.c Sat Apr 30 16:01:37 2016 (r298853) @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Sat Apr 30 15:06:18 2016 (r298852) +++ head/sys/fs/fdescfs/fdesc_vnops.c Sat Apr 30 16:01:37 2016 (r298853) @@ -13,7 +13,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * From owner-svn-src-head@freebsd.org Sat Apr 30 17:27:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39AC2B221AB; Sat, 30 Apr 2016 17:27:36 +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 03BE51E40; Sat, 30 Apr 2016 17:27:35 +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 u3UHRZuY098608; Sat, 30 Apr 2016 17:27:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UHRXDi098590; Sat, 30 Apr 2016 17:27:33 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201604301727.u3UHRXDi098590@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 30 Apr 2016 17:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298854 - in head/sys: arm/allwinner arm/arm arm/broadcom/bcm2835 arm/conf arm/freescale/imx arm/include arm/nvidia/tegra124 arm/qemu arm/ti conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 17:27:36 -0000 Author: andrew Date: Sat Apr 30 17:27:33 2016 New Revision: 298854 URL: https://svnweb.freebsd.org/changeset/base/298854 Log: Add a MULTIDELAY option to allow the ARM kernel to have multiple DELAY implementations. Early in the boot the kernel will use an approximate, however after the timer has been probed it will switch to a more accurate implementation. Reviewed by: manu Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5762 Modified: head/sys/arm/allwinner/allwinner_machdep.c head/sys/arm/allwinner/timer.c head/sys/arm/arm/generic_timer.c head/sys/arm/arm/machdep.c head/sys/arm/arm/platform.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/conf/A10 head/sys/arm/conf/ALLWINNER head/sys/arm/conf/VIRT head/sys/arm/freescale/imx/imx51_machdep.c head/sys/arm/freescale/imx/imx53_machdep.c head/sys/arm/freescale/imx/imx6_machdep.c head/sys/arm/include/machdep.h head/sys/arm/include/platformvar.h head/sys/arm/nvidia/tegra124/tegra124_machdep.c head/sys/arm/qemu/virt_machdep.c head/sys/arm/ti/ti_machdep.c head/sys/conf/options.arm Modified: head/sys/arm/allwinner/allwinner_machdep.c ============================================================================== --- head/sys/arm/allwinner/allwinner_machdep.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/allwinner/allwinner_machdep.c Sat Apr 30 17:27:33 2016 (r298854) @@ -148,7 +148,7 @@ static platform_method_t a10_methods[] = PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10"); +FDT_PLATFORM_DEF(a10, "a10", 0, "allwinner,sun4i-a10", 200); #endif #if defined(SOC_ALLWINNER_A20) @@ -163,7 +163,7 @@ static platform_method_t a20_methods[] = #endif PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20"); +FDT_PLATFORM_DEF(a20, "a20", 0, "allwinner,sun7i-a20", 200); #endif #if defined(SOC_ALLWINNER_A31) @@ -178,7 +178,7 @@ static platform_method_t a31_methods[] = #endif PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(a31, "a31", 0, "allwinner,sun6i-a31"); +FDT_PLATFORM_DEF(a31, "a31", 0, "allwinner,sun6i-a31", 200); #endif #if defined(SOC_ALLWINNER_A31S) @@ -193,7 +193,7 @@ static platform_method_t a31s_methods[] #endif PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(a31s, "a31s", 0, "allwinner,sun6i-a31s"); +FDT_PLATFORM_DEF(a31s, "a31s", 0, "allwinner,sun6i-a31s", 200); #endif u_int Modified: head/sys/arm/allwinner/timer.c ============================================================================== --- head/sys/arm/allwinner/timer.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/allwinner/timer.c Sat Apr 30 17:27:33 2016 (r298854) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -100,11 +101,12 @@ static int a10_timer_timer_stop(struct e static uint64_t timer_read_counter64(void); -static int a10_timer_initialized = 0; static int a10_timer_hardclock(void *); static int a10_timer_probe(device_t); static int a10_timer_attach(device_t); +static delay_func a10_timer_delay; + static struct timecounter a10_timer_timecounter = { .tc_name = "a10_timer timer0", .tc_get_timecount = a10_timer_get_timecount, @@ -209,8 +211,10 @@ a10_timer_attach(device_t dev) sc->et.et_priv = sc; et_register(&sc->et); - if (device_get_unit(dev) == 0) + if (device_get_unit(dev) == 0) { + arm_set_delay(a10_timer_delay, sc); a10_timer_sc = sc; + } a10_timer_timecounter.tc_frequency = sc->timer0_freq; tc_init(&a10_timer_timecounter); @@ -224,8 +228,6 @@ a10_timer_attach(device_t dev) a10_timer_timecounter.tc_frequency); } - a10_timer_initialized = 1; - return (0); } @@ -352,23 +354,15 @@ static devclass_t a10_timer_devclass; EARLY_DRIVER_MODULE(a10_timer, simplebus, a10_timer_driver, a10_timer_devclass, 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); -void -DELAY(int usec) +static void +a10_timer_delay(int usec, void *arg) { - uint32_t counter; + struct a10_timer_softc *sc = arg; uint64_t end, now; - if (!a10_timer_initialized) { - for (; usec > 0; usec--) - for (counter = 50; counter > 0; counter--) - cpufunc_nullop(); - return; - } - now = timer_read_counter64(); - end = now + (a10_timer_sc->timer0_freq / 1000000) * (usec + 1); + end = now + (sc->timer0_freq / 1000000) * (usec + 1); while (now < end) now = timer_read_counter64(); } - Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/arm/generic_timer.c Sat Apr 30 17:27:33 2016 (r298854) @@ -57,6 +57,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef MULTIDELAY +#include /* For arm_set_delay */ +#endif + #ifdef FDT #include #include @@ -126,6 +130,7 @@ static struct timecounter arm_tmr_timeco static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc); +static void arm_tmr_do_delay(int usec, void *); static int get_freq(void) @@ -419,6 +424,10 @@ arm_tmr_attach(device_t dev) sc->et.et_priv = sc; et_register(&sc->et); +#ifdef MULTIDELAY + arm_set_delay(arm_tmr_do_delay, sc); +#endif + return (0); } @@ -463,27 +472,13 @@ EARLY_DRIVER_MODULE(timer, acpi, arm_tmr 0, 0, BUS_PASS_TIMER + BUS_PASS_ORDER_MIDDLE); #endif -void -DELAY(int usec) +static void +arm_tmr_do_delay(int usec, void *arg) { + struct arm_tmr_softc *sc = arg; int32_t counts, counts_per_usec; uint32_t first, last; - /* - * Check the timers are setup, if not just - * use a for loop for the meantime - */ - if (arm_tmr_sc == NULL) { - for (; usec > 0; usec--) - for (counts = 200; counts > 0; counts--) - /* - * Prevent the compiler from optimizing - * out the loop - */ - cpufunc_nullop(); - return; - } - /* Get the number of times to count */ counts_per_usec = ((arm_tmr_timecount.tc_frequency / 1000000) + 1); @@ -498,15 +493,38 @@ DELAY(int usec) else counts = usec * counts_per_usec; - first = get_cntxct(arm_tmr_sc->physical); + first = get_cntxct(sc->physical); while (counts > 0) { - last = get_cntxct(arm_tmr_sc->physical); + last = get_cntxct(sc->physical); counts -= (int32_t)(last - first); first = last; } } +#ifndef MULTIDELAY +void +DELAY(int usec) +{ + int32_t counts; + + /* + * Check the timers are setup, if not just + * use a for loop for the meantime + */ + if (arm_tmr_sc == NULL) { + for (; usec > 0; usec--) + for (counts = 200; counts > 0; counts--) + /* + * Prevent the compiler from optimizing + * out the loop + */ + cpufunc_nullop(); + } else + arm_tmr_do_delay(usec, arm_tmr_sc); +} +#endif + static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/arm/machdep.c Sat Apr 30 17:27:33 2016 (r298854) @@ -243,6 +243,10 @@ uint32_t memstart[LBABI_MAX_BANKS]; uint32_t memsize[LBABI_MAX_BANKS]; uint32_t membanks; #endif +#ifdef MULTIDELAY +static delay_func *delay_impl; +static void *delay_arg; +#endif static uint32_t board_revision; /* hex representation of uint64_t */ @@ -550,6 +554,24 @@ arm_generic_initclocks(void) } __weak_reference(arm_generic_initclocks, cpu_initclocks); +#ifdef MULTIDELAY +void +arm_set_delay(delay_func *impl, void *arg) +{ + + KASSERT(impl != NULL, ("No DELAY implementation")); + delay_impl = impl; + delay_arg = arg; +} + +void +DELAY(int usec) +{ + + delay_impl(usec, delay_arg); +} +#endif + int fill_regs(struct thread *td, struct reg *regs) { Modified: head/sys/arm/arm/platform.c ============================================================================== --- head/sys/arm/arm/platform.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/arm/platform.c Sat Apr 30 17:27:33 2016 (r298854) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -75,6 +76,10 @@ SYSCTL_STRING(_hw, OID_AUTO, platform, C */ SET_DECLARE(platform_set, platform_def_t); +#ifdef MULTIDELAY +static delay_func platform_delay; +#endif + void platform_probe_and_attach(void) { @@ -100,8 +105,9 @@ platform_probe_and_attach(void) * Take care of compiling the selected class, and * then statically initialise the MMU object */ - kobj_class_compile_static(platp, &plat_kernel_kops); - kobj_init_static((kobj_t)plat_obj, platp); + kobj_class_compile_static((kobj_class_t)platp, + &plat_kernel_kops); + kobj_init_static((kobj_t)plat_obj, (kobj_class_t)platp); plat_obj->cls = platp; @@ -141,10 +147,16 @@ platform_probe_and_attach(void) * correct one, and then attach. */ - kobj_class_compile_static(plat_def_impl, &plat_kernel_kops); - kobj_init_static((kobj_t)plat_obj, plat_def_impl); - - strlcpy(plat_name,plat_def_impl->name,sizeof(plat_name)); + kobj_class_compile_static((kobj_class_t)plat_def_impl, + &plat_kernel_kops); + kobj_init_static((kobj_t)plat_obj, (kobj_class_t)plat_def_impl); + + strlcpy(plat_name, plat_def_impl->name, sizeof(plat_name)); + +#ifdef MULTIDELAY + /* Set a default delay function */ + arm_set_delay(platform_delay, NULL); +#endif PLATFORM_ATTACH(plat_obj); } @@ -177,6 +189,22 @@ platform_late_init(void) PLATFORM_LATE_INIT(plat_obj); } +#ifdef MULTIDELAY +static void +platform_delay(int usec, void *arg __unused) +{ + int counts; + + for (; usec > 0; usec--) + for (counts = plat_obj->cls->delay_count; counts > 0; counts--) + /* + * Prevent the compiler from optimizing + * out the loop + */ + cpufunc_nullop(); +} +#endif + #if defined(SMP) && defined(PLATFORM_SMP) void platform_mp_setmaxid(void) Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Apr 30 17:27:33 2016 (r298854) @@ -142,7 +142,7 @@ static platform_method_t bcm2835_methods PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b"); +FDT_PLATFORM_DEF(bcm2835, "bcm2835", 0, "raspberrypi,model-b", 0); #endif #ifdef SOC_BCM2836 @@ -153,5 +153,5 @@ static platform_method_t bcm2836_methods PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(bcm2836, "bcm2836", 0, "brcm,bcm2709"); +FDT_PLATFORM_DEF(bcm2836, "bcm2836", 0, "brcm,bcm2709", 0); #endif Modified: head/sys/arm/conf/A10 ============================================================================== --- head/sys/arm/conf/A10 Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/conf/A10 Sat Apr 30 17:27:33 2016 (r298854) @@ -30,6 +30,7 @@ options SOC_ALLWINNER_A10 options HZ=100 options SCHED_4BSD # 4BSD scheduler options PLATFORM +options MULTIDELAY # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/ALLWINNER ============================================================================== --- head/sys/arm/conf/ALLWINNER Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/conf/ALLWINNER Sat Apr 30 17:27:33 2016 (r298854) @@ -34,6 +34,7 @@ options SCHED_ULE # ULE scheduler options SMP # Enable multiple cores options PLATFORM options PLATFORM_SMP +options MULTIDELAY # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/conf/VIRT ============================================================================== --- head/sys/arm/conf/VIRT Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/conf/VIRT Sat Apr 30 17:27:33 2016 (r298854) @@ -28,6 +28,7 @@ options SCHED_ULE # 4BSD scheduler options PLATFORM options PLATFORM_SMP options SMP # Enable multiple cores +options MULTIDELAY # Debugging for use in -current makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols Modified: head/sys/arm/freescale/imx/imx51_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx51_machdep.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/freescale/imx/imx51_machdep.c Sat Apr 30 17:27:33 2016 (r298854) @@ -101,4 +101,4 @@ static platform_method_t imx51_methods[] PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51"); +FDT_PLATFORM_DEF(imx51, "i.MX51", 0, "fsl,imx51", 0); Modified: head/sys/arm/freescale/imx/imx53_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx53_machdep.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/freescale/imx/imx53_machdep.c Sat Apr 30 17:27:33 2016 (r298854) @@ -101,5 +101,5 @@ static platform_method_t imx53_methods[] PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(imx53, "i.MX53", 0, "fsl,imx53"); +FDT_PLATFORM_DEF(imx53, "i.MX53", 0, "fsl,imx53", 0); Modified: head/sys/arm/freescale/imx/imx6_machdep.c ============================================================================== --- head/sys/arm/freescale/imx/imx6_machdep.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/freescale/imx/imx6_machdep.c Sat Apr 30 17:27:33 2016 (r298854) @@ -354,6 +354,6 @@ static platform_method_t imx6_methods[] PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF2(imx6, imx6s, "i.MX6 Solo", 0, "fsl,imx6s"); -FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6d"); -FDT_PLATFORM_DEF2(imx6, imx6q, "i.MX6 Quad", 0, "fsl,imx6q"); +FDT_PLATFORM_DEF2(imx6, imx6s, "i.MX6 Solo", 0, "fsl,imx6s", 0); +FDT_PLATFORM_DEF2(imx6, imx6d, "i.MX6 Dual", 0, "fsl,imx6d", 0); +FDT_PLATFORM_DEF2(imx6, imx6q, "i.MX6 Quad", 0, "fsl,imx6q", 0); Modified: head/sys/arm/include/machdep.h ============================================================================== --- head/sys/arm/include/machdep.h Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/include/machdep.h Sat Apr 30 17:27:33 2016 (r298854) @@ -49,4 +49,9 @@ void board_set_revision(uint32_t); int arm_predict_branch(void *, u_int, register_t, register_t *, u_int (*)(void*, int), u_int (*)(void*, vm_offset_t, u_int*)); +#ifdef MULTIDELAY +typedef void delay_func(int, void *); +void arm_set_delay(delay_func *, void *); +#endif + #endif /* !_MACHINE_MACHDEP_H_ */ Modified: head/sys/arm/include/platformvar.h ============================================================================== --- head/sys/arm/include/platformvar.h Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/include/platformvar.h Sat Apr 30 17:27:33 2016 (r298854) @@ -53,6 +53,13 @@ #include #include +struct platform_class { + KOBJ_CLASS_FIELDS; + + /* How many times to loop to delay approximately 1us */ + int delay_count; +}; + struct platform_kobj { /* * A platform instance is a kernel object @@ -60,11 +67,15 @@ struct platform_kobj { KOBJ_FIELDS; /* Platform class, for access to class specific data */ - struct kobj_class *cls; + struct platform_class *cls; +}; + +struct platform_data { + int delay_count; }; typedef struct platform_kobj *platform_t; -typedef struct kobj_class platform_def_t; +typedef struct platform_class platform_def_t; #define platform_method_t kobj_method_t #define PLATFORMMETHOD KOBJMETHOD @@ -83,7 +94,20 @@ typedef struct fdt_platform_class fdt_pl extern platform_method_t fdt_platform_methods[]; -#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, size, compatible) \ +#ifdef MULTIDELAY +#define FDT_PLATFORM_CTASSERT(delay) CTASSERT(delay > 0) +#else +#define FDT_PLATFORM_CTASSERT(delay) CTASSERT(delay == 0) +#endif + +#define PLATFORM_DATA(NAME, delay) \ +static struct platform_data NAME ## _platc = { \ + .delay_count = delay; \ +}; + +#define FDT_PLATFORM_DEF2(NAME, VAR_NAME, NAME_STR, size, compatible, \ + delay) \ +FDT_PLATFORM_CTASSERT(delay); \ static fdt_platform_def_t VAR_NAME ## _fdt_platform = { \ .name = NAME_STR, \ .methods = fdt_platform_methods, \ @@ -96,12 +120,15 @@ static platform_def_t VAR_NAME ## _platf NAME ## _methods, \ size, \ VAR_NAME ## _baseclasses, \ + delay, \ }; \ DATA_SET(platform_set, VAR_NAME ## _platform) -#define FDT_PLATFORM_DEF(NAME, NAME_STR, size, compatible) \ - FDT_PLATFORM_DEF2(NAME, NAME, NAME_STR, size, compatible) +#define FDT_PLATFORM_DEF(NAME, NAME_STR, size, compatible, delay) \ + FDT_PLATFORM_DEF2(NAME, NAME, NAME_STR, size, compatible, delay) #endif +bool arm_tmr_timed_wait(platform_t, int); + #endif /* _MACHINE_PLATFORMVAR_H_ */ Modified: head/sys/arm/nvidia/tegra124/tegra124_machdep.c ============================================================================== --- head/sys/arm/nvidia/tegra124/tegra124_machdep.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/nvidia/tegra124/tegra124_machdep.c Sat Apr 30 17:27:33 2016 (r298854) @@ -170,4 +170,4 @@ static platform_method_t tegra124_method PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(tegra124, "Nvidia Jetson-TK1", 0, "nvidia,jetson-tk1"); +FDT_PLATFORM_DEF(tegra124, "Nvidia Jetson-TK1", 0, "nvidia,jetson-tk1", 0); Modified: head/sys/arm/qemu/virt_machdep.c ============================================================================== --- head/sys/arm/qemu/virt_machdep.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/qemu/virt_machdep.c Sat Apr 30 17:27:33 2016 (r298854) @@ -96,4 +96,4 @@ static platform_method_t virt_methods[] PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(virt, "virt", 0, "linux,dummy-virt"); +FDT_PLATFORM_DEF(virt, "virt", 0, "linux,dummy-virt", 1); Modified: head/sys/arm/ti/ti_machdep.c ============================================================================== --- head/sys/arm/ti/ti_machdep.c Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/arm/ti/ti_machdep.c Sat Apr 30 17:27:33 2016 (r298854) @@ -128,7 +128,7 @@ static platform_method_t omap4_methods[] PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(omap4, "omap4", 0, "ti,omap4430"); +FDT_PLATFORM_DEF(omap4, "omap4", 0, "ti,omap4430", 0); #endif #if defined(SOC_TI_AM335X) @@ -139,5 +139,5 @@ static platform_method_t am335x_methods[ PLATFORMMETHOD_END, }; -FDT_PLATFORM_DEF(am335x, "am335x", 0, "ti,am335x"); +FDT_PLATFORM_DEF(am335x, "am335x", 0, "ti,am335x", 0); #endif Modified: head/sys/conf/options.arm ============================================================================== --- head/sys/conf/options.arm Sat Apr 30 16:01:37 2016 (r298853) +++ head/sys/conf/options.arm Sat Apr 30 17:27:33 2016 (r298854) @@ -32,6 +32,7 @@ KERNBASE opt_global.h KERNVIRTADDR opt_global.h LINUX_BOOT_ABI opt_global.h LOADERRAMADDR opt_global.h +MULTIDELAY opt_global.h PHYSADDR opt_global.h PLATFORM opt_global.h PLATFORM_SMP opt_global.h From owner-svn-src-head@freebsd.org Sat Apr 30 18:07:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4BE2B2289A; Sat, 30 Apr 2016 18:07:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 989D41F36; Sat, 30 Apr 2016 18:07:14 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3UI7Do4010897; Sat, 30 Apr 2016 18:07:13 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UI7Don010896; Sat, 30 Apr 2016 18:07:13 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201604301807.u3UI7Don010896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 30 Apr 2016 18:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298855 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 18:07:14 -0000 Author: manu Date: Sat Apr 30 18:07:13 2016 New Revision: 298855 URL: https://svnweb.freebsd.org/changeset/base/298855 Log: ACK the interrupt after disabling it, this avoid an interrupt storm. Approved by: andrew (mentor) Modified: head/sys/arm/allwinner/aw_nmi.c Modified: head/sys/arm/allwinner/aw_nmi.c ============================================================================== --- head/sys/arm/allwinner/aw_nmi.c Sat Apr 30 17:27:33 2016 (r298854) +++ head/sys/arm/allwinner/aw_nmi.c Sat Apr 30 18:07:13 2016 (r298855) @@ -277,8 +277,11 @@ aw_nmi_teardown_intr(device_t dev, struc static void aw_nmi_pre_ithread(device_t dev, struct intr_irqsrc *isrc) { + struct aw_nmi_softc *sc; + sc = device_get_softc(dev); aw_nmi_disable_intr(dev, isrc); + SC_NMI_WRITE(sc, NMI_IRQ_PENDING_REG, NMI_IRQ_ACK); } static void From owner-svn-src-head@freebsd.org Sat Apr 30 18:56:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88C92AD9745; Sat, 30 Apr 2016 18:56:36 +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 5A7CF1D73; Sat, 30 Apr 2016 18:56:36 +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 u3UIuZmt026291; Sat, 30 Apr 2016 18:56:35 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UIuZpi026290; Sat, 30 Apr 2016 18:56:35 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604301856.u3UIuZpi026290@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 18:56:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298856 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 18:56:36 -0000 Author: pfg Date: Sat Apr 30 18:56:35 2016 New Revision: 298856 URL: https://svnweb.freebsd.org/changeset/base/298856 Log: powerpc: Make use of our rounddown() macro when sys/param.h is available. No functional change. Modified: head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 18:07:13 2016 (r298855) +++ head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 18:56:35 2016 (r298856) @@ -162,7 +162,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, code = siginfo32.si_code; sfp = (caddr_t)&sf32; sfpsize = sizeof(sf32); - rndfsize = ((sizeof(sf32) + 15) / 16) * 16; + rndfsize = rounddown(sizeof(sf32) + 15, 16); /* * Save user context @@ -189,9 +189,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, * 64-bit PPC defines a 288 byte scratch region * below the stack. */ - rndfsize = 288 + ((sizeof(sf) + 47) / 48) * 48; + rndfsize = 288 + rounddown(sizeof(sf) + 47, 48); #else - rndfsize = ((sizeof(sf) + 15) / 16) * 16; + rndfsize = rounddown(sizeof(sf) + 15, 16); #endif /* From owner-svn-src-head@freebsd.org Sat Apr 30 19:01:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50CF2AD98B9; Sat, 30 Apr 2016 19:01:52 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 224D410BD; Sat, 30 Apr 2016 19:01:52 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3UJ1pI1027154; Sat, 30 Apr 2016 19:01:51 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UJ1pLr027153; Sat, 30 Apr 2016 19:01:51 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201604301901.u3UJ1pLr027153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Sat, 30 Apr 2016 19:01:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298857 - 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 19:01:52 -0000 Author: peter Date: Sat Apr 30 19:01:51 2016 New Revision: 298857 URL: https://svnweb.freebsd.org/changeset/base/298857 Log: Fix incorrect permissions for /etc/rc.d/sendmail in fallout from release-pkg merge. Modified: head/etc/rc.d/Makefile Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Apr 30 18:56:35 2016 (r298856) +++ head/etc/rc.d/Makefile Sat Apr 30 19:01:51 2016 (r298857) @@ -295,7 +295,7 @@ FILESGROUPS+= SMRCD SMRCD= sendmail .endif SMRCDDIR= /etc/rc.d -SMRCDDIRMODE= ${BINMODE} +SMRCDMODE= ${BINMODE} SMRCDPACKAGE= sendmail .if ${MK_TIMED} != "no" From owner-svn-src-head@freebsd.org Sat Apr 30 19:05:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5591BAD9972; Sat, 30 Apr 2016 19:05:01 +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 2D6951382; Sat, 30 Apr 2016 19:05:01 +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 u3UJ50QK029555; Sat, 30 Apr 2016 19:05:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UJ4xsv029542; Sat, 30 Apr 2016 19:04:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604301904.u3UJ4xsv029542@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 19:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298858 - in head/sbin: camcontrol ipfw pfctl swapon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 19:05:01 -0000 Author: pfg Date: Sat Apr 30 19:04:59 2016 New Revision: 298858 URL: https://svnweb.freebsd.org/changeset/base/298858 Log: sbin: minor spelling fixes. No functional change. Modified: head/sbin/camcontrol/fwdownload.c head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipv6.c head/sbin/pfctl/parse.y head/sbin/swapon/swapon.c Modified: head/sbin/camcontrol/fwdownload.c ============================================================================== --- head/sbin/camcontrol/fwdownload.c Sat Apr 30 19:01:51 2016 (r298857) +++ head/sbin/camcontrol/fwdownload.c Sat Apr 30 19:04:59 2016 (r298858) @@ -216,7 +216,7 @@ static struct fw_vendor vendors_list[] = * since we won't actually send a WRITE BUFFER with any of the * listed parameters. If a SATA device is behind a SAS controller, * the SCSI to ATA translation code (at least for LSI) doesn't - * generaly translate a SCSI WRITE BUFFER into an ATA DOWNLOAD + * generally translate a SCSI WRITE BUFFER into an ATA DOWNLOAD * MICROCODE command. So, we use the SCSI ATA PASS_THROUGH command * to send the ATA DOWNLOAD MICROCODE command instead. */ Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Sat Apr 30 19:01:51 2016 (r298857) +++ head/sbin/ipfw/ipfw2.c Sat Apr 30 19:04:59 2016 (r298858) @@ -82,7 +82,7 @@ int ipfw_socket = -1; * Check if we have enough space in cmd buffer. Note that since * first 8? u32 words are reserved by reserved header, full cmd * buffer can't be used, so we need to protect from buffer overrun - * only. At the beginnig, cblen is less than actual buffer size by + * only. At the beginning, cblen is less than actual buffer size by * size of ipfw_insn_u32 instruction + 1 u32 work. This eliminates need * for checking small instructions fitting in given range. * We also (ab)use the fact that ipfw_insn is always the first field @@ -4929,7 +4929,7 @@ table_search_ctlv(ipfw_obj_ctlv *ctlv, u * Rules in reply are modified to store their actual ruleset number. * * (*1) TLVs inside IPFW_TLV_TBL_LIST needs to be sorted ascending - * accoring to their idx field and there has to be no duplicates. + * according to their idx field and there has to be no duplicates. * (*2) Numbered rules inside IPFW_TLV_RULE_LIST needs to be sorted ascending. * (*3) Each ip_fw structure needs to be aligned to u64 boundary. */ Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Sat Apr 30 19:01:51 2016 (r298857) +++ head/sbin/ipfw/ipv6.c Sat Apr 30 19:04:59 2016 (r298858) @@ -325,7 +325,7 @@ lookup_host6 (char *host, struct in6_add * any matches any IP6. Actually returns an empty instruction. * me returns O_IP6_*_ME * - * 03f1::234:123:0342 single IP6 addres + * 03f1::234:123:0342 single IP6 address * 03f1::234:123:0342/24 address/mask * 03f1::234:123:0342/24,03f1::234:123:0343/ List of address * Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Sat Apr 30 19:01:51 2016 (r298857) +++ head/sbin/pfctl/parse.y Sat Apr 30 19:04:59 2016 (r298858) @@ -6173,7 +6173,7 @@ rt_tableid_max(void) /* * As the OpenBSD code only compares > and not >= we need to adjust * here given we only accept values of 0..n and want to avoid #ifdefs - * in the grammer. + * in the grammar. */ return (fibs - 1); #else Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Sat Apr 30 19:01:51 2016 (r298857) +++ head/sbin/swapon/swapon.c Sat Apr 30 19:04:59 2016 (r298858) @@ -428,7 +428,7 @@ swap_on_off_geli(const char *name, char free(args); if (error) { - /* error occured during creation. */ + /* error occurred during creation. */ if (qflag == 0) warnx("%s: Invalid parameters", name); return (NULL); From owner-svn-src-head@freebsd.org Sat Apr 30 19:24:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4A9FAD9F2D; Sat, 30 Apr 2016 19:24:51 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::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 6B6181ECE; Sat, 30 Apr 2016 19:24:51 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-oi0-x22d.google.com with SMTP id v145so119388995oie.0; Sat, 30 Apr 2016 12:24:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=skRpxMPj7NIUGEvaN7F/rZfUU7JP05gq1iKhJ6kMJ9o=; b=T5R8tZ5Ikpp8lIy99617eTHXbHOkSeSm4LPLRNwF3OfhCGankLDuUrOjdZqvmh8rYR CHF6XVVSeJKLVPb+Q41prni+SMm8tNMuv7pVt3bzfhR5CVevrR1nu/hsQpvlNa23JFIN ZqcuGxMY+NVTtEno8eYzJcT3/NYzH346zxJTIOdo+uAYHRRyZq3idwDSsXIXtS7uUM5l HeoIseTIy1qcolfXpD3D1x8NUsyKtyoTSRkmMSJXS0pTBtbziAwcP1T9RBEtgQyiKH5b ZrmOxTIHj12/pyjUvy26gImQfBpJW7DWDAiuUJ6m9wO5PZeCPDDH9qZx6zxCHwQWMOpl mj5A== 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; bh=skRpxMPj7NIUGEvaN7F/rZfUU7JP05gq1iKhJ6kMJ9o=; b=iwWr4Pn9ocbZ0/S7FSTsIkk7uuKXDyuKWLsXpjuYTXQRMNNYqbtmIv18trB8hUq2UR 5p9btrn3sMkXXBSsdn0kIpm0iz/hlFX4a033WCFz/GNZP6f0pt0MlNwNXsgfDmoTf/oa jwtbQewz8mV/nGeKr/BJb1yDRNp4q3gF8eIF5vI9+hc2WwfWF1cUkk9/8/YNwgogSm+N C1hzTbS1cz7xF/f2JZBO6+jycOgABL80XvLUjCQQx776BFduDeBs8BDTzjqJ3MFhZoX8 QAGlqatBKITEGMcv9c/6zj/j8PVzyABwXlyR/MJ08t56RB6boyRJu63bKzO7rVS+fwyc Dl6w== X-Gm-Message-State: AOPr4FW16i4IcJiAroT+RJQnXo8MUjYJOz7xQwC/UBdK6uhylbBY5PI8I92DKsP2zg0LuD9CTwybCYBQLTBLjw== MIME-Version: 1.0 X-Received: by 10.157.26.16 with SMTP id a16mr12925696ote.5.1462044290862; Sat, 30 Apr 2016 12:24:50 -0700 (PDT) Received: by 10.182.105.74 with HTTP; Sat, 30 Apr 2016 12:24:50 -0700 (PDT) Received: by 10.182.105.74 with HTTP; Sat, 30 Apr 2016 12:24:50 -0700 (PDT) In-Reply-To: <201604301856.u3UIuZpi026290@repo.freebsd.org> References: <201604301856.u3UIuZpi026290@repo.freebsd.org> Date: Sat, 30 Apr 2016 14:24:50 -0500 Message-ID: Subject: Re: svn commit: r298856 - head/sys/powerpc/powerpc From: Justin Hibbits To: Pedro Giffuni Cc: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 19:24:51 -0000 On Apr 30, 2016 13:56, "Pedro F. Giffuni" wrote: > > Author: pfg > Date: Sat Apr 30 18:56:35 2016 > New Revision: 298856 > URL: https://svnweb.freebsd.org/changeset/base/298856 > > Log: > powerpc: Make use of our rounddown() macro when sys/param.h is available. > > No functional change. > > Modified: > head/sys/powerpc/powerpc/exec_machdep.c > > Modified: head/sys/powerpc/powerpc/exec_machdep.c > ============================================================================== > --- head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 18:07:13 2016 (r298855) > +++ head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 18:56:35 2016 (r298856) > @@ -162,7 +162,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, > code = siginfo32.si_code; > sfp = (caddr_t)&sf32; > sfpsize = sizeof(sf32); > - rndfsize = ((sizeof(sf32) + 15) / 16) * 16; > + rndfsize = rounddown(sizeof(sf32) + 15, 16); > > /* > * Save user context > @@ -189,9 +189,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, > * 64-bit PPC defines a 288 byte scratch region > * below the stack. > */ > - rndfsize = 288 + ((sizeof(sf) + 47) / 48) * 48; > + rndfsize = 288 + rounddown(sizeof(sf) + 47, 48); > #else > - rndfsize = ((sizeof(sf) + 15) / 16) * 16; > + rndfsize = rounddown(sizeof(sf) + 15, 16); > #endif > > /* > I think these should all be roundup(sizeof(sf), (16 or 48)). - Justin From owner-svn-src-head@freebsd.org Sat Apr 30 19:29:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FF1CAD9FE7; Sat, 30 Apr 2016 19:29:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 43738109D; Sat, 30 Apr 2016 19:29:04 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3UJT3g3035880; Sat, 30 Apr 2016 19:29:03 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UJT33f035878; Sat, 30 Apr 2016 19:29:03 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201604301929.u3UJT33f035878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sat, 30 Apr 2016 19:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298859 - 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 19:29:04 -0000 Author: rwatson Date: Sat Apr 30 19:29:03 2016 New Revision: 298859 URL: https://svnweb.freebsd.org/changeset/base/298859 Log: When attempting to satisfy mmap() requests for superpage alignment on 64-bit MIPS, use superpage rather than physical-segment constants, or we may improperly fail to apply suitable alignment -- yet still allow mmap() to appear to succeed. Reviewed by: sson MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/mips/include/param.h head/sys/mips/mips/pmap.c Modified: head/sys/mips/include/param.h ============================================================================== --- head/sys/mips/include/param.h Sat Apr 30 19:04:59 2016 (r298858) +++ head/sys/mips/include/param.h Sat Apr 30 19:29:03 2016 (r298859) @@ -146,12 +146,14 @@ #define SEGSHIFT (PAGE_SHIFT + NPTEPGSHIFT + NPDEPGSHIFT) #define NBSEG (1ul << SEGSHIFT) #define PDRSHIFT (PAGE_SHIFT + NPTEPGSHIFT) +#define PDRSIZE (1ul << PDRSHIFT) #define PDRMASK ((1 << PDRSHIFT) - 1) #else #define NPDEPGSHIFT 10 /* LOG2(NPTEPG) */ #define SEGSHIFT (PAGE_SHIFT + NPTEPGSHIFT) #define NBSEG (1 << SEGSHIFT) /* bytes/segment */ #define PDRSHIFT SEGSHIFT /* alias for SEG in 32 bit */ +#define PDRSIZE (1ul << PDRSHIFT) #define PDRMASK ((1 << PDRSHIFT) - 1) #endif #define NBPDR (1 << PDRSHIFT) /* bytes/pagedir */ Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Apr 30 19:04:59 2016 (r298858) +++ head/sys/mips/mips/pmap.c Sat Apr 30 19:29:03 2016 (r298859) @@ -3299,18 +3299,18 @@ pmap_align_superpage(vm_object_t object, { vm_offset_t superpage_offset; - if (size < NBSEG) + if (size < PDRSIZE) return; if (object != NULL && (object->flags & OBJ_COLORED) != 0) offset += ptoa(object->pg_color); - superpage_offset = offset & SEGMASK; - if (size - ((NBSEG - superpage_offset) & SEGMASK) < NBSEG || - (*addr & SEGMASK) == superpage_offset) + superpage_offset = offset & PDRMASK; + if (size - ((PDRSIZE - superpage_offset) & PDRMASK) < PDRSIZE || + (*addr & PDRMASK) == superpage_offset) return; - if ((*addr & SEGMASK) < superpage_offset) - *addr = (*addr & ~SEGMASK) + superpage_offset; + if ((*addr & PDRMASK) < superpage_offset) + *addr = (*addr & ~PDRMASK) + superpage_offset; else - *addr = ((*addr + SEGMASK) & ~SEGMASK) + superpage_offset; + *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset; } #ifdef DDB From owner-svn-src-head@freebsd.org Sat Apr 30 19:39:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D60DB22146 for ; Sat, 30 Apr 2016 19:39:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm31-vm8.bullet.mail.bf1.yahoo.com (nm31-vm8.bullet.mail.bf1.yahoo.com [72.30.239.134]) (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 C99CA1502 for ; Sat, 30 Apr 2016 19:39:44 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1462045177; bh=OaxpYMdcrwaH81Iyb3aAv/H+IeV8BmVFIsyJgyKiZ3A=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=Q09MN33eVEYnNMWd+oTibx5qtAoisN23GwPHe3hqF+KkPP8CoOPnPyb1nNT5BeBG7Auq4tGISWvY3b+mnhW4wv8LMlioluFddq5HvJKKD7aFskBnq427C9c04Tnx1ecY1JWw+cJuc7NypgIIZoxjFA+z4y+eGKpyHkKpL2cJ2eq/VlfwQoH5VGXLUtT1BGZJFyFT8pw2Z9ql6HKSGCO9Cc61/0tiNK4YBiBETgaM6NSPMtKvLUMY7HoM2GIB9GVaRFltV+xPrEWpp/sHgTp6UzYqjdTp2/86E8WH5KGIlzt9jdxG0YdM97UnQBht/fqMDCVJEOyga9ztoTASqb3Rwg== Received: from [66.196.81.172] by nm31.bullet.mail.bf1.yahoo.com with NNFMP; 30 Apr 2016 19:39:37 -0000 Received: from [98.139.211.200] by tm18.bullet.mail.bf1.yahoo.com with NNFMP; 30 Apr 2016 19:39:37 -0000 Received: from [127.0.0.1] by smtp209.mail.bf1.yahoo.com with NNFMP; 30 Apr 2016 19:39:37 -0000 X-Yahoo-Newman-Id: 101729.16552.bm@smtp209.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: .ByMw7QVM1kVD0LvuHZzgsxPc1oW9Wqm2Noq.Snt0Xr.Obx fab7Css4qArAm3F6RZdRf9jxZiUGEQgN98gJCCVQPfW5_CBBFWmdfaRqMYKF Ww7qXUSZIEd94wkV60cTEE2gQ.gOIxZdwRD2Ln4z7SNBNa5BN7lk3wM8duD0 2eaYFshKEWkFezNhEJxdxTnn55W9BhZG4DFBFEWiUuauEyIxl9C_ofYAlWz0 IDZKNy35gXceurL64xhwnQ0yyh9tLFgPjCwXHrlXD0vPhOhv7C0mUUCUWu8t s6hXK.JAOgGD1CXryg9VUT.W6EFU2H3P80_q0aUu59hqeCKvlfnP4wumZy7w fkmSbuAevNTeSoippdNQtoRd8IgQQpQTXfYJb_dnHaDbQbQSofziIImCfMQr Wz3IwKFfJ_ZdMZ_PgubFw8hXiBtE6P87kiV72fhqXRfTaSfGsbqNmgrL1bqv NQSnuApzkAPVOiEnYs6KDXWRnZ1LK2.EoLe_cDVuKqAMjwecxbeFIlvsi.lT lCsD6ZGTt.uXAhY4uLmVFkNsp2x4nx1TC X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r298856 - head/sys/powerpc/powerpc To: Justin Hibbits References: <201604301856.u3UIuZpi026290@repo.freebsd.org> Cc: src-committers , svn-src-head@freebsd.org, svn-src-all@freebsd.org From: Pedro Giffuni Message-ID: <127f3109-39f9-c65f-2c16-140c6a878de9@FreeBSD.org> Date: Sat, 30 Apr 2016 14:39:36 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 19:39:45 -0000 On 04/30/16 14:24, Justin Hibbits wrote: > > On Apr 30, 2016 13:56, "Pedro F. Giffuni" > wrote: >> >> Author: pfg >> Date: Sat Apr 30 18:56:35 2016 >> New Revision: 298856 >> URL: https://svnweb.freebsd.org/changeset/base/298856 >> >> Log: >> powerpc: Make use of our rounddown() macro when sys/param.h is > available. >> >> No functional change. >> >> Modified: >> head/sys/powerpc/powerpc/exec_machdep.c >> >> Modified: head/sys/powerpc/powerpc/exec_machdep.c >> > ============================================================================== >> --- head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 18:07:13 > 2016 (r298855) >> +++ head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 18:56:35 > 2016 (r298856) >> @@ -162,7 +162,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, >> code = siginfo32.si_code; >> sfp = (caddr_t)&sf32; >> sfpsize = sizeof(sf32); >> - rndfsize = ((sizeof(sf32) + 15) / 16) * 16; >> + rndfsize = rounddown(sizeof(sf32) + 15, 16); >> >> /* >> * Save user context >> @@ -189,9 +189,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, >> * 64-bit PPC defines a 288 byte scratch region >> * below the stack. >> */ >> - rndfsize = 288 + ((sizeof(sf) + 47) / 48) * 48; >> + rndfsize = 288 + rounddown(sizeof(sf) + 47, 48); >> #else >> - rndfsize = ((sizeof(sf) + 15) / 16) * 16; >> + rndfsize = rounddown(sizeof(sf) + 15, 16); >> #endif >> >> /* >> > > I think these should all be roundup(sizeof(sf), (16 or 48)). > Yes, makes sense. roundup() is a special case of rounddown() but coccinelle doesn't do math ;). Thanks, Pedro. From owner-svn-src-head@freebsd.org Sat Apr 30 19:51:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D66EB2235F; Sat, 30 Apr 2016 19:51:00 +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 63B1D1AE2; Sat, 30 Apr 2016 19:51:00 +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 u3UJoxSo042681; Sat, 30 Apr 2016 19:50:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UJoxwG042680; Sat, 30 Apr 2016 19:50:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604301950.u3UJoxwG042680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 19:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298860 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 19:51:00 -0000 Author: pfg Date: Sat Apr 30 19:50:59 2016 New Revision: 298860 URL: https://svnweb.freebsd.org/changeset/base/298860 Log: powerpc: Replace rounddown() from r298856 with roundup(). Both are equivalent but roundup is more logical for this case. Catch another case while here. Pointed out by: jhibbits Modified: head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 19:29:03 2016 (r298859) +++ head/sys/powerpc/powerpc/exec_machdep.c Sat Apr 30 19:50:59 2016 (r298860) @@ -162,7 +162,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, code = siginfo32.si_code; sfp = (caddr_t)&sf32; sfpsize = sizeof(sf32); - rndfsize = rounddown(sizeof(sf32) + 15, 16); + rndfsize = roundup(sizeof(sf32), 16); /* * Save user context @@ -189,9 +189,9 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, * 64-bit PPC defines a 288 byte scratch region * below the stack. */ - rndfsize = 288 + rounddown(sizeof(sf) + 47, 48); + rndfsize = 288 + roundup(sizeof(sf), 48); #else - rndfsize = rounddown(sizeof(sf) + 15, 16); + rndfsize = roundup(sizeof(sf), 16); #endif /* From owner-svn-src-head@freebsd.org Sat Apr 30 19:58:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BF71B224B2; Sat, 30 Apr 2016 19:58:55 +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 3EB1B1ED3; Sat, 30 Apr 2016 19:58:55 +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 u3UJws23044934; Sat, 30 Apr 2016 19:58:54 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UJwsOo044932; Sat, 30 Apr 2016 19:58:54 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604301958.u3UJwsOo044932@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 19:58:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298861 - in head/sbin: fdisk fdisk_pc98 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 19:58:55 -0000 Author: pfg Date: Sat Apr 30 19:58:54 2016 New Revision: 298861 URL: https://svnweb.freebsd.org/changeset/base/298861 Log: fdisk: drop unused macro and make use of roundup()/rounddown(). Modified: head/sbin/fdisk/fdisk.c head/sbin/fdisk_pc98/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Sat Apr 30 19:50:59 2016 (r298860) +++ head/sbin/fdisk/fdisk.c Sat Apr 30 19:58:54 2016 (r298861) @@ -67,8 +67,6 @@ static char lbuf[LBUF]; #define Decimal(str, ans, tmp, maxval) if (decimal(str, &tmp, ans, maxval)) ans = tmp -#define RoundCyl(x) ((((x) + cylsecs - 1) / cylsecs) * cylsecs) - #define MAX_SEC_SIZE 2048 /* maximum section size that is supported */ #define MIN_SEC_SIZE 512 /* the sector size to start sensing at */ static int secsize = 0; /* the sensed sector size */ @@ -387,7 +385,7 @@ main(int argc, char *argv[]) partp->dp_typ = DOSPTYP_386BSD; partp->dp_flag = ACTIVE; partp->dp_start = dos_sectors; - partp->dp_size = (disksecs / dos_cylsecs) * dos_cylsecs - + partp->dp_size = rounddown(disksecs, dos_cylsecs) - dos_sectors; dos(partp); if (v_flag) @@ -540,11 +538,11 @@ init_sector0(unsigned long start) partp->dp_typ = DOSPTYP_386BSD; partp->dp_flag = ACTIVE; - start = ((start + dos_sectors - 1) / dos_sectors) * dos_sectors; + start = roundup(start, dos_sectors); if(start == 0) start = dos_sectors; partp->dp_start = start; - partp->dp_size = (disksecs / dos_cylsecs) * dos_cylsecs - start; + partp->dp_size = rounddown(disksecs, dos_cylsecs) - start; dos(partp); } @@ -1188,8 +1186,8 @@ process_partition(CMD *command) prev_partp->dp_size; } if (partp->dp_start % dos_sectors != 0) { - prev_head_boundary = partp->dp_start / - dos_sectors * dos_sectors; + prev_head_boundary = rounddown(partp->dp_start, + dos_sectors); partp->dp_start = prev_head_boundary + dos_sectors; } @@ -1203,15 +1201,15 @@ process_partition(CMD *command) if (command->args[3].arg_str != NULL) { if (strcmp(command->args[3].arg_str, "*") == 0) - partp->dp_size = ((disksecs / dos_cylsecs) * - dos_cylsecs) - partp->dp_start; + partp->dp_size = rounddown(disksecs, dos_cylsecs) - + partp->dp_start; else { partp->dp_size = str2sectors(command->args[3].arg_str); if (partp->dp_size == NO_DISK_SECTORS) break; } - prev_cyl_boundary = ((partp->dp_start + partp->dp_size) / - dos_cylsecs) * dos_cylsecs; + prev_cyl_boundary = rounddown(partp->dp_start + partp->dp_size, + dos_cylsecs); if (prev_cyl_boundary > partp->dp_start) partp->dp_size = prev_cyl_boundary - partp->dp_start; } else @@ -1235,7 +1233,7 @@ process_partition(CMD *command) * Adjust start upwards, if necessary, to fall on a head boundary. */ if (partp->dp_start % dos_sectors != 0) { - prev_head_boundary = partp->dp_start / dos_sectors * dos_sectors; + prev_head_boundary = rounddown(partp->dp_start, dos_sectors); if (max_end < dos_sectors || prev_head_boundary > max_end - dos_sectors) { /* @@ -1259,8 +1257,8 @@ process_partition(CMD *command) * Adjust size downwards, if necessary, to fall on a cylinder * boundary. */ - prev_cyl_boundary = - ((partp->dp_start + partp->dp_size) / dos_cylsecs) * dos_cylsecs; + prev_cyl_boundary = rounddown(partp->dp_start + partp->dp_size, + dos_cylsecs); if (prev_cyl_boundary > partp->dp_start) adj_size = prev_cyl_boundary - partp->dp_start; else { @@ -1451,7 +1449,7 @@ sanitize_partition(struct dos_partition * Adjust start upwards, if necessary, to fall on a head boundary. */ if (start % dos_sectors != 0) { - prev_head_boundary = start / dos_sectors * dos_sectors; + prev_head_boundary = rounddown(start, dos_sectors); if (max_end < dos_sectors || prev_head_boundary >= max_end - dos_sectors) { /* @@ -1468,7 +1466,7 @@ sanitize_partition(struct dos_partition * Adjust size downwards, if necessary, to fall on a cylinder * boundary. */ - prev_cyl_boundary = ((start + size) / dos_cylsecs) * dos_cylsecs; + prev_cyl_boundary = rounddown(start + size, dos_cylsecs); if (prev_cyl_boundary > start) size = prev_cyl_boundary - start; else { Modified: head/sbin/fdisk_pc98/fdisk.c ============================================================================== --- head/sbin/fdisk_pc98/fdisk.c Sat Apr 30 19:50:59 2016 (r298860) +++ head/sbin/fdisk_pc98/fdisk.c Sat Apr 30 19:58:54 2016 (r298861) @@ -63,8 +63,6 @@ static char lbuf[LBUF]; #define Decimal(str, ans, tmp) if (decimal(str, &tmp, ans)) ans = tmp #define String(str, ans, len) {char *z = ans; char **dflt = &z; if (string(str, dflt)) strncpy(ans, *dflt, len); } -#define RoundCyl(x) ((((x) + cylsecs - 1) / cylsecs) * cylsecs) - #define MAX_SEC_SIZE 2048 /* maximum section size that is supported */ #define MIN_SEC_SIZE 512 /* the sector size to start sensing at */ static int secsize = 0; /* the sensed sector size */ From owner-svn-src-head@freebsd.org Sat Apr 30 20:05:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C946FB22617; Sat, 30 Apr 2016 20:05:24 +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 8B66912B9; Sat, 30 Apr 2016 20:05:24 +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 u3UK5NhT047891; Sat, 30 Apr 2016 20:05:23 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UK5NvY047890; Sat, 30 Apr 2016 20:05:23 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604302005.u3UK5NvY047890@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 20:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298862 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 20:05:24 -0000 Author: pfg Date: Sat Apr 30 20:05:23 2016 New Revision: 298862 URL: https://svnweb.freebsd.org/changeset/base/298862 Log: restore: use our howmany() instead of reinventing the macro. Modified: head/sbin/restore/interactive.c Modified: head/sbin/restore/interactive.c ============================================================================== --- head/sbin/restore/interactive.c Sat Apr 30 19:58:54 2016 (r298861) +++ head/sbin/restore/interactive.c Sat Apr 30 20:05:23 2016 (r298862) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include "restore.h" #include "extern.h" -#define round(a, b) (((a) + (b) - 1) / (b) * (b)) - /* * Things to handle interruptions. */ @@ -671,7 +669,7 @@ formatf(struct afile *list, int nentry) columns = 81 / width; if (columns == 0) columns = 1; - lines = (nentry + columns - 1) / columns; + lines = howmany(nentry, columns); for (i = 0; i < lines; i++) { for (j = 0; j < columns; j++) { fp = &list[j * lines + i]; From owner-svn-src-head@freebsd.org Sat Apr 30 21:27:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C19DFB222F3; Sat, 30 Apr 2016 21:27:42 +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 6735B1089; Sat, 30 Apr 2016 21:27:42 +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 u3ULRfV9072138; Sat, 30 Apr 2016 21:27:41 GMT (envelope-from jamie@FreeBSD.org) Received: (from jamie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3ULRf7W072136; Sat, 30 Apr 2016 21:27:41 GMT (envelope-from jamie@FreeBSD.org) Message-Id: <201604302127.u3ULRf7W072136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jamie set sender to jamie@FreeBSD.org using -f From: Jamie Gritton Date: Sat, 30 Apr 2016 21:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298863 - in head: share/man/man5 usr.sbin/jail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 21:27:42 -0000 Author: jamie Date: Sat Apr 30 21:27:41 2016 New Revision: 298863 URL: https://svnweb.freebsd.org/changeset/base/298863 Log: Clarify when happens when there is a "depend" parameter in jail.conf, and how this affects the "jail_list" option in rc.conf. Modified: head/share/man/man5/rc.conf.5 head/usr.sbin/jail/jail.8 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Sat Apr 30 20:05:23 2016 (r298862) +++ head/share/man/man5/rc.conf.5 Sat Apr 30 21:27:41 2016 (r298863) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 29, 2016 +.Dd April 30, 2016 .Dt RC.CONF 5 .Os .Sh NAME @@ -3868,6 +3868,9 @@ The names specified in this list control instances missing from .Va jail_list must be started manually. +Note that a jail's +.Va depend +parameter in the configuration file may override this list. .It Va jail_reverse_stop .Pq Vt bool When set to Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Sat Apr 30 20:05:23 2016 (r298862) +++ head/usr.sbin/jail/jail.8 Sat Apr 30 21:27:41 2016 (r298863) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2016 +.Dd April 30, 2016 .Dt JAIL 8 .Os .Sh NAME @@ -838,13 +838,14 @@ Allow making changes to a jail. .It Va depend Specify a jail (or jails) that this jail depends on. -Any such jails must be fully created, up to the last +When this jail is to be created, any jail(s) it depends on must already exist. +If not, they will be created automatically, up to the completion of the last .Va exec.poststart command, before any action will taken to create this jail. When jails are removed the opposite is true: -this jail must be fully removed, up to the last +this jail will be removed, up to the last .Va exec.poststop -command, before the jail(s) it depends on are stopped. +command, before any jail(s) it depends on are stopped. .El .Sh EXAMPLES Jails are typically set up using one of two philosophies: either to From owner-svn-src-head@freebsd.org Sat Apr 30 21:32:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A40A9B2246B; Sat, 30 Apr 2016 21:32:30 +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 74BA01659; Sat, 30 Apr 2016 21:32: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 u3ULWT6v074926; Sat, 30 Apr 2016 21:32:29 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3ULWTvR074925; Sat, 30 Apr 2016 21:32:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201604302132.u3ULWTvR074925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 30 Apr 2016 21:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298864 - 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 21:32:30 -0000 Author: ngie Date: Sat Apr 30 21:32:29 2016 New Revision: 298864 URL: https://svnweb.freebsd.org/changeset/base/298864 Log: Allow FILESGROUPS to be specified more than once by pruning out duplicates MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.files.mk Modified: head/share/mk/bsd.files.mk ============================================================================== --- head/share/mk/bsd.files.mk Sat Apr 30 21:27:41 2016 (r298863) +++ head/share/mk/bsd.files.mk Sat Apr 30 21:32:29 2016 (r298864) @@ -9,7 +9,7 @@ ____: FILESGROUPS?= FILES -_FILESGROUPS= ${FILESGROUPS:C,[/*],_,g} +_FILESGROUPS= ${FILESGROUPS:C,[/*],_,g:u} .for group in ${_FILESGROUPS} # Add in foo.yes and remove duplicates from all the groups From owner-svn-src-head@freebsd.org Sat Apr 30 21:57:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53B6CB22A9D; Sat, 30 Apr 2016 21:57:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-ig0-x235.google.com (mail-ig0-x235.google.com [IPv6:2607:f8b0:4001:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 179E217AE; Sat, 30 Apr 2016 21:57:18 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-ig0-x235.google.com with SMTP id s8so47699964ign.0; Sat, 30 Apr 2016 14:57:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JPW8y/T59ooAvuuGWUe3quFdmMLksgNqjTGsel8S+3U=; b=jEC8355yVrCA/p0snLD2ovHN2OMa019w/dwMRLgGk+EEyq3iVcWs1mptT9iaTxXmqf cz+Fp/5Af4KQqiQSW4krJqsea3LNEyN5QT+nMRM9JBdjJdyIfTtfbR3/RAERk6AUUiG7 lMmlnylJyzkzaPbhhLKFTWHfnnJmk5qrkj+IbiNEWGeGiF9tGOXKRhduM4d23Y/okl3J nq6r08AMZfZK1hXTE342I7b4i/Qvx++H+YNdCaCpye10Md/BBPnoi2JTDcHqtuM+WXef VhOJAGQNCd2R42mlvnKSoNKOFyu2f309f/arXZn6XS9SJ5ny3iSycwfzu/+pzIvorKa+ ax+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=JPW8y/T59ooAvuuGWUe3quFdmMLksgNqjTGsel8S+3U=; b=Gr9lCZ0w4gYr95UEPtGZtRmiIRJyopBb6r3rPZRdIXdq5NVWtGRirMTu9MaaLHZihC fZHuShn6lI97yo+I1HzsrWV6IogHYIDw2AiplR+ip7TJufhttIh2hThx8lT/+rt+1Cab ijUsQqCjth4Vur8cDQ7o1FUJuBZEOhAzwk2g/KX5DfIWwYMwycsoPSzQ0WPjlP6HdJrY DQa5UUCbZWeOA2fA9Fh0Aw/2iqUs20VR58KVonp2ES1OTRaSdmY/R0851tCDX84eoYzU TaDtlhtABLFAQdJmYnEaWdEEDKA0q0RBvIMhdMnzy7jIAUch8HmMLCIBsV4eVo9397um bXiQ== X-Gm-Message-State: AOPr4FUbSgOYiRKAES3UbTIvi0G4Itdqx1iZGymNwBfm5BZ3FkHMyQdBv1uLjaYDfCiZ5A== X-Received: by 10.50.96.132 with SMTP id ds4mr12605001igb.31.1462053437439; Sat, 30 Apr 2016 14:57:17 -0700 (PDT) Received: from ?IPv6:2601:601:d00:8fa9:981f:224c:7bfb:14ee? ([2601:601:d00:8fa9:981f:224c:7bfb:14ee]) by smtp.gmail.com with ESMTPSA id jk7sm5808223igb.3.2016.04.30.14.57.14 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 30 Apr 2016 14:57:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r298768 - in head: bin/tests cddl/lib/tests cddl/sbin/tests cddl/tests cddl/usr.bin/tests cddl/usr.sbin/tests gnu/lib/tests gnu/tests gnu/usr.bin/tests lib/atf/libatf-c/tests/detail lib... From: "Ngie Cooper (yaneurabeya)" In-Reply-To: <201604290528.u3T5SfoH034290@repo.freebsd.org> Date: Sat, 30 Apr 2016 14:57:11 -0700 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <832A29DB-0D14-4F09-A81F-627BB81324B0@gmail.com> References: <201604290528.u3T5SfoH034290@repo.freebsd.org> To: Glen Barber X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 21:57:18 -0000 > On Apr 28, 2016, at 22:28, Glen Barber wrote: >=20 > Author: gjb > Date: Fri Apr 29 05:28:40 2016 > New Revision: 298768 > URL: https://svnweb.freebsd.org/changeset/base/298768 >=20 > Log: > Fix including Kyuafile in packaged base system. >=20 > Fix a related typo while here. >=20 > Note, this change results in the Kyuafile inclusion in the runtime > package, which needs to be fixed, however addresses the PR as far > as I can tell in my tests. >=20 > PR: 209114 > Submitted by: ngie > Sponsored by: The FreeBSD Foundation Unfortunately it=E2=80=99s still broken in subdirectories. I=E2=80=99m = fixing the issue right now.= From owner-svn-src-head@freebsd.org Sat Apr 30 22:51:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54F5AB2250D; Sat, 30 Apr 2016 22:51:10 +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 21D751FD8; Sat, 30 Apr 2016 22:51: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 u3UMp9wV097016; Sat, 30 Apr 2016 22:51:09 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3UMp9ip097015; Sat, 30 Apr 2016 22:51:09 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604302251.u3UMp9ip097015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 30 Apr 2016 22:51:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298868 - head/sbin/restore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2016 22:51:10 -0000 Author: pfg Date: Sat Apr 30 22:51:09 2016 New Revision: 298868 URL: https://svnweb.freebsd.org/changeset/base/298868 Log: restore: fix memory leak. CID: 272297 MFC after: 5 days Modified: head/sbin/restore/main.c Modified: head/sbin/restore/main.c ============================================================================== --- head/sbin/restore/main.c Sat Apr 30 22:20:32 2016 (r298867) +++ head/sbin/restore/main.c Sat Apr 30 22:51:09 2016 (r298868) @@ -366,7 +366,8 @@ obsolete(int *argcp, char **argvp[]) if (flags) { *p = '\0'; *nargv++ = flagsp; - } + } else + free(flagsp); /* Copy remaining arguments. */ while ((*nargv++ = *argv++));