From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 01:11:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80D4A106566B; Sun, 22 Jan 2012 01:11:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60EE38FC08; Sun, 22 Jan 2012 01:11:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0M1B7vx017335; Sun, 22 Jan 2012 01:11:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0M1B7rt017333; Sun, 22 Jan 2012 01:11:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201220111.q0M1B7rt017333@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jan 2012 01:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230441 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 01:11:07 -0000 Author: kib Date: Sun Jan 22 01:11:06 2012 New Revision: 230441 URL: http://svn.freebsd.org/changeset/base/230441 Log: Remove the nc_time and nc_ticks elements from struct namecache, and provide struct namecache_ts which is the old struct namecache. Only allocate struct namecache_ts if non-null struct timespec *tsp was passed to cache_enter_time, otherwise use struct namecache. Change struct namecache allocation and deallocation macros into static functions, since logic becomes somewhat twisty. Provide accessor for the nc_name member of struct namecache to hide difference between struct namecache and namecache_ts. The aim of the change is to not waste 20 bytes per small namecache entry. Reviewed by: jhb MFC after: 2 weeks X-MFC-note: after r230394 Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Sat Jan 21 22:18:33 2012 (r230440) +++ head/sys/kern/vfs_cache.c Sun Jan 22 01:11:06 2012 (r230441) @@ -97,14 +97,36 @@ struct namecache { TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ struct vnode *nc_dvp; /* vnode of parent of name */ struct vnode *nc_vp; /* vnode the name refers to */ - struct timespec nc_time; /* timespec provided by fs */ - int nc_ticks; /* ticks value when entry was added */ u_char nc_flag; /* flag bits */ u_char nc_nlen; /* length of name */ char nc_name[0]; /* segment name + nul */ }; /* + * struct namecache_ts repeats struct namecache layout up to the + * nc_nlen member. + */ +struct namecache_ts { + LIST_ENTRY(namecache) nc_hash; /* hash chain */ + LIST_ENTRY(namecache) nc_src; /* source vnode list */ + TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ + struct vnode *nc_dvp; /* vnode of parent of name */ + struct vnode *nc_vp; /* vnode the name refers to */ + u_char nc_flag; /* flag bits */ + u_char nc_nlen; /* length of name */ + struct timespec nc_time; /* timespec provided by fs */ + int nc_ticks; /* ticks value when entry was added */ + char nc_name[0]; /* segment name + nul */ +}; + +/* + * Flags in namecache.nc_flag + */ +#define NCF_WHITE 0x01 +#define NCF_ISDOTDOT 0x02 +#define NCF_TS 0x04 + +/* * Name caching works as follows: * * Names found by directory scans are retained in a cache @@ -166,20 +188,50 @@ RW_SYSINIT(vfscache, &cache_lock, "Name * fit in the small cache. */ static uma_zone_t cache_zone_small; +static uma_zone_t cache_zone_small_ts; static uma_zone_t cache_zone_large; #define CACHE_PATH_CUTOFF 35 -#define CACHE_ZONE_SMALL (sizeof(struct namecache) + CACHE_PATH_CUTOFF \ - + 1) -#define CACHE_ZONE_LARGE (sizeof(struct namecache) + NAME_MAX + 1) - -#define cache_alloc(len) uma_zalloc(((len) <= CACHE_PATH_CUTOFF) ? \ - cache_zone_small : cache_zone_large, M_WAITOK) -#define cache_free(ncp) do { \ - if (ncp != NULL) \ - uma_zfree(((ncp)->nc_nlen <= CACHE_PATH_CUTOFF) ? \ - cache_zone_small : cache_zone_large, (ncp)); \ -} while (0) + +static struct namecache * +cache_alloc(int len, int ts) +{ + + if (len > CACHE_PATH_CUTOFF) + return (uma_zalloc(cache_zone_large, M_WAITOK)); + if (ts) + return (uma_zalloc(cache_zone_small_ts, M_WAITOK)); + else + return (uma_zalloc(cache_zone_small, M_WAITOK)); +} + +static void +cache_free(struct namecache *ncp) +{ + int ts; + + if (ncp == NULL) + return; + ts = ncp->nc_flag & NCF_TS; + if (ncp->nc_nlen <= CACHE_PATH_CUTOFF) { + if (ts) + uma_zfree(cache_zone_small_ts, ncp); + else + uma_zfree(cache_zone_small, ncp); + } else + uma_zfree(cache_zone_large, ncp); +} + +static char * +nc_get_name(struct namecache *ncp) +{ + struct namecache_ts *ncp_ts; + + if ((ncp->nc_flag & NCF_TS) == 0) + return (ncp->nc_name); + ncp_ts = (struct namecache_ts *)ncp; + return (ncp_ts->nc_name); +} static int doingcache = 1; /* 1 => enable the cache */ SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0, @@ -235,12 +287,6 @@ static int vn_fullpath1(struct thread *t static MALLOC_DEFINE(M_VFSCACHE, "vfscache", "VFS name cache entries"); -/* - * Flags in namecache.nc_flag - */ -#define NCF_WHITE 0x01 -#define NCF_ISDOTDOT 0x02 - #ifdef DIAGNOSTIC /* * Grab an atomic snapshot of the name cache hash chain lengths @@ -346,10 +392,10 @@ cache_zap(ncp) #ifdef KDTRACE_HOOKS if (ncp->nc_vp != NULL) { SDT_PROBE(vfs, namecache, zap, done, ncp->nc_dvp, - ncp->nc_name, ncp->nc_vp, 0, 0); + nc_get_name(ncp), ncp->nc_vp, 0, 0); } else { SDT_PROBE(vfs, namecache, zap_negative, done, ncp->nc_dvp, - ncp->nc_name, 0, 0, 0); + nc_get_name(ncp), 0, 0, 0); } #endif vp = NULL; @@ -460,10 +506,17 @@ retry_wlocked: dvp, cnp->cn_nameptr, *vpp); SDT_PROBE(vfs, namecache, lookup, hit, dvp, "..", *vpp, 0, 0); - if (tsp != NULL) - *tsp = ncp->nc_time; - if (ticksp != NULL) - *ticksp = ncp->nc_ticks; + if (tsp != NULL) { + KASSERT((ncp->nc_flag & NCF_TS) != 0, + ("No NCF_TS")); + *tsp = ((struct namecache_ts *)ncp)->nc_time; + } + if (ticksp != NULL) { + KASSERT((ncp->nc_flag & NCF_TS) != 0, + ("No NCF_TS")); + *ticksp = ((struct namecache_ts *)ncp)-> + nc_ticks; + } goto success; } } @@ -473,7 +526,7 @@ retry_wlocked: LIST_FOREACH(ncp, (NCHHASH(hash)), nc_hash) { numchecks++; if (ncp->nc_dvp == dvp && ncp->nc_nlen == cnp->cn_namelen && - !bcmp(ncp->nc_name, cnp->cn_nameptr, ncp->nc_nlen)) + !bcmp(nc_get_name(ncp), cnp->cn_nameptr, ncp->nc_nlen)) break; } @@ -508,12 +561,16 @@ retry_wlocked: *vpp = ncp->nc_vp; CTR4(KTR_VFS, "cache_lookup(%p, %s) found %p via ncp %p", dvp, cnp->cn_nameptr, *vpp, ncp); - SDT_PROBE(vfs, namecache, lookup, hit, dvp, ncp->nc_name, + SDT_PROBE(vfs, namecache, lookup, hit, dvp, nc_get_name(ncp), *vpp, 0, 0); - if (tsp != NULL) - *tsp = ncp->nc_time; - if (ticksp != NULL) - *ticksp = ncp->nc_ticks; + if (tsp != NULL) { + KASSERT((ncp->nc_flag & NCF_TS) != 0, ("No NCF_TS")); + *tsp = ((struct namecache_ts *)ncp)->nc_time; + } + if (ticksp != NULL) { + KASSERT((ncp->nc_flag & NCF_TS) != 0, ("No NCF_TS")); + *ticksp = ((struct namecache_ts *)ncp)->nc_ticks; + } goto success; } @@ -543,12 +600,16 @@ negative_success: nchstats.ncs_neghits++; if (ncp->nc_flag & NCF_WHITE) cnp->cn_flags |= ISWHITEOUT; - SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, ncp->nc_name, + SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, nc_get_name(ncp), 0, 0, 0); - if (tsp != NULL) - *tsp = ncp->nc_time; - if (ticksp != NULL) - *ticksp = ncp->nc_ticks; + if (tsp != NULL) { + KASSERT((ncp->nc_flag & NCF_TS) != 0, ("No NCF_TS")); + *tsp = ((struct namecache_ts *)ncp)->nc_time; + } + if (ticksp != NULL) { + KASSERT((ncp->nc_flag & NCF_TS) != 0, ("No NCF_TS")); + *ticksp = ((struct namecache_ts *)ncp)->nc_ticks; + } CACHE_WUNLOCK(); return (ENOENT); @@ -642,6 +703,7 @@ cache_enter_time(dvp, vp, cnp, tsp) struct timespec *tsp; { struct namecache *ncp, *n2; + struct namecache_ts *n3; struct nchashhead *ncpp; uint32_t hash; int flag; @@ -708,18 +770,19 @@ cache_enter_time(dvp, vp, cnp, tsp) * Calculate the hash key and setup as much of the new * namecache entry as possible before acquiring the lock. */ - ncp = cache_alloc(cnp->cn_namelen); + ncp = cache_alloc(cnp->cn_namelen, tsp != NULL); ncp->nc_vp = vp; ncp->nc_dvp = dvp; ncp->nc_flag = flag; - if (tsp != NULL) - ncp->nc_time = *tsp; - else - timespecclear(&ncp->nc_time); - ncp->nc_ticks = ticks; + if (tsp != NULL) { + n3 = (struct namecache_ts *)ncp; + n3->nc_time = *tsp; + n3->nc_ticks = ticks; + n3->nc_flag |= NCF_TS; + } len = ncp->nc_nlen = cnp->cn_namelen; hash = fnv_32_buf(cnp->cn_nameptr, len, FNV1_32_INIT); - strlcpy(ncp->nc_name, cnp->cn_nameptr, len + 1); + strlcpy(nc_get_name(ncp), cnp->cn_nameptr, len + 1); hash = fnv_32_buf(&dvp, sizeof(dvp), hash); CACHE_WLOCK(); @@ -732,9 +795,16 @@ cache_enter_time(dvp, vp, cnp, tsp) LIST_FOREACH(n2, ncpp, nc_hash) { if (n2->nc_dvp == dvp && n2->nc_nlen == cnp->cn_namelen && - !bcmp(n2->nc_name, cnp->cn_nameptr, n2->nc_nlen)) { - n2->nc_time = ncp->nc_time; - n2->nc_ticks = ncp->nc_ticks; + !bcmp(nc_get_name(n2), cnp->cn_nameptr, n2->nc_nlen)) { + if (tsp != NULL) { + KASSERT((n2->nc_flag & NCF_TS) != 0, + ("no NCF_TS")); + n3 = (struct namecache_ts *)n2; + n3->nc_time = + ((struct namecache_ts *)ncp)->nc_time; + n3->nc_ticks = + ((struct namecache_ts *)ncp)->nc_ticks; + } CACHE_WUNLOCK(); cache_free(ncp); return; @@ -792,12 +862,12 @@ cache_enter_time(dvp, vp, cnp, tsp) */ if (vp) { TAILQ_INSERT_HEAD(&vp->v_cache_dst, ncp, nc_dst); - SDT_PROBE(vfs, namecache, enter, done, dvp, ncp->nc_name, vp, - 0, 0); + SDT_PROBE(vfs, namecache, enter, done, dvp, nc_get_name(ncp), + vp, 0, 0); } else { TAILQ_INSERT_TAIL(&ncneg, ncp, nc_dst); SDT_PROBE(vfs, namecache, enter_negative, done, dvp, - ncp->nc_name, 0, 0, 0); + nc_get_name(ncp), 0, 0, 0); } if (numneg * ncnegfactor > numcache) { ncp = TAILQ_FIRST(&ncneg); @@ -819,10 +889,15 @@ nchinit(void *dummy __unused) TAILQ_INIT(&ncneg); - cache_zone_small = uma_zcreate("S VFS Cache", CACHE_ZONE_SMALL, NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); - cache_zone_large = uma_zcreate("L VFS Cache", CACHE_ZONE_LARGE, NULL, - NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_small = uma_zcreate("S VFS Cache", + sizeof(struct namecache) + CACHE_PATH_CUTOFF + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_small_ts = uma_zcreate("STS VFS Cache", + sizeof(struct namecache_ts) + CACHE_PATH_CUTOFF + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); + cache_zone_large = uma_zcreate("L VFS Cache", + sizeof(struct namecache_ts) + NAME_MAX + 1, + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_ZINIT); nchashtbl = hashinit(desiredvnodes * 2, M_VFSCACHE, &nchash); } @@ -1126,9 +1201,9 @@ vn_vptocnp_locked(struct vnode **vp, str return (error); } *buflen -= ncp->nc_nlen; - memcpy(buf + *buflen, ncp->nc_name, ncp->nc_nlen); + memcpy(buf + *buflen, nc_get_name(ncp), ncp->nc_nlen); SDT_PROBE(vfs, namecache, fullpath, hit, ncp->nc_dvp, - ncp->nc_name, vp, 0, 0); + nc_get_name(ncp), vp, 0, 0); dvp = *vp; *vp = ncp->nc_dvp; vref(*vp); @@ -1301,7 +1376,7 @@ vn_commname(struct vnode *vp, char *buf, return (ENOENT); } l = min(ncp->nc_nlen, buflen - 1); - memcpy(buf, ncp->nc_name, l); + memcpy(buf, nc_get_name(ncp), l); CACHE_RUNLOCK(); buf[l] = '\0'; return (0); From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 02:13:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 569B5106564A; Sun, 22 Jan 2012 02:13:20 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39D4E8FC1F; Sun, 22 Jan 2012 02:13:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0M2DKCV019212; Sun, 22 Jan 2012 02:13:20 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0M2DJgA019206; Sun, 22 Jan 2012 02:13:19 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201220213.q0M2DJgA019206@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 22 Jan 2012 02:13:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230442 - in head/sys: netinet netinet6 netipsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 02:13:20 -0000 Author: bz Date: Sun Jan 22 02:13:19 2012 New Revision: 230442 URL: http://svn.freebsd.org/changeset/base/230442 Log: Clean up some #endif comments removing from short sections. Add #endif comments to longer, also refining strange ones. Properly use #ifdef rather than #if defined() where possible. Four #if defined(PCBGROUP) occurances (netinet and netinet6) were ignored to avoid conflicts with eventually upcoming changes for RSS. Reported by: bde (most) Reviewed by: bde MFC after: 3 days Modified: head/sys/netinet/if_ether.c head/sys/netinet/in_pcb.c head/sys/netinet/ip_ipsec.c head/sys/netinet6/ip6_ipsec.c head/sys/netipsec/xform_ipip.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Sun Jan 22 01:11:06 2012 (r230441) +++ head/sys/netinet/if_ether.c Sun Jan 22 02:13:19 2012 (r230442) @@ -64,7 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#if defined(INET) +#ifdef INET #include #endif Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Sun Jan 22 01:11:06 2012 (r230441) +++ head/sys/netinet/in_pcb.c Sun Jan 22 02:13:19 2012 (r230442) @@ -196,7 +196,7 @@ SYSCTL_VNET_INT(_net_inet_ip_portrange, &VNET_NAME(ipport_randomtime), 0, "Minimum time to keep sequental port " "allocation before switching to a random one"); -#endif +#endif /* INET */ /* * in_pcb.c: manage the Protocol Control Blocks. @@ -1038,7 +1038,7 @@ in_pcbdisconnect(struct inpcb *inp) inp->inp_fport = 0; in_pcbrehash(inp); } -#endif +#endif /* INET */ /* * in_pcbdetach() is responsibe for disassociating a socket from an inpcb. @@ -1169,7 +1169,7 @@ in_pcbfree(struct inpcb *inp) #ifdef IPSEC if (inp->inp_sp != NULL) ipsec_delete_pcbpolicy(inp); -#endif /* IPSEC */ +#endif inp->inp_gencnt = ++pcbinfo->ipi_gencnt; in_pcbremlists(inp); #ifdef INET6 @@ -1586,7 +1586,7 @@ in_pcblookup_group(struct inpcbinfo *pcb if (inp->inp_vflag & INP_IPV6PROTO) local_wild_mapped = inp; else -#endif /* INET6 */ +#endif if (injail) jail_wild = inp; else @@ -1601,7 +1601,7 @@ in_pcblookup_group(struct inpcbinfo *pcb #ifdef INET6 if (inp == NULL) inp = local_wild_mapped; -#endif /* defined(INET6) */ +#endif if (inp != NULL) goto found; } /* if (lookupflags & INPLOOKUP_WILDCARD) */ @@ -1731,7 +1731,7 @@ in_pcblookup_hash_locked(struct inpcbinf if (inp->inp_vflag & INP_IPV6PROTO) local_wild_mapped = inp; else -#endif /* INET6 */ +#endif if (injail) jail_wild = inp; else @@ -1747,7 +1747,7 @@ in_pcblookup_hash_locked(struct inpcbinf #ifdef INET6 if (local_wild_mapped != NULL) return (local_wild_mapped); -#endif /* defined(INET6) */ +#endif } /* if ((lookupflags & INPLOOKUP_WILDCARD) != 0) */ return (NULL); @@ -1871,7 +1871,7 @@ in_pcbinshash_internal(struct inpcb *inp if (inp->inp_vflag & INP_IPV6) hashkey_faddr = inp->in6p_faddr.s6_addr32[3] /* XXX */; else -#endif /* INET6 */ +#endif hashkey_faddr = inp->inp_faddr.s_addr; pcbhash = &pcbinfo->ipi_hashbase[INP_PCBHASH(hashkey_faddr, @@ -1958,7 +1958,7 @@ in_pcbrehash_mbuf(struct inpcb *inp, str if (inp->inp_vflag & INP_IPV6) hashkey_faddr = inp->in6p_faddr.s6_addr32[3] /* XXX */; else -#endif /* INET6 */ +#endif hashkey_faddr = inp->inp_faddr.s_addr; head = &pcbinfo->ipi_hashbase[INP_PCBHASH(hashkey_faddr, @@ -2226,14 +2226,13 @@ db_print_inconninfo(struct in_conninfo * /* IPv6. */ ip6_sprintf(laddr_str, &inc->inc6_laddr); ip6_sprintf(faddr_str, &inc->inc6_faddr); - } else { + } else #endif + { /* IPv4. */ inet_ntoa_r(inc->inc_laddr, laddr_str); inet_ntoa_r(inc->inc_faddr, faddr_str); -#ifdef INET6 } -#endif db_print_indent(indent); db_printf("inc_laddr %s inc_lport %u\n", laddr_str, ntohs(inc->inc_lport)); @@ -2446,4 +2445,4 @@ DB_SHOW_COMMAND(inpcb, db_show_inpcb) db_print_inpcb(inp, "inpcb", 0); } -#endif +#endif /* DDB */ Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Sun Jan 22 01:11:06 2012 (r230441) +++ head/sys/netinet/ip_ipsec.c Sun Jan 22 02:13:19 2012 (r230442) @@ -92,7 +92,7 @@ SYSCTL_VNET_INT(_net_inet_ipsec, OID_AUT int ip_ipsec_filtertunnel(struct mbuf *m) { -#if defined(IPSEC) +#ifdef IPSEC /* * Bypass packet filtering for packets previously handled by IPsec. Modified: head/sys/netinet6/ip6_ipsec.c ============================================================================== --- head/sys/netinet6/ip6_ipsec.c Sun Jan 22 01:11:06 2012 (r230441) +++ head/sys/netinet6/ip6_ipsec.c Sun Jan 22 02:13:19 2012 (r230442) @@ -103,7 +103,7 @@ SYSCTL_VNET_INT(_net_inet6_ipsec6, OID_A int ip6_ipsec_filtertunnel(struct mbuf *m) { -#if defined(IPSEC) +#ifdef IPSEC /* * Bypass packet filtering for packets previously handled by IPsec. Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Sun Jan 22 01:11:06 2012 (r230441) +++ head/sys/netipsec/xform_ipip.c Sun Jan 22 02:13:19 2012 (r230442) @@ -687,7 +687,7 @@ static struct ip6protosw ipe6_protosw = }; #endif /* INET6 && INET */ -#if defined(INET) +#ifdef INET /* * Check the encapsulated packet to see if we want it */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 02:16:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DEAC106566C; Sun, 22 Jan 2012 02:16:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 084B68FC12; Sun, 22 Jan 2012 02:16:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0M2GVL7019412; Sun, 22 Jan 2012 02:16:31 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0M2GVwT019408; Sun, 22 Jan 2012 02:16:31 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201220216.q0M2GVwT019408@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 22 Jan 2012 02:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230443 - in head/sys: modules modules/ipdivert netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 02:16:32 -0000 Author: bz Date: Sun Jan 22 02:16:31 2012 New Revision: 230443 URL: http://svn.freebsd.org/changeset/base/230443 Log: Fix ip_divert handling of inet and inet6 and module building some more. Properly sort the "carp" case in modules/Makefile after it was renamed. Reported by: bde (most) Reviewed by: bde MFC after: 3 days Modified: head/sys/modules/Makefile head/sys/modules/ipdivert/Makefile head/sys/netinet/ip_divert.c Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Jan 22 02:13:19 2012 (r230442) +++ head/sys/modules/Makefile Sun Jan 22 02:16:31 2012 (r230443) @@ -136,7 +136,7 @@ SUBDIR= ${_3dfx} \ ${_igb} \ ${_iir} \ ${_io} \ - ipdivert \ + ${_ipdivert} \ ${_ipfilter} \ ${_ipfw} \ ipfw_nat \ @@ -370,20 +370,21 @@ _random= random .endif .endif -.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES) -_if_gre= if_gre -.endif - .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) _carp= carp .endif +.if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES) +_if_gre= if_gre +.endif + .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES) _ipfilter= ipfilter .endif .if ${MK_INET_SUPPORT} != "no" || defined(ALL_MODULES) +_ipdivert= ipdivert _ipfw= ipfw .endif Modified: head/sys/modules/ipdivert/Makefile ============================================================================== --- head/sys/modules/ipdivert/Makefile Sun Jan 22 02:13:19 2012 (r230442) +++ head/sys/modules/ipdivert/Makefile Sun Jan 22 02:16:31 2012 (r230443) @@ -1,13 +1,21 @@ # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../netinet KMOD= ipdivert -SRCS= ip_divert.c opt_inet6.h +SRCS= ip_divert.c opt_inet.h opt_inet6.h .if !defined(KERNBUILDDIR) +.if ${MK_INET_SUPPORT} != "no" +opt_inet.h: + echo "#define INET 1" > ${.TARGET} +.endif +.if ${MK_INET6_SUPPORT} != "no" opt_inet6.h: echo "#define INET6 1" > ${.TARGET} .endif +.endif .include Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Sun Jan 22 02:13:19 2012 (r230442) +++ head/sys/netinet/ip_divert.c Sun Jan 22 02:16:31 2012 (r230443) @@ -30,14 +30,12 @@ #include __FBSDID("$FreeBSD$"); -#if !defined(KLD_MODULE) #include "opt_inet.h" +#include "opt_inet6.h" #include "opt_sctp.h" #ifndef INET #error "IPDIVERT requires INET." #endif -#endif -#include "opt_inet6.h" #include #include From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 03:41:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27C06106566B; Sun, 22 Jan 2012 03:41:04 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4B9088FC13; Sun, 22 Jan 2012 03:41:03 +0000 (UTC) Received: by vcbfl17 with SMTP id fl17so1891268vcb.13 for ; Sat, 21 Jan 2012 19:41:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Cxk9tVnkhjl/ZNDvNFri+8tvpxlqdo+xTMFLGMXLRm4=; b=FdaMV8jdX4MtF+rYm5m/UPteVhjQHTU0z7nSPBehZfEJPy8FThAAxUXEbCgppd/k04 tJsqFIJhypERKHhYVH0P6xP3JY27EzzHggVShyopMZIh9dYdLdmZm55k2VwQFNzZ4cx7 oAyKhuIdDMuwpJdvu55XL+DICah2G6lWzY6Pc= MIME-Version: 1.0 Received: by 10.220.154.2 with SMTP id m2mr1917327vcw.27.1327203662773; Sat, 21 Jan 2012 19:41:02 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.36.5 with HTTP; Sat, 21 Jan 2012 19:41:02 -0800 (PST) In-Reply-To: <20120121200533.GD1723@garage.freebsd.pl> References: <201201080055.q080tMlJ063808@svn.freebsd.org> <20120108104330.GC1674@garage.freebsd.pl> <20120121200533.GD1723@garage.freebsd.pl> Date: Sat, 21 Jan 2012 19:41:02 -0800 X-Google-Sender-Auth: zRVj6U7Qd4SOYeZRhkRDV5Wjnu8 Message-ID: From: Adrian Chadd To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229800 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 03:41:04 -0000 Hi, I'm sorry I got distracted by other things. I'll see about creating a kld with all of this code in it and set the depedencies appropriately. adrian From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 03:43:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 694A6106566C; Sun, 22 Jan 2012 03:43:39 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id DF4948FC15; Sun, 22 Jan 2012 03:43:38 +0000 (UTC) Received: by vbbey12 with SMTP id ey12so1882394vbb.13 for ; Sat, 21 Jan 2012 19:43:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=X/KwV8Gyc+oK4exm3IoY0WLOKf/UAWc8Me6qkmFS4pw=; b=GBhUGNoTfJZXh5xEvn9mTvAtXeQ7OcIosuDcFJI16lGf7b0O9LuQ8drVW9PSxbZ7R3 9TeCRZ34vMOvSbJ4XlM+idE6aL6PkcSFMB7fznF7xQ0Twrbba3d/C8mp3agBbCpInlRG K3xEqe+S6F4yqI3Dp5nFu74zss2OoDPJku934= MIME-Version: 1.0 Received: by 10.52.94.33 with SMTP id cz1mr1554153vdb.132.1327203818151; Sat, 21 Jan 2012 19:43:38 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.36.5 with HTTP; Sat, 21 Jan 2012 19:43:38 -0800 (PST) In-Reply-To: References: <201201210038.q0L0cJac066145@svn.freebsd.org> Date: Sat, 21 Jan 2012 19:43:38 -0800 X-Google-Sender-Auth: jdlM9U85oK5qcQ6GWFh19fhwMzE Message-ID: From: Adrian Chadd To: Rui Paulo Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230408 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 03:43:39 -0000 On 20 January 2012 18:41, Rui Paulo wrote: > This commit doesn't help much and keeps us more toolchain dependent like > Alexander pointed out in IRC. Since ether_sprintf() wasn't causing any > trouble, please consider backing this out. > > This commit also introduces unnecessary changes which make reviewing > harder. > Hi, I'd like to eventually move away from doing it this way. The trouble is using ether_sprintf() multiple times (and even from multiple threads?) in the same debug statement results in non-useful behaviour. What I'm likely going to do is introduce an ether_ssprintf() which takes a char/len buffer to write into. That way the debug statements can just use that (with appropriate wrappers around them to only call ether_ssprintf() if the debug condition is met, otherwise unused sprintf()s will occur. I'm open to other suggestions though! Adrian From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 03:46:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D095D106566B; Sun, 22 Jan 2012 03:46:58 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 647D38FC0C; Sun, 22 Jan 2012 03:46:58 +0000 (UTC) Received: by vbbey12 with SMTP id ey12so1883263vbb.13 for ; Sat, 21 Jan 2012 19:46:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=vF8sdXTqFfAChWrhQSQgtB99PllA29xJWkjtwzrRbPQ=; b=aqSlNgJJ2ttbzdcflnSz483lBdkaWnnodRSWGc56xyzrwV5dvgwSeykKLo02xibthp 1FLb68D8E+TPKaUk0G7J9hEHnlEavRrtuqD7azgTnb2kH+ty724I1awDBNKzUtV/CdzH 0ZgKGOFD2DOBT8p4AWds9VWOoOZ/1GwlF9oU0= MIME-Version: 1.0 Received: by 10.52.24.35 with SMTP id r3mr1597433vdf.81.1327204017810; Sat, 21 Jan 2012 19:46:57 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.36.5 with HTTP; Sat, 21 Jan 2012 19:46:57 -0800 (PST) In-Reply-To: <92FCD394-73E5-42A4-BA56-5E39EA36EF75@FreeBSD.org> References: <201201210042.q0L0gTwK066301@svn.freebsd.org> <92FCD394-73E5-42A4-BA56-5E39EA36EF75@FreeBSD.org> Date: Sat, 21 Jan 2012 19:46:57 -0800 X-Google-Sender-Auth: 5xSWVT-UnbHEXXiHQzloVRsWOyo Message-ID: From: Adrian Chadd To: Rui Paulo Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230409 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 03:46:58 -0000 On 20 January 2012 18:42, Rui Paulo wrote: > I tested this exact topology when I implemented HWMP, so I don't know what > went wrong. The commit log doesn't say much about what was wrong and the > code changes are, again, mixed with style changes so I haven't had time to > fully appreciate these changes. > Right. I'm not sure about that either and I'm not yet on top of the mesh/hwmp code. I plan on getting more familiar with it now that the simulator is in the tree. I'm trusting monthadar here. Adrian From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 04:19:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9EDD41065672; Sun, 22 Jan 2012 04:19:04 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C2CD8FC14; Sun, 22 Jan 2012 04:19:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0M4J44T023416; Sun, 22 Jan 2012 04:19:04 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0M4J4pu023414; Sun, 22 Jan 2012 04:19:04 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201201220419.q0M4J4pu023414@svn.freebsd.org> From: Takahashi Yoshihiro Date: Sun, 22 Jan 2012 04:19:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230444 - stable/9/sys/boot/pc98/libpc98 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 04:19:04 -0000 Author: nyan Date: Sun Jan 22 04:19:03 2012 New Revision: 230444 URL: http://svn.freebsd.org/changeset/base/230444 Log: MFC: revision 229463 MFi386: revision 229435 Add special loader environment variables 'comconsole_port' and 'comconsole_pcidev'. Modified: stable/9/sys/boot/pc98/libpc98/comconsole.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/pc98/libpc98/comconsole.c ============================================================================== --- stable/9/sys/boot/pc98/libpc98/comconsole.c Sun Jan 22 02:16:31 2012 (r230443) +++ stable/9/sys/boot/pc98/libpc98/comconsole.c Sun Jan 22 04:19:03 2012 (r230444) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "libi386.h" #define COMC_FMT 0x3 /* 8N1 */ @@ -49,14 +50,23 @@ static int comc_init(int arg); static void comc_putchar(int c); static int comc_getchar(void); static int comc_getspeed(void); +static void set_hw_console_hint(void); static int comc_ischar(void); -static int comc_parsespeed(const char *string); -static void comc_setup(int speed); +static int comc_parseint(const char *string); +static uint32_t comc_parse_pcidev(const char *string); +static int comc_pcidev_set(struct env_var *ev, int flags, + const void *value); +static int comc_pcidev_handle(uint32_t locator); +static int comc_port_set(struct env_var *ev, int flags, + const void *value); +static void comc_setup(int speed, int port); static int comc_speed_set(struct env_var *ev, int flags, const void *value); static int comc_started; static int comc_curspeed; +static int comc_port = COMPORT; +static uint32_t comc_locator; struct console comconsole = { "comconsole", @@ -72,9 +82,10 @@ struct console comconsole = { static void comc_probe(struct console *cp) { - char speedbuf[16]; - char *cons, *speedenv; - int speed; + char intbuf[16]; + char *cons, *env; + int speed, port; + uint32_t locator; /* XXX check the BIOS equipment list? */ cp->c_flags |= (C_PRESENTIN | C_PRESENTOUT); @@ -90,16 +101,40 @@ comc_probe(struct console *cp) getenv("boot_multicons") != NULL) { comc_curspeed = comc_getspeed(); } - speedenv = getenv("comconsole_speed"); - if (speedenv != NULL) { - speed = comc_parsespeed(speedenv); + + env = getenv("comconsole_speed"); + if (env != NULL) { + speed = comc_parseint(env); if (speed > 0) comc_curspeed = speed; } - sprintf(speedbuf, "%d", comc_curspeed); + sprintf(intbuf, "%d", comc_curspeed); unsetenv("comconsole_speed"); - env_setenv("comconsole_speed", EV_VOLATILE, speedbuf, comc_speed_set, + env_setenv("comconsole_speed", EV_VOLATILE, intbuf, comc_speed_set, + env_nounset); + + env = getenv("comconsole_port"); + if (env != NULL) { + port = comc_parseint(env); + if (port > 0) + comc_port = port; + } + + sprintf(intbuf, "%d", comc_port); + unsetenv("comconsole_port"); + env_setenv("comconsole_port", EV_VOLATILE, intbuf, comc_port_set, + env_nounset); + + env = getenv("comconsole_pcidev"); + if (env != NULL) { + locator = comc_parse_pcidev(env); + if (locator != 0) + comc_pcidev_handle(locator); + } + + unsetenv("comconsole_pcidev"); + env_setenv("comconsole_pcidev", EV_VOLATILE, env, comc_pcidev_set, env_nounset); } } @@ -111,7 +146,7 @@ comc_init(int arg) return 0; comc_started = 1; - comc_setup(comc_curspeed); + comc_setup(comc_curspeed, comc_port); return(0); } @@ -122,8 +157,8 @@ comc_putchar(int c) int wait; for (wait = COMC_TXWAIT; wait > 0; wait--) - if (inb(COMPORT + com_lsr) & LSR_TXRDY) { - outb(COMPORT + com_data, (u_char)c); + if (inb(comc_port + com_lsr) & LSR_TXRDY) { + outb(comc_port + com_data, (u_char)c); break; } } @@ -131,13 +166,13 @@ comc_putchar(int c) static int comc_getchar(void) { - return(comc_ischar() ? inb(COMPORT + com_data) : -1); + return(comc_ischar() ? inb(comc_port + com_data) : -1); } static int comc_ischar(void) { - return(inb(COMPORT + com_lsr) & LSR_RXRDY); + return(inb(comc_port + com_lsr) & LSR_RXRDY); } static int @@ -145,13 +180,33 @@ comc_speed_set(struct env_var *ev, int f { int speed; - if (value == NULL || (speed = comc_parsespeed(value)) <= 0) { + if (value == NULL || (speed = comc_parseint(value)) <= 0) { printf("Invalid speed\n"); return (CMD_ERROR); } if (comc_started && comc_curspeed != speed) - comc_setup(speed); + comc_setup(speed, comc_port); + + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + + return (CMD_OK); +} + +static int +comc_port_set(struct env_var *ev, int flags, const void *value) +{ + int port; + + if (value == NULL || (port = comc_parseint(value)) <= 0) { + printf("Invalid port\n"); + return (CMD_ERROR); + } + + if (comc_started && comc_port != port) { + comc_setup(comc_curspeed, port); + set_hw_console_hint(); + } env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); @@ -159,24 +214,126 @@ comc_speed_set(struct env_var *ev, int f } static void -comc_setup(int speed) +set_hw_console_hint(void) +{ + char intbuf[64]; + + unsetenv("hw.uart.console"); + sprintf(intbuf, "io:%d,br:%d", comc_port, comc_curspeed); + env_setenv("hw.uart.console", EV_VOLATILE, intbuf, + env_noset, env_nounset); +} + +/* + * Input: bus:dev:func[:bar]. If bar is not specified, it is 0x10. + * Output: bar[24:16] bus[15:8] dev[7:3] func[2:0] + */ +static uint32_t +comc_parse_pcidev(const char *string) +{ + char *p, *p1; + uint8_t bus, dev, func, bar; + uint32_t locator; + int pres; + + pres = strtol(string, &p, 0); + if (p == string || *p != ':' || pres < 0 ) + return (0); + bus = pres; + p1 = ++p; + + pres = strtol(p1, &p, 0); + if (p == string || *p != ':' || pres < 0 ) + return (0); + dev = pres; + p1 = ++p; + + pres = strtol(p1, &p, 0); + if (p == string || (*p != ':' && *p != '\0') || pres < 0 ) + return (0); + func = pres; + + if (*p == ':') { + p1 = ++p; + pres = strtol(p1, &p, 0); + if (p == string || *p != '\0' || pres <= 0 ) + return (0); + bar = pres; + } else + bar = 0x10; + + locator = (bar << 16) | biospci_locator(bus, dev, func); + return (locator); +} + +static int +comc_pcidev_handle(uint32_t locator) +{ + char intbuf[64]; + uint32_t port; + + if (biospci_read_config(locator & 0xffff, + (locator & 0xff0000) >> 16, 2, &port) == -1) { + printf("Cannot read bar at 0x%x\n", locator); + return (CMD_ERROR); + } + if (!PCI_BAR_IO(port)) { + printf("Memory bar at 0x%x\n", locator); + return (CMD_ERROR); + } + port &= PCIM_BAR_IO_BASE; + + sprintf(intbuf, "%d", port); + unsetenv("comconsole_port"); + env_setenv("comconsole_port", EV_VOLATILE, intbuf, + comc_port_set, env_nounset); + + comc_setup(comc_curspeed, port); + set_hw_console_hint(); + comc_locator = locator; + + return (CMD_OK); +} + +static int +comc_pcidev_set(struct env_var *ev, int flags, const void *value) +{ + uint32_t locator; + int error; + + if (value == NULL || (locator = comc_parse_pcidev(value)) <= 0) { + printf("Invalid pcidev\n"); + return (CMD_ERROR); + } + if (comc_started && comc_locator != locator) { + error = comc_pcidev_handle(locator); + if (error != CMD_OK) + return (error); + } + env_setenv(ev->ev_name, flags | EV_NOHOOK, value, NULL, NULL); + return (CMD_OK); +} + +static void +comc_setup(int speed, int port) { comc_curspeed = speed; + comc_port = port; - outb(COMPORT + com_cfcr, CFCR_DLAB | COMC_FMT); - outb(COMPORT + com_dlbl, COMC_BPS(speed) & 0xff); - outb(COMPORT + com_dlbh, COMC_BPS(speed) >> 8); - outb(COMPORT + com_cfcr, COMC_FMT); - outb(COMPORT + com_mcr, MCR_RTS | MCR_DTR); + outb(comc_port + com_cfcr, CFCR_DLAB | COMC_FMT); + outb(comc_port + com_dlbl, COMC_BPS(speed) & 0xff); + outb(comc_port + com_dlbh, COMC_BPS(speed) >> 8); + outb(comc_port + com_cfcr, COMC_FMT); + outb(comc_port + com_mcr, MCR_RTS | MCR_DTR); do - inb(COMPORT + com_data); - while (inb(COMPORT + com_lsr) & LSR_RXRDY); + inb(comc_port + com_data); + while (inb(comc_port + com_lsr) & LSR_RXRDY); } static int -comc_parsespeed(const char *speedstr) +comc_parseint(const char *speedstr) { char *p; int speed; @@ -196,13 +353,13 @@ comc_getspeed(void) u_char dlbl; u_char cfcr; - cfcr = inb(COMPORT + com_cfcr); - outb(COMPORT + com_cfcr, CFCR_DLAB | cfcr); + cfcr = inb(comc_port + com_cfcr); + outb(comc_port + com_cfcr, CFCR_DLAB | cfcr); - dlbl = inb(COMPORT + com_dlbl); - dlbh = inb(COMPORT + com_dlbh); + dlbl = inb(comc_port + com_dlbl); + dlbh = inb(comc_port + com_dlbh); - outb(COMPORT + com_cfcr, cfcr); + outb(comc_port + com_cfcr, cfcr); divisor = dlbh << 8 | dlbl; From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 04:51:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A18C3106566B; Sun, 22 Jan 2012 04:51:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FF528FC0A; Sun, 22 Jan 2012 04:51:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0M4p1hX024526; Sun, 22 Jan 2012 04:51:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0M4p1s1024523; Sun, 22 Jan 2012 04:51:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201220451.q0M4p1s1024523@svn.freebsd.org> From: Adrian Chadd Date: Sun, 22 Jan 2012 04:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230445 - in head/tools/tools/wtap: . vis_map X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 04:51:01 -0000 Author: adrian Date: Sun Jan 22 04:51:00 2012 New Revision: 230445 URL: http://svn.freebsd.org/changeset/base/230445 Log: Bring over the visibility control tool for Monthadar's wtap project. This allows basic control over which wtap nodes can see which other wtap nodes. Added: head/tools/tools/wtap/Makefile (contents, props changed) head/tools/tools/wtap/vis_map/ head/tools/tools/wtap/vis_map/Makefile (contents, props changed) head/tools/tools/wtap/vis_map/vis_map.c (contents, props changed) Added: head/tools/tools/wtap/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/wtap/Makefile Sun Jan 22 04:51:00 2012 (r230445) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= wtap vis_map + +.include Added: head/tools/tools/wtap/vis_map/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/wtap/vis_map/Makefile Sun Jan 22 04:51:00 2012 (r230445) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +PROG= vis_map +SRC= vis_map.c +NO_MAN= 1 + +CFLAGS+= -I${.CURDIR}/../../../../sys/dev/wtap/ + +.include Added: head/tools/tools/wtap/vis_map/vis_map.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/wtap/vis_map/vis_map.c Sun Jan 22 04:51:00 2012 (r230445) @@ -0,0 +1,117 @@ +/*- + * Copyright (c) 2010-2011 Monthadar Al Jaberi, TerraNet AB + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * $FreeBSD$ + */ +#include +#include +#include +#include + +/* + * From the driver itself + */ +#include + +static int dev = -1; + +static void +toggle_medium(int op) +{ + if (ioctl(dev, VISIOCTLOPEN, &op) < 0) { + printf("error opening/closing medium\n"); + } +} + +static void +link_op(struct link *l) +{ + if (ioctl(dev, VISIOCTLLINK, l) < 0) { + printf("error making a link operation\n"); + } +} + +static void +usage(const char *argv[]) +{ + printf("usage: %s [o | c | [ [a|d] wtap_id1 wtap_id2]]\n", + argv[0]); +} + +int +main(int argc, const char* argv[]) +{ + struct link l; + char cmd; + + if (argc < 2) { + usage(argv); + exit(1); + } + + dev = open("/dev/visctl", O_RDONLY); + if (dev < 0) { + printf("error opening visctl cdev\n"); + exit(1); + } + + cmd = (char)*argv[1]; + + switch (cmd) { + case 'o': + toggle_medium(1); + break; + case 'c': + toggle_medium(0); + break; + case 'a': + if (argc < 4) { + usage(argv); + exit(1); + } + l.op = 1; + l.id1 = atoi(argv[2]); + l.id2 = atoi(argv[3]); + link_op(&l); + break; + case 'd': + if (argc < 4) { + usage(argv); + exit(1); + } + l.op = 0; + l.id1 = atoi(argv[2]); + l.id2 = atoi(argv[3]); + link_op(&l); + break; + default: + printf("wtap ioctl: unkown command '%c'\n", *argv[1]); + exit(1); + } + exit(0); +} From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 05:16:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C246C1065670; Sun, 22 Jan 2012 05:16:31 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B02358FC08; Sun, 22 Jan 2012 05:16:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0M5GVxc025353; Sun, 22 Jan 2012 05:16:31 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0M5GVXo025347; Sun, 22 Jan 2012 05:16:31 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201220516.q0M5GVXo025347@svn.freebsd.org> From: Rick Macklem Date: Sun, 22 Jan 2012 05:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230446 - in stable/9/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 05:16:32 -0000 Author: rmacklem Date: Sun Jan 22 05:16:31 2012 New Revision: 230446 URL: http://svn.freebsd.org/changeset/base/230446 Log: MFC: r229802 opt_inet6.h was missing from some files in the new NFS subsystem. The effect of this was, for clients mounted via inet6 addresses, that the DRC cache would never have a hit in the server. It also broke NFSv4 callbacks when an inet6 address was the only one available in the client. This patch fixes the above, plus deletes opt_inet6.h from a couple of files it is not needed for. Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c stable/9/sys/fs/nfs/nfs_commonsubs.c stable/9/sys/fs/nfsclient/nfs_clkrpc.c stable/9/sys/fs/nfsclient/nfs_clport.c stable/9/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonkrpc.c Sun Jan 22 04:51:00 2012 (r230445) +++ stable/9/sys/fs/nfs/nfs_commonkrpc.c Sun Jan 22 05:16:31 2012 (r230446) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); * Socket operations for use by nfs */ -#include "opt_inet6.h" #include "opt_kdtrace.h" #include "opt_kgssapi.h" #include "opt_nfs.h" Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonsubs.c Sun Jan 22 04:51:00 2012 (r230445) +++ stable/9/sys/fs/nfs/nfs_commonsubs.c Sun Jan 22 05:16:31 2012 (r230446) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); * copy data between mbuf chains and uio lists. */ #ifndef APPLEKEXT +#include "opt_inet6.h" + #include /* Modified: stable/9/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clkrpc.c Sun Jan 22 04:51:00 2012 (r230445) +++ stable/9/sys/fs/nfsclient/nfs_clkrpc.c Sun Jan 22 05:16:31 2012 (r230446) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_inet6.h" #include "opt_kgssapi.h" #include Modified: stable/9/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clport.c Sun Jan 22 04:51:00 2012 (r230445) +++ stable/9/sys/fs/nfsclient/nfs_clport.c Sun Jan 22 05:16:31 2012 (r230446) @@ -34,6 +34,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet6.h" #include "opt_kdtrace.h" #include Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clrpcops.c Sun Jan 22 04:51:00 2012 (r230445) +++ stable/9/sys/fs/nfsclient/nfs_clrpcops.c Sun Jan 22 05:16:31 2012 (r230446) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); */ #ifndef APPLEKEXT +#include "opt_inet6.h" + #include /* From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 05:30:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DFA7106566C; Sun, 22 Jan 2012 05:30:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5D3698FC1B; Sun, 22 Jan 2012 05:30:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0M5UU0S025802; Sun, 22 Jan 2012 05:30:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0M5UUR7025800; Sun, 22 Jan 2012 05:30:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201220530.q0M5UUR7025800@svn.freebsd.org> From: Adrian Chadd Date: Sun, 22 Jan 2012 05:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230447 - head/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 05:30:30 -0000 Author: adrian Date: Sun Jan 22 05:30:29 2012 New Revision: 230447 URL: http://svn.freebsd.org/changeset/base/230447 Log: Mark the taskqueue as the _net80211_ taskqueue. This makes it much easier to determine whether an event occurs in the net80211 taskqueue (which was called "ath0 taskq") or the ath driver taskqueue (which is also called "ath0 taskq".) Modified: head/sys/net80211/ieee80211.c Modified: head/sys/net80211/ieee80211.c ============================================================================== --- head/sys/net80211/ieee80211.c Sun Jan 22 05:16:31 2012 (r230446) +++ head/sys/net80211/ieee80211.c Sun Jan 22 05:30:29 2012 (r230447) @@ -276,7 +276,7 @@ ieee80211_ifattach(struct ieee80211com * /* Create a taskqueue for all state changes */ ic->ic_tq = taskqueue_create("ic_taskq", M_WAITOK | M_ZERO, taskqueue_thread_enqueue, &ic->ic_tq); - taskqueue_start_threads(&ic->ic_tq, 1, PI_NET, "%s taskq", + taskqueue_start_threads(&ic->ic_tq, 1, PI_NET, "%s net80211 taskq", ifp->if_xname); /* * Fill in 802.11 available channel set, mark all From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 06:00:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1CCEA106564A; Sun, 22 Jan 2012 06:00:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 01B4B8FC08; Sun, 22 Jan 2012 06:00:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0M60oZN026777; Sun, 22 Jan 2012 06:00:50 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0M60opj026771; Sun, 22 Jan 2012 06:00:50 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201220600.q0M60opj026771@svn.freebsd.org> From: Rick Macklem Date: Sun, 22 Jan 2012 06:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230448 - in stable/8/sys/fs: nfs nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 06:00:51 -0000 Author: rmacklem Date: Sun Jan 22 06:00:50 2012 New Revision: 230448 URL: http://svn.freebsd.org/changeset/base/230448 Log: MFC: r229802 opt_inet6.h was missing from some files in the new NFS subsystem. The effect of this was, for clients mounted via inet6 addresses, that the DRC cache would never have a hit in the server. It also broke NFSv4 callbacks when an inet6 address was the only one available in the client. This patch fixes the above, plus deletes opt_inet6.h from a couple of files it is not needed for. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c stable/8/sys/fs/nfs/nfs_commonsubs.c stable/8/sys/fs/nfsclient/nfs_clkrpc.c stable/8/sys/fs/nfsclient/nfs_clport.c stable/8/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Sun Jan 22 05:30:29 2012 (r230447) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Sun Jan 22 06:00:50 2012 (r230448) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); * Socket operations for use by nfs */ -#include "opt_inet6.h" #include "opt_kgssapi.h" #include "opt_nfs.h" Modified: stable/8/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonsubs.c Sun Jan 22 05:30:29 2012 (r230447) +++ stable/8/sys/fs/nfs/nfs_commonsubs.c Sun Jan 22 06:00:50 2012 (r230448) @@ -40,6 +40,8 @@ __FBSDID("$FreeBSD$"); * copy data between mbuf chains and uio lists. */ #ifndef APPLEKEXT +#include "opt_inet6.h" + #include /* Modified: stable/8/sys/fs/nfsclient/nfs_clkrpc.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clkrpc.c Sun Jan 22 05:30:29 2012 (r230447) +++ stable/8/sys/fs/nfsclient/nfs_clkrpc.c Sun Jan 22 06:00:50 2012 (r230448) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#include "opt_inet6.h" #include "opt_kgssapi.h" #include Modified: stable/8/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clport.c Sun Jan 22 05:30:29 2012 (r230447) +++ stable/8/sys/fs/nfsclient/nfs_clport.c Sun Jan 22 06:00:50 2012 (r230448) @@ -34,6 +34,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_inet6.h" + /* * generally, I don't like #includes inside .h files, but it seems to * be the easiest way to handle the port. Modified: stable/8/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clrpcops.c Sun Jan 22 05:30:29 2012 (r230447) +++ stable/8/sys/fs/nfsclient/nfs_clrpcops.c Sun Jan 22 06:00:50 2012 (r230448) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); */ #ifndef APPLEKEXT +#include "opt_inet6.h" + #include /* From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 08:06:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5FB7106566B; Sun, 22 Jan 2012 08:06:37 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5004F8FC15; Sun, 22 Jan 2012 08:06:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0M86btc030669; Sun, 22 Jan 2012 08:06:37 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0M86bMs030667; Sun, 22 Jan 2012 08:06:37 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201220806.q0M86bMs030667@svn.freebsd.org> From: Martin Matuska Date: Sun, 22 Jan 2012 08:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230449 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 08:06:37 -0000 Author: mm Date: Sun Jan 22 08:06:36 2012 New Revision: 230449 URL: http://svn.freebsd.org/changeset/base/230449 Log: Merge illumos revisions 13540, 13562: illumos rev 13540 [1]: Removal of pyzfs broke delegation for volumes illumos rev 13562 [2]: zfs allow arguments not parsed correctly after pyzfs removal References: https://www.illumos.org/issues/1726 [1] https://www.illumos.org/issues/1977 [2] Obtained from: illumos (issues #1726, #1977) MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jan 22 06:00:50 2012 (r230448) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Sun Jan 22 08:06:36 2012 (r230449) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. @@ -4501,7 +4501,7 @@ parse_allow_args(int argc, char **argv, argc--; argv++; opts->dataset = munge_args(argc, argv, un, 2, &opts->perms); - } else if (argc == 1) { + } else if (argc == 1 && !un) { opts->prt_perms = B_TRUE; opts->dataset = argv[argc-1]; } else { @@ -4988,9 +4988,9 @@ zfs_do_allow_unallow_impl(int argc, char parse_allow_args(argc, argv, un, &opts); /* try to open the dataset */ - if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM)) - == NULL) { - (void) fprintf(stderr, "Failed to open Dataset *%s*\n", + if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM | + ZFS_TYPE_VOLUME)) == NULL) { + (void) fprintf(stderr, "Failed to open dataset: %s\n", opts.dataset); return (-1); } @@ -5000,7 +5000,7 @@ zfs_do_allow_unallow_impl(int argc, char fs_perm_set_init(&fs_perm_set); if (parse_fs_perm_set(&fs_perm_set, perm_nvl) != 0) { - (void) fprintf(stderr, "Failed to parse fsacl permissionsn"); + (void) fprintf(stderr, "Failed to parse fsacl permissions\n"); goto cleanup1; } From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 10:16:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C277F1065706; Sun, 22 Jan 2012 10:16:25 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B07C88FC19; Sun, 22 Jan 2012 10:16:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MAGPwd034809; Sun, 22 Jan 2012 10:16:25 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MAGPem034803; Sun, 22 Jan 2012 10:16:25 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201201221016.q0MAGPem034803@svn.freebsd.org> From: Christian Brueffer Date: Sun, 22 Jan 2012 10:16:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230450 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 10:16:25 -0000 Author: brueffer Date: Sun Jan 22 10:16:24 2012 New Revision: 230450 URL: http://svn.freebsd.org/changeset/base/230450 Log: General cleanup. Prodded by: grehan Modified: head/share/man/man4/virtio.4 head/share/man/man4/virtio_balloon.4 head/share/man/man4/virtio_blk.4 head/share/man/man4/vtnet.4 Modified: head/share/man/man4/virtio.4 ============================================================================== --- head/share/man/man4/virtio.4 Sun Jan 22 08:06:36 2012 (r230449) +++ head/share/man/man4/virtio.4 Sun Jan 22 10:16:24 2012 (r230450) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2011 +.Dd January 22, 2012 .Dt VIRTIO 4 .Os .Sh NAME @@ -48,24 +48,25 @@ virtio_pci_load="YES" .Sh DESCRIPTION VirtIO is a specification for para-virtualized I/O in a virtual machine (VM). Traditionally, the hypervisor emulated real devices such as an Ethernet -interface or disk controller to provide the VM with I/O. This emulation is -often inefficient. +interface or disk controller to provide the VM with I/O. +This emulation is often inefficient. .Pp VirtIO defines an interface for efficient I/O between the hypervisor and VM. -The -.Xr virtio 4 +The +.Xr virtio 4 module provides a shared memory transport called a virtqueue. The .Xr virtio_pci 4 device driver represents an emulated PCI device that the hypervisor makes -available to the VM. This device provides the probing, configuration, and -interrupt notifications need to interact with the hypervisor. +available to the VM. +This device provides the probing, configuration, and +interrupt notifications needed to interact with the hypervisor. .Fx supports the following VirtIO devices: .Bl -hang -offset indent -width xxxxxxxx .It Nm Ethernet An emulated Ethernet device is provided by the -.Xr if_vtnet 4 +.Xr vtnet 4 device driver. .It Nm Block An emulated disk controller is provided by the @@ -78,9 +79,9 @@ provided by the device driver. .El .Sh SEE ALSO -.Xr if_vtnet 4 , +.Xr virtio_balloon 4 , .Xr virtio_blk 4 , -.Xr virtio_balloon 4 +.Xr vtnet 4 .Sh HISTORY Support for VirtIO first appeared in .Fx 9.0 . Modified: head/share/man/man4/virtio_balloon.4 ============================================================================== --- head/share/man/man4/virtio_balloon.4 Sun Jan 22 08:06:36 2012 (r230449) +++ head/share/man/man4/virtio_balloon.4 Sun Jan 22 10:16:24 2012 (r230450) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2011 +.Dd January 22, 2012 .Dt VIRTIO_BALLOON 4 .Os .Sh NAME @@ -51,8 +51,8 @@ device driver provides support for VirtI .Pp The memory balloon allows the guest to, at the request of the hypervisor, return memory allocated to the hypervisor so it can -be made available to other guests. The hypervisor can later -signal the balloon to return the memory. +be made available to other guests. +The hypervisor can later signal the balloon to return the memory. .Sh SEE ALSO .Xr virtio 4 .Sh HISTORY Modified: head/share/man/man4/virtio_blk.4 ============================================================================== --- head/share/man/man4/virtio_blk.4 Sun Jan 22 08:06:36 2012 (r230449) +++ head/share/man/man4/virtio_blk.4 Sun Jan 22 10:16:24 2012 (r230450) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2011 +.Dd January 22, 2012 .Dt VIRTIO_BLK 4 .Os .Sh NAME @@ -48,7 +48,6 @@ virtio_blk_load="YES" The .Nm device driver provides support for VirtIO block devices. -.Pp .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 @@ -57,7 +56,8 @@ prompt before booting the kernel or stor .Bl -tag -width "xxxxxx" .It Va hw.vtblk.no_ident This tunable disables retrieving the device identification string -from the hypervisor. The default value is 0. +from the hypervisor. +The default value is 0. .El .Sh SEE ALSO .Xr virtio 4 Modified: head/share/man/man4/vtnet.4 ============================================================================== --- head/share/man/man4/vtnet.4 Sun Jan 22 08:06:36 2012 (r230449) +++ head/share/man/man4/vtnet.4 Sun Jan 22 10:16:24 2012 (r230450) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 4, 2011 +.Dd January 22, 2012 .Dt VTNET 4 .Os .Sh NAME @@ -62,7 +62,6 @@ utility configures the adapter to receiv .Pp For more information on configuring this device, see .Xr ifconfig 8 . -.El .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 @@ -70,19 +69,21 @@ prompt before booting the kernel or stor .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" .It Va hw.vtnet.csum_disable -This tunable disables receive and send checksum offload. The default -value is 0. +This tunable disables receive and send checksum offload. +The default value is 0. .It Va hw.vtnet.tso_disable -This tunable disables TSO. The default value is 0. +This tunable disables TSO. +The default value is 0. .It Va hw.vtnet.lro_disable -This tunable disables LRO. The default value is 0. +This tunable disables LRO. +The default value is 0. .El .Sh SEE ALSO .Xr arp 4 , .Xr netintro 4 , .Xr ng_ether 4 , -.Xr vlan 4 , .Xr virtio 4 , +.Xr vlan 4 , .Xr ifconfig 8 .Sh HISTORY The From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 10:24:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C0D81065691; Sun, 22 Jan 2012 10:24:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 399D88FC12; Sun, 22 Jan 2012 10:24:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MAODHw071727; Sun, 22 Jan 2012 10:24:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MAODT5071724; Sun, 22 Jan 2012 10:24:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201221024.q0MAODT5071724@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jan 2012 10:24:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230451 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 10:24:13 -0000 Author: mav Date: Sun Jan 22 10:24:12 2012 New Revision: 230451 URL: http://svn.freebsd.org/changeset/base/230451 Log: Complete rewrite of the snd_hda(4) volume control. Previous code was relatively dumb. During CODEC probe it was tracing signals and statically binding amplifier controls to the OSS mixer controls. To set volume it just set all bound amplifier controls proportionally to mixer level, not looking on their hierarchy and amplification levels/offsets. New code is much smarter. It also traces signals during probe, but mostly to find out possible amplification control rages in dB for each specific signal. To set volume it retraces each affected signal again and sets amplifiers controls recursively to reach desired amplification level in dB. It would be nice to export values in dB to user, but unluckily our OSS mixer API is too simple for that. As result of this change: - cascaded amplifiers will work together to reach maximal precision. If some input has 0/+40dB preamplifier with 10dB step and -10/+10dB mixer with 1dB step after it, new code will use both to provide 0/+40dB control with 1dB step! We could even get -10/+50dB range there, but that is intentionally blocked for now. - different channels of multichannel associations on non-uniform CODECs such as VIA VT1708S will have the same volume, not looking that control ranges are different. It was not good when fronts were 12dB louder. - for multiplexed recording, when we can record from only one source at a time, we can now use recording amplifier controls to set different volume levels for different inputs if they have no own controls of they are less precise. If recording source change, amplifiers will be reconfigured. To improve out-of-the-box behavior, ignore default volume levels set by sound(4) and use own, more reasonable: +20dB for mics, -10dB for analog output volume and 0dB for the rest of controls. sound(4) defaults of 75% mean absolutely random things for different controls of different CODECs because of very different control ranges. Together with further planned automatic recording source selection this should allow users to get fine playback and recording without touching mixer first. Note that existing users should delete /var/db/mixer*-state and reboot or trigger CODEC reconfiguration to get new default values. MFC after: 2 months Sponsored by: iXsystems, Inc. Modified: head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdaa.h Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Sun Jan 22 10:16:24 2012 (r230450) +++ head/sys/dev/sound/pci/hda/hdaa.c Sun Jan 22 10:24:12 2012 (r230451) @@ -175,6 +175,8 @@ static const struct { }; #define HDA_RATE_TAB_LEN (sizeof(hda_rate_tab) / sizeof(hda_rate_tab[0])) +const static char *ossnames[] = SOUND_DEVICE_NAMES; + /**************************************************************************** * Function prototypes ****************************************************************************/ @@ -193,7 +195,6 @@ static void hdaa_dump_pin_config(struct static char * hdaa_audio_ctl_ossmixer_mask2allname(uint32_t mask, char *buf, size_t len) { - static char *ossname[] = SOUND_DEVICE_NAMES; int i, first = 1; bzero(buf, len); @@ -201,7 +202,7 @@ hdaa_audio_ctl_ossmixer_mask2allname(uin if (mask & (1 << i)) { if (first == 0) strlcat(buf, ", ", len); - strlcat(buf, ossname[i], len); + strlcat(buf, ossnames[i], len); first = 0; } } @@ -1774,11 +1775,11 @@ hdaa_audio_ctl_ossmixer_init(struct snd_ struct hdaa_pcm_devinfo *pdevinfo = mix_getdevinfo(m); struct hdaa_devinfo *devinfo = pdevinfo->devinfo; struct hdaa_widget *w, *cw; - struct hdaa_audio_ctl *ctl; uint32_t mask, recmask; - int i, j, softpcmvol; + int i, j; hdaa_lock(devinfo); + pdevinfo->mixer = m; /* Make sure that in case of soft volume it won't stay muted. */ for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { @@ -1786,11 +1787,10 @@ hdaa_audio_ctl_ossmixer_init(struct snd_ pdevinfo->right[i] = 100; } - mask = 0; - recmask = 0; - - /* Declate EAPD as ogain control. */ + /* Declare volume controls assigned to this association. */ + mask = pdevinfo->ossmask; if (pdevinfo->playas >= 0) { + /* Declate EAPD as ogain control. */ for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdaa_widget_get(devinfo, i); if (w == NULL || w->enable == 0) @@ -1802,23 +1802,36 @@ hdaa_audio_ctl_ossmixer_init(struct snd_ mask |= SOUND_MASK_OGAIN; break; } - } - /* Declare volume controls assigned to this association. */ - i = 0; - ctl = NULL; - while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { - if (ctl->enable == 0) - continue; - if ((pdevinfo->playas >= 0 && - ctl->widget->bindas == pdevinfo->playas) || - (pdevinfo->recas >= 0 && - ctl->widget->bindas == pdevinfo->recas) || - (ctl->widget->bindas == -2 && pdevinfo->index == 0)) - mask |= ctl->ossmask; + /* Declare soft PCM volume if needed. */ + if ((mask & SOUND_MASK_PCM) == 0 || + (devinfo->quirks & HDAA_QUIRK_SOFTPCMVOL) || + pdevinfo->minamp[SOUND_MIXER_PCM] == + pdevinfo->maxamp[SOUND_MIXER_PCM]) { + mask |= SOUND_MASK_PCM; + pcm_setflags(pdevinfo->dev, pcm_getflags(pdevinfo->dev) | SD_F_SOFTPCMVOL); + HDA_BOOTHVERBOSE( + device_printf(pdevinfo->dev, + "Forcing Soft PCM volume\n"); + ); + } + + /* Declare master volume if needed. */ + if ((mask & SOUND_MASK_VOLUME) == 0) { + mask |= SOUND_MASK_VOLUME; + mix_setparentchild(m, SOUND_MIXER_VOLUME, + SOUND_MASK_PCM); + mix_setrealdev(m, SOUND_MIXER_VOLUME, + SOUND_MIXER_NONE); + HDA_BOOTHVERBOSE( + device_printf(pdevinfo->dev, + "Forcing master volume with PCM\n"); + ); + } } /* Declare record sources available to this association. */ + recmask = 0; if (pdevinfo->recas >= 0) { for (i = 0; i < 16; i++) { if (devinfo->as[pdevinfo->recas].dacs[0][i] < 0) @@ -1841,66 +1854,273 @@ hdaa_audio_ctl_ossmixer_init(struct snd_ } } - /* Declare soft PCM volume if needed. */ - if (pdevinfo->playas >= 0) { - ctl = NULL; - if ((mask & SOUND_MASK_PCM) == 0 || - (devinfo->quirks & HDAA_QUIRK_SOFTPCMVOL)) { - softpcmvol = 1; - mask |= SOUND_MASK_PCM; - } else { - softpcmvol = 0; - i = 0; - while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { - if (ctl->enable == 0) - continue; - if (ctl->widget->bindas != pdevinfo->playas && - (ctl->widget->bindas != -2 || pdevinfo->index != 0)) - continue; - if (!(ctl->ossmask & SOUND_MASK_PCM)) - continue; - if (ctl->step > 0) - break; - } + recmask &= (1 << SOUND_MIXER_NRDEVICES) - 1; + mask &= (1 << SOUND_MIXER_NRDEVICES) - 1; + pdevinfo->ossmask = mask; + + mix_setrecdevs(m, recmask); + mix_setdevs(m, mask); + + hdaa_unlock(devinfo); + + return (0); +} + +/* + * Update amplification per pdevinfo per ossdev, calculate summary coefficient + * and write it to codec, update *left and *right to reflect remaining error. + */ +static void +hdaa_audio_ctl_dev_set(struct hdaa_audio_ctl *ctl, int ossdev, + int mute, int *left, int *right) +{ + int i, zleft, zright, sleft, sright, smute, lval, rval; + + ctl->devleft[ossdev] = *left; + ctl->devright[ossdev] = *right; + ctl->devmute[ossdev] = mute; + smute = sleft = sright = zleft = zright = 0; + for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) { + sleft += ctl->devleft[i]; + sright += ctl->devright[i]; + smute |= ctl->devmute[i]; + if (i == ossdev) + continue; + zleft += ctl->devleft[i]; + zright += ctl->devright[i]; + } + lval = QDB2VAL(ctl, sleft); + rval = QDB2VAL(ctl, sright); + hdaa_audio_ctl_amp_set(ctl, smute, lval, rval); + *left -= VAL2QDB(ctl, lval) - VAL2QDB(ctl, QDB2VAL(ctl, zleft)); + *right -= VAL2QDB(ctl, rval) - VAL2QDB(ctl, QDB2VAL(ctl, zright)); +} + +/* + * Trace signal from source, setting volumes on the way. + */ +static void +hdaa_audio_ctl_source_volume(struct hdaa_pcm_devinfo *pdevinfo, + int ossdev, nid_t nid, int index, int mute, int left, int right, int depth) +{ + struct hdaa_devinfo *devinfo = pdevinfo->devinfo; + struct hdaa_widget *w, *wc; + struct hdaa_audio_ctl *ctl; + int i, j, conns = 0; + + if (depth > HDA_PARSE_MAXDEPTH) + return; + + w = hdaa_widget_get(devinfo, nid); + if (w == NULL || w->enable == 0) + return; + + /* Count number of active inputs. */ + if (depth > 0) { + for (j = 0; j < w->nconns; j++) { + if (!w->connsenable[j]) + continue; + conns++; } + } - if (softpcmvol == 1 || ctl == NULL) { - pcm_setflags(pdevinfo->dev, pcm_getflags(pdevinfo->dev) | SD_F_SOFTPCMVOL); - HDA_BOOTVERBOSE( - device_printf(pdevinfo->dev, - "%s Soft PCM volume\n", - (softpcmvol == 1) ? "Forcing" : "Enabling"); - ); + /* If this is not a first step - use input mixer. + Pins have common input ctl so care must be taken. */ + if (depth > 0 && (conns == 1 || + w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX)) { + ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_IN, + index, 1); + if (ctl) + hdaa_audio_ctl_dev_set(ctl, ossdev, mute, &left, &right); + } + + /* If widget has own ossdev - not traverse it. + It will be traversed on it's own. */ + if (w->ossdev >= 0 && depth > 0) + return; + + /* We must not traverse pin */ + if ((w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_INPUT || + w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) && + depth > 0) + return; + + /* + * If signals mixed, we can't assign controls farther. + * Ignore this on depth zero. Caller must knows why. + */ + if (conns > 1 && + (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_MIXER || + w->selconn != index)) + return; + + ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_OUT, -1, 1); + if (ctl) + hdaa_audio_ctl_dev_set(ctl, ossdev, mute, &left, &right); + + for (i = devinfo->startnode; i < devinfo->endnode; i++) { + wc = hdaa_widget_get(devinfo, i); + if (wc == NULL || wc->enable == 0) + continue; + for (j = 0; j < wc->nconns; j++) { + if (wc->connsenable[j] && wc->conns[j] == nid) { + hdaa_audio_ctl_source_volume(pdevinfo, ossdev, + wc->nid, j, mute, left, right, depth + 1); + } } } + return; +} - /* Declare master volume if needed. */ - if (pdevinfo->playas >= 0) { - if ((mask & (SOUND_MASK_VOLUME | SOUND_MASK_PCM)) == - SOUND_MASK_PCM) { - mask |= SOUND_MASK_VOLUME; - mix_setparentchild(m, SOUND_MIXER_VOLUME, - SOUND_MASK_PCM); - mix_setrealdev(m, SOUND_MIXER_VOLUME, - SOUND_MIXER_NONE); - HDA_BOOTVERBOSE( - device_printf(pdevinfo->dev, - "Forcing master volume with PCM\n"); - ); +/* + * Trace signal from destination, setting volumes on the way. + */ +static void +hdaa_audio_ctl_dest_volume(struct hdaa_pcm_devinfo *pdevinfo, + int ossdev, nid_t nid, int index, int mute, int left, int right, int depth) +{ + struct hdaa_devinfo *devinfo = pdevinfo->devinfo; + struct hdaa_audio_as *as = devinfo->as; + struct hdaa_widget *w, *wc; + struct hdaa_audio_ctl *ctl; + int i, j, consumers, cleft, cright; + + if (depth > HDA_PARSE_MAXDEPTH) + return; + + w = hdaa_widget_get(devinfo, nid); + if (w == NULL || w->enable == 0) + return; + + if (depth > 0) { + /* If this node produce output for several consumers, + we can't touch it. */ + consumers = 0; + for (i = devinfo->startnode; i < devinfo->endnode; i++) { + wc = hdaa_widget_get(devinfo, i); + if (wc == NULL || wc->enable == 0) + continue; + for (j = 0; j < wc->nconns; j++) { + if (wc->connsenable[j] && wc->conns[j] == nid) + consumers++; + } } + /* The only exception is if real HP redirection is configured + and this is a duplication point. + XXX: Actually exception is not completely correct. + XXX: Duplication point check is not perfect. */ + if ((consumers == 2 && (w->bindas < 0 || + as[w->bindas].hpredir < 0 || as[w->bindas].fakeredir || + (w->bindseqmask & (1 << 15)) == 0)) || + consumers > 2) + return; + + /* Else use it's output mixer. */ + ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, + HDAA_CTL_OUT, -1, 1); + if (ctl) + hdaa_audio_ctl_dev_set(ctl, ossdev, mute, &left, &right); } - recmask &= (1 << SOUND_MIXER_NRDEVICES) - 1; - mask &= (1 << SOUND_MIXER_NRDEVICES) - 1; + /* We must not traverse pin */ + if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX && + depth > 0) + return; - mix_setrecdevs(m, recmask); - mix_setdevs(m, mask); + for (i = 0; i < w->nconns; i++) { + if (w->connsenable[i] == 0) + continue; + if (index >= 0 && i != index) + continue; + cleft = left; + cright = right; + ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, + HDAA_CTL_IN, i, 1); + if (ctl) + hdaa_audio_ctl_dev_set(ctl, ossdev, mute, &cleft, &cright); + hdaa_audio_ctl_dest_volume(pdevinfo, ossdev, w->conns[i], -1, + mute, cleft, cright, depth + 1); + } +} - hdaa_unlock(devinfo); +/* + * Set volumes for the specified pdevinfo and ossdev. + */ +static void +hdaa_audio_ctl_dev_volume(struct hdaa_pcm_devinfo *pdevinfo, unsigned dev) +{ + struct hdaa_devinfo *devinfo = pdevinfo->devinfo; + struct hdaa_widget *w, *cw; + uint32_t mute; + int lvol, rvol; + int i, j; - return (0); + mute = 0; + if (pdevinfo->left[dev] == 0) { + mute |= HDAA_AMP_MUTE_LEFT; + lvol = -4000; + } else + lvol = ((pdevinfo->maxamp[dev] - pdevinfo->minamp[dev]) * + pdevinfo->left[dev] + 50) / 100 + pdevinfo->minamp[dev]; + if (pdevinfo->right[dev] == 0) { + mute |= HDAA_AMP_MUTE_RIGHT; + rvol = -4000; + } else + rvol = ((pdevinfo->maxamp[dev] - pdevinfo->minamp[dev]) * + pdevinfo->right[dev] + 50) / 100 + pdevinfo->minamp[dev]; + for (i = devinfo->startnode; i < devinfo->endnode; i++) { + w = hdaa_widget_get(devinfo, i); + if (w == NULL || w->enable == 0) + continue; + if (w->bindas < 0 && pdevinfo->index != 0) + continue; + if (w->bindas != pdevinfo->playas && + w->bindas != pdevinfo->recas) + continue; + if (dev == SOUND_MIXER_RECLEV && + w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_INPUT) { + hdaa_audio_ctl_dest_volume(pdevinfo, dev, + w->nid, -1, mute, lvol, rvol, 0); + continue; + } + if (dev == SOUND_MIXER_VOLUME && + w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX && + devinfo->as[w->bindas].dir == HDAA_CTL_OUT) { + hdaa_audio_ctl_dest_volume(pdevinfo, dev, + w->nid, -1, mute, lvol, rvol, 0); + continue; + } + if (dev == SOUND_MIXER_IGAIN && + w->pflags & HDAA_ADC_MONITOR) { + for (j = 0; j < w->nconns; j++) { + if (!w->connsenable[j]) + continue; + cw = hdaa_widget_get(devinfo, w->conns[j]); + if (cw == NULL || cw->enable == 0) + continue; + if (cw->bindas == -1) + continue; + if (cw->bindas >= 0 && + devinfo->as[cw->bindas].dir != HDAA_CTL_IN) + continue; + hdaa_audio_ctl_dest_volume(pdevinfo, dev, + w->nid, j, mute, lvol, rvol, 0); + } + continue; + } + if (w->ossdev != dev) + continue; + hdaa_audio_ctl_source_volume(pdevinfo, dev, + w->nid, -1, mute, lvol, rvol, 0); + if (dev == SOUND_MIXER_IMIX && (w->pflags & HDAA_IMIX_AS_DST)) + hdaa_audio_ctl_dest_volume(pdevinfo, dev, + w->nid, -1, mute, lvol, rvol, 0); + } } +/* + * OSS Mixer set method. + */ static int hdaa_audio_ctl_ossmixer_set(struct snd_mixer *m, unsigned dev, unsigned left, unsigned right) @@ -1908,12 +2128,10 @@ hdaa_audio_ctl_ossmixer_set(struct snd_m struct hdaa_pcm_devinfo *pdevinfo = mix_getdevinfo(m); struct hdaa_devinfo *devinfo = pdevinfo->devinfo; struct hdaa_widget *w; - struct hdaa_audio_ctl *ctl; - uint32_t mute; - int lvol, rvol; - int i, j; + int i; hdaa_lock(devinfo); + /* Save new values. */ pdevinfo->left[dev] = left; pdevinfo->right[dev] = right; @@ -1954,39 +2172,57 @@ hdaa_audio_ctl_ossmixer_set(struct snd_m } /* Recalculate all controls related to this OSS device. */ - i = 0; - while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { - if (ctl->enable == 0 || - !(ctl->ossmask & (1 << dev))) + hdaa_audio_ctl_dev_volume(pdevinfo, dev); + + hdaa_unlock(devinfo); + return (left | (right << 8)); +} + +/* + * Set mixer settings to our own default values: + * +20dB for mics, -10dB for analog vol, mute for igain, 0dB for others. + */ +static void +hdaa_audio_ctl_set_defaults(struct hdaa_pcm_devinfo *pdevinfo) +{ + int amp, vol, dev; + + for (dev = 0; dev < SOUND_MIXER_NRDEVICES; dev++) { + if ((pdevinfo->ossmask & (1 << dev)) == 0) continue; - if (!((pdevinfo->playas >= 0 && - ctl->widget->bindas == pdevinfo->playas) || - (pdevinfo->recas >= 0 && - ctl->widget->bindas == pdevinfo->recas) || - ctl->widget->bindas == -2)) + + /* If the value was overriden, leave it as is. */ + if (resource_int_value(device_get_name(pdevinfo->dev), + device_get_unit(pdevinfo->dev), ossnames[dev], &vol) == 0) continue; - lvol = 100; - rvol = 100; - for (j = 0; j < SOUND_MIXER_NRDEVICES; j++) { - if (ctl->ossmask & (1 << j)) { - lvol = lvol * pdevinfo->left[j] / 100; - rvol = rvol * pdevinfo->right[j] / 100; - } + vol = -1; + if (dev == SOUND_MIXER_OGAIN) + vol = 100; + else if (dev == SOUND_MIXER_IGAIN) + vol = 0; + else if (dev == SOUND_MIXER_MIC || + dev == SOUND_MIXER_MONITOR) + amp = 20 * 4; /* +20dB */ + else if (dev == SOUND_MIXER_VOLUME && !pdevinfo->digital) + amp = -10 * 4; /* -10dB */ + else + amp = 0; + if (vol < 0 && + (pdevinfo->maxamp[dev] - pdevinfo->minamp[dev]) <= 0) { + vol = 100; + } else if (vol < 0) { + vol = ((amp - pdevinfo->minamp[dev]) * 100 + + (pdevinfo->maxamp[dev] - pdevinfo->minamp[dev]) / 2) / + (pdevinfo->maxamp[dev] - pdevinfo->minamp[dev]); + vol = imin(imax(vol, 1), 100); } - mute = (lvol == 0) ? HDAA_AMP_MUTE_LEFT : 0; - mute |= (rvol == 0) ? HDAA_AMP_MUTE_RIGHT : 0; - lvol = (lvol * ctl->step + 50) / 100; - rvol = (rvol * ctl->step + 50) / 100; - hdaa_audio_ctl_amp_set(ctl, mute, lvol, rvol); + mix_set(pdevinfo->mixer, dev, vol, vol); } - hdaa_unlock(devinfo); - - return (left | (right << 8)); } /* - * Commutate specified record source. + * Recursively commutate specified record source. */ static uint32_t hdaa_audio_ctl_recsel_comm(struct hdaa_pcm_devinfo *pdevinfo, uint32_t src, nid_t nid, int depth) @@ -2069,6 +2305,7 @@ hdaa_audio_ctl_ossmixer_setrecsrc(struct struct hdaa_devinfo *devinfo = pdevinfo->devinfo; struct hdaa_widget *w; struct hdaa_audio_as *as; + struct hdaa_audio_ctl *ctl; struct hdaa_chan *ch; int i, j; uint32_t ret = 0xffffffff; @@ -2097,9 +2334,47 @@ hdaa_audio_ctl_ossmixer_setrecsrc(struct ch->io[i], 0); } } + if (ret == 0xffffffff) + ret = 0; + + /* + * Some controls could be shared. Reset volumes for controls + * related to previously chosen devices, as they may no longer + * affect the signal. + */ + i = 0; + while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { + if (ctl->enable == 0 || + !(ctl->ossmask & pdevinfo->recsrc)) + continue; + if (!((pdevinfo->playas >= 0 && + ctl->widget->bindas == pdevinfo->playas) || + (pdevinfo->recas >= 0 && + ctl->widget->bindas == pdevinfo->recas) || + (pdevinfo->index == 0 && + ctl->widget->bindas == -2))) + continue; + for (j = 0; j < SOUND_MIXER_NRDEVICES; j++) { + if (pdevinfo->recsrc & (1 << j)) { + ctl->devleft[j] = 0; + ctl->devright[j] = 0; + ctl->devmute[j] = 0; + } + } + } + /* + * Some controls could be shared. Set volumes for controls + * related to devices selected both previously and now. + */ + for (j = 0; j < SOUND_MIXER_NRDEVICES; j++) { + if ((ret | pdevinfo->recsrc) & (1 << j)) + hdaa_audio_ctl_dev_volume(pdevinfo, j); + } + + pdevinfo->recsrc = ret; hdaa_unlock(devinfo); - return ((ret == 0xffffffff)? 0 : ret); + return (ret); } static kobj_method_t hdaa_audio_ctl_ossmixer_methods[] = { @@ -3782,31 +4057,31 @@ hdaa_audio_disable_crossas(struct hdaa_d } -#define HDA_CTL_GIVE(ctl) ((ctl)->step?1:0) - /* - * Find controls to control amplification for source. + * Find controls to control amplification for source and calculate possible + * amplification range. */ static int hdaa_audio_ctl_source_amp(struct hdaa_devinfo *devinfo, nid_t nid, int index, - int ossdev, int ctlable, int depth, int need) + int ossdev, int ctlable, int depth, int *minamp, int *maxamp) { struct hdaa_widget *w, *wc; struct hdaa_audio_ctl *ctl; - int i, j, conns = 0, rneed; + int i, j, conns = 0, tminamp, tmaxamp, cminamp, cmaxamp, found = 0; if (depth > HDA_PARSE_MAXDEPTH) - return (need); + return (found); w = hdaa_widget_get(devinfo, nid); if (w == NULL || w->enable == 0) - return (need); + return (found); /* Count number of active inputs. */ if (depth > 0) { for (j = 0; j < w->nconns; j++) { - if (w->connsenable[j]) - conns++; + if (!w->connsenable[j]) + continue; + conns++; } } @@ -3817,81 +4092,96 @@ hdaa_audio_ctl_source_amp(struct hdaa_de ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_IN, index, 1); if (ctl) { - if (HDA_CTL_GIVE(ctl) & need) - ctl->ossmask |= (1 << ossdev); - else - ctl->possmask |= (1 << ossdev); - need &= ~HDA_CTL_GIVE(ctl); + ctl->ossmask |= (1 << ossdev); + found++; + if (*minamp == *maxamp) { + *minamp += MINQDB(ctl); + *maxamp += MAXQDB(ctl); + } } } /* If widget has own ossdev - not traverse it. It will be traversed on it's own. */ if (w->ossdev >= 0 && depth > 0) - return (need); + return (found); /* We must not traverse pin */ if ((w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_INPUT || w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) && depth > 0) - return (need); + return (found); /* record that this widget exports such signal, */ w->ossmask |= (1 << ossdev); - /* If signals mixed, we can't assign controls farther. + /* + * If signals mixed, we can't assign controls farther. * Ignore this on depth zero. Caller must knows why. - * Ignore this for static selectors if this input selected. */ - if (conns > 1) + if (conns > 1 && + w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_MIXER) ctlable = 0; if (ctlable) { ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_OUT, -1, 1); if (ctl) { - if (HDA_CTL_GIVE(ctl) & need) - ctl->ossmask |= (1 << ossdev); - else - ctl->possmask |= (1 << ossdev); - need &= ~HDA_CTL_GIVE(ctl); + ctl->ossmask |= (1 << ossdev); + found++; + if (*minamp == *maxamp) { + *minamp += MINQDB(ctl); + *maxamp += MAXQDB(ctl); + } } } - rneed = 0; + cminamp = cmaxamp = 0; for (i = devinfo->startnode; i < devinfo->endnode; i++) { wc = hdaa_widget_get(devinfo, i); if (wc == NULL || wc->enable == 0) continue; for (j = 0; j < wc->nconns; j++) { if (wc->connsenable[j] && wc->conns[j] == nid) { - rneed |= hdaa_audio_ctl_source_amp(devinfo, - wc->nid, j, ossdev, ctlable, depth + 1, need); + tminamp = tmaxamp = 0; + found += hdaa_audio_ctl_source_amp(devinfo, + wc->nid, j, ossdev, ctlable, depth + 1, + &tminamp, &tmaxamp); + if (cminamp == 0 && cmaxamp == 0) { + cminamp = tminamp; + cmaxamp = tmaxamp; + } else if (tminamp != tmaxamp) { + cminamp = imax(cminamp, tminamp); + cmaxamp = imin(cmaxamp, tmaxamp); + } } } } - rneed &= need; - - return (rneed); + if (*minamp == *maxamp && cminamp < cmaxamp) { + *minamp += cminamp; + *maxamp += cmaxamp; + } + return (found); } /* - * Find controls to control amplification for destination. + * Find controls to control amplification for destination and calculate + * possible amplification range. */ -static void +static int hdaa_audio_ctl_dest_amp(struct hdaa_devinfo *devinfo, nid_t nid, int index, - int ossdev, int depth, int need) + int ossdev, int depth, int *minamp, int *maxamp) { struct hdaa_audio_as *as = devinfo->as; struct hdaa_widget *w, *wc; struct hdaa_audio_ctl *ctl; - int i, j, consumers; + int i, j, consumers, tminamp, tmaxamp, cminamp, cmaxamp, found = 0; if (depth > HDA_PARSE_MAXDEPTH) - return; + return (found); w = hdaa_widget_get(devinfo, nid); if (w == NULL || w->enable == 0) - return; + return (found); if (depth > 0) { /* If this node produce output for several consumers, @@ -3914,43 +4204,58 @@ hdaa_audio_ctl_dest_amp(struct hdaa_devi as[w->bindas].hpredir < 0 || as[w->bindas].fakeredir || (w->bindseqmask & (1 << 15)) == 0)) || consumers > 2) - return; + return (found); /* Else use it's output mixer. */ ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_OUT, -1, 1); if (ctl) { - if (HDA_CTL_GIVE(ctl) & need) - ctl->ossmask |= (1 << ossdev); - else - ctl->possmask |= (1 << ossdev); - need &= ~HDA_CTL_GIVE(ctl); + ctl->ossmask |= (1 << ossdev); + found++; + if (*minamp == *maxamp) { + *minamp += MINQDB(ctl); + *maxamp += MAXQDB(ctl); + } } } /* We must not traverse pin */ if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX && depth > 0) - return; + return (found); + cminamp = cmaxamp = 0; for (i = 0; i < w->nconns; i++) { - int tneed = need; if (w->connsenable[i] == 0) continue; if (index >= 0 && i != index) continue; + tminamp = tmaxamp = 0; ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_IN, i, 1); if (ctl) { - if (HDA_CTL_GIVE(ctl) & tneed) - ctl->ossmask |= (1 << ossdev); - else - ctl->possmask |= (1 << ossdev); - tneed &= ~HDA_CTL_GIVE(ctl); - } - hdaa_audio_ctl_dest_amp(devinfo, w->conns[i], -1, ossdev, - depth + 1, tneed); + ctl->ossmask |= (1 << ossdev); + found++; + if (*minamp == *maxamp) { + tminamp += MINQDB(ctl); + tmaxamp += MAXQDB(ctl); + } + } + found += hdaa_audio_ctl_dest_amp(devinfo, w->conns[i], -1, ossdev, + depth + 1, &tminamp, &tmaxamp); + if (cminamp == 0 && cmaxamp == 0) { + cminamp = tminamp; + cmaxamp = tmaxamp; + } else if (tminamp != tmaxamp) { + cminamp = imax(cminamp, tminamp); + cmaxamp = imin(cmaxamp, tmaxamp); + } + } + if (*minamp == *maxamp && cminamp < cmaxamp) { + *minamp += cminamp; + *maxamp += cmaxamp; } + return (found); } /* @@ -4158,43 +4463,82 @@ retry: hdaa_audio_trace_as_extra(devinfo); } +/* + * Store in pdevinfo new data about whether and how we can control signal + * for OSS device to/from specified widget. + */ +static void +hdaa_adjust_amp(struct hdaa_widget *w, int ossdev, + int found, int minamp, int maxamp) +{ + struct hdaa_devinfo *devinfo = w->devinfo; + struct hdaa_pcm_devinfo *pdevinfo; + + if (w->bindas >= 0) + pdevinfo = devinfo->as[w->bindas].pdevinfo; + else + pdevinfo = &devinfo->devs[0]; + if (found) + pdevinfo->ossmask |= (1 << ossdev); + if (minamp == 0 && maxamp == 0) + return; + if (pdevinfo->minamp[ossdev] == 0 && pdevinfo->maxamp[ossdev] == 0) { + pdevinfo->minamp[ossdev] = minamp; + pdevinfo->maxamp[ossdev] = maxamp; + } else { + pdevinfo->minamp[ossdev] = imax(pdevinfo->minamp[ossdev], minamp); + pdevinfo->maxamp[ossdev] = imin(pdevinfo->maxamp[ossdev], maxamp); + } +} + +/* + * Trace signals from/to all possible sources/destionstions to find possible + * recording sources, OSS device control ranges and to assign controls. + */ static void hdaa_audio_assign_mixers(struct hdaa_devinfo *devinfo) { struct hdaa_audio_as *as = devinfo->as; - struct hdaa_audio_ctl *ctl; struct hdaa_widget *w, *cw; - int i, j; + int i, j, minamp, maxamp, found; /* Assign mixers to the tree. */ for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdaa_widget_get(devinfo, i); if (w == NULL || w->enable == 0) continue; + minamp = maxamp = 0; if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_OUTPUT || w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_BEEP_WIDGET || (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX && as[w->bindas].dir == HDAA_CTL_IN)) { if (w->ossdev < 0) continue; - hdaa_audio_ctl_source_amp(devinfo, w->nid, -1, - w->ossdev, 1, 0, 1); + found = hdaa_audio_ctl_source_amp(devinfo, w->nid, -1, + w->ossdev, 1, 0, &minamp, &maxamp); + hdaa_adjust_amp(w, w->ossdev, found, minamp, maxamp); } else if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_AUDIO_INPUT) { - hdaa_audio_ctl_dest_amp(devinfo, w->nid, -1, - SOUND_MIXER_RECLEV, 0, 1); + found = hdaa_audio_ctl_dest_amp(devinfo, w->nid, -1, + SOUND_MIXER_RECLEV, 0, &minamp, &maxamp); + hdaa_adjust_amp(w, SOUND_MIXER_RECLEV, found, minamp, maxamp); } else if (w->type == HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX && as[w->bindas].dir == HDAA_CTL_OUT) { - hdaa_audio_ctl_dest_amp(devinfo, w->nid, -1, - SOUND_MIXER_VOLUME, 0, 1); + found = hdaa_audio_ctl_dest_amp(devinfo, w->nid, -1, + SOUND_MIXER_VOLUME, 0, &minamp, &maxamp); + hdaa_adjust_amp(w, SOUND_MIXER_VOLUME, found, minamp, maxamp); } if (w->ossdev == SOUND_MIXER_IMIX) { - if (hdaa_audio_ctl_source_amp(devinfo, w->nid, -1, - w->ossdev, 1, 0, 1)) { + minamp = maxamp = 0; + found = hdaa_audio_ctl_source_amp(devinfo, w->nid, -1, + w->ossdev, 1, 0, &minamp, &maxamp); + if (minamp == maxamp) { /* If we are unable to control input monitor as source - try to control it as destination. */ - hdaa_audio_ctl_dest_amp(devinfo, w->nid, -1, - w->ossdev, 0, 1); + found += hdaa_audio_ctl_dest_amp(devinfo, w->nid, -1, + w->ossdev, 0, &minamp, &maxamp); + w->pflags |= HDAA_IMIX_AS_DST; } + hdaa_adjust_amp(w, w->ossdev, found, minamp, maxamp); } if (w->pflags & HDAA_ADC_MONITOR) { for (j = 0; j < w->nconns; j++) { @@ -4208,17 +4552,15 @@ hdaa_audio_assign_mixers(struct hdaa_dev if (cw->bindas >= 0 && as[cw->bindas].dir != HDAA_CTL_IN) continue; - hdaa_audio_ctl_dest_amp(devinfo, - w->nid, j, SOUND_MIXER_IGAIN, 0, 1); + minamp = maxamp = 0; + found = hdaa_audio_ctl_dest_amp(devinfo, + w->nid, j, SOUND_MIXER_IGAIN, 0, + &minamp, &maxamp); + hdaa_adjust_amp(w, SOUND_MIXER_IGAIN, + found, minamp, maxamp); } } } - /* Treat unrequired as possible. */ - i = 0; - while ((ctl = hdaa_audio_ctl_each(devinfo, &i)) != NULL) { - if (ctl->ossmask == 0) - ctl->ossmask = ctl->possmask; - } } static void @@ -4671,7 +5013,7 @@ hdaa_pcmchannel_setup(struct hdaa_chan * } static void -hdaa_create_pcms(struct hdaa_devinfo *devinfo) +hdaa_prepare_pcms(struct hdaa_devinfo *devinfo) { struct hdaa_audio_as *as = devinfo->as; int i, j, k, apdev = 0, ardev = 0, dpdev = 0, drdev = 0; @@ -4726,6 +5068,7 @@ hdaa_create_pcms(struct hdaa_devinfo *de continue; devinfo->devs[j].playas = i; } + as[i].pdevinfo = &devinfo->devs[j]; for (k = 0; k < as[i].num_chans; k++) { devinfo->chans[as[i].chans[k]].pdevinfo = &devinfo->devs[j]; @@ -4734,6 +5077,13 @@ hdaa_create_pcms(struct hdaa_devinfo *de break; } } +} + +static void +hdaa_create_pcms(struct hdaa_devinfo *devinfo) +{ + int i; + for (i = 0; i < devinfo->num_devs; i++) { struct hdaa_pcm_devinfo *pdevinfo = &devinfo->devs[i]; @@ -4782,9 +5132,15 @@ hdaa_dump_ctls(struct hdaa_pcm_devinfo * } else { device_printf(pdevinfo->dev, "Unknown Ctl"); } - printf(" (OSS: %s)\n", + printf(" (OSS: %s)", hdaa_audio_ctl_ossmixer_mask2allname(1 << j, buf, sizeof(buf))); + if (pdevinfo->ossmask & (1 << j)) { + printf(": %+d/%+ddB\n", + pdevinfo->minamp[j] / 4, + pdevinfo->maxamp[j] / 4); + } else + printf("\n"); device_printf(pdevinfo->dev, " |\n"); printed = 1; } @@ -4797,8 +5153,8 @@ hdaa_dump_ctls(struct hdaa_pcm_devinfo * printf("): "); if (ctl->step > 0) { printf("%+d/%+ddB (%d steps)%s\n", - (0 - ctl->offset) * (ctl->size + 1) / 4, - (ctl->step - ctl->offset) * (ctl->size + 1) / 4, + MINQDB(ctl) / 4, + MAXQDB(ctl) / 4, ctl->step + 1, ctl->mute?" + mute":""); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 10:41:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6178F106566C; Sun, 22 Jan 2012 10:41:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 507A38FC12; Sun, 22 Jan 2012 10:41:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MAfxQ5072302; Sun, 22 Jan 2012 10:41:59 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MAfxDU072298; Sun, 22 Jan 2012 10:41:59 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201221041.q0MAfxDU072298@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 22 Jan 2012 10:41:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230452 - in head/sys/netinet: . ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 10:41:59 -0000 Author: bz Date: Sun Jan 22 10:41:58 2012 New Revision: 230452 URL: http://svn.freebsd.org/changeset/base/230452 Log: Make #error messages string-literals and remove punctuation. Reported by: bde (for ip_divert) Reviewed by: bde MFC after: 3 days Modified: head/sys/netinet/ip_divert.c head/sys/netinet/ip_gre.c head/sys/netinet/ipfw/ip_fw2.c Modified: head/sys/netinet/ip_divert.c ============================================================================== --- head/sys/netinet/ip_divert.c Sun Jan 22 10:24:12 2012 (r230451) +++ head/sys/netinet/ip_divert.c Sun Jan 22 10:41:58 2012 (r230452) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet6.h" #include "opt_sctp.h" #ifndef INET -#error "IPDIVERT requires INET." +#error "IPDIVERT requires INET" #endif #include Modified: head/sys/netinet/ip_gre.c ============================================================================== --- head/sys/netinet/ip_gre.c Sun Jan 22 10:24:12 2012 (r230451) +++ head/sys/netinet/ip_gre.c Sun Jan 22 10:41:58 2012 (r230452) @@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$"); #include #include #else -#error ip_gre input without IP? +#error "ip_gre requires INET" #endif #ifdef NETATALK Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Sun Jan 22 10:24:12 2012 (r230451) +++ head/sys/netinet/ipfw/ip_fw2.c Sun Jan 22 10:41:58 2012 (r230452) @@ -34,7 +34,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ipdivert.h" #include "opt_inet.h" #ifndef INET -#error IPFIREWALL requires INET. +#error "IPFIREWALL requires INET" #endif /* INET */ #include "opt_inet6.h" #include "opt_ipsec.h" From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 10:57:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAAB2106566B; Sun, 22 Jan 2012 10:57:32 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9F5A98FC0C; Sun, 22 Jan 2012 10:57:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MAvWjv072825; Sun, 22 Jan 2012 10:57:32 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MAvW5n072822; Sun, 22 Jan 2012 10:57:32 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201221057.q0MAvW5n072822@svn.freebsd.org> From: Hiroki Sato Date: Sun, 22 Jan 2012 10:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230453 - in head/etc: . rc.d X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 10:57:32 -0000 Author: hrs Date: Sun Jan 22 10:57:32 2012 New Revision: 230453 URL: http://svn.freebsd.org/changeset/base/230453 Log: Fix several glitches in IPv6-related knobs: - ipv6_enable + ipv6_gateway_enable should unset ACCEPT_RTADV by default for backward compatibility. - Configurations in ipv6_prefix_IF should be recognized even if there is no ifconfig_IF_ipv6. - DAD wait should be performed at once, not on a per-interface basis, if possible. This fixes an issue that a system with a lot of IPv6-capable interfaces takes too long for booting. MFC after: 1 week Modified: head/etc/network.subr head/etc/rc.d/netif Modified: head/etc/network.subr ============================================================================== --- head/etc/network.subr Sun Jan 22 10:41:58 2012 (r230452) +++ head/etc/network.subr Sun Jan 22 10:57:32 2012 (r230453) @@ -109,8 +109,10 @@ ifconfig_up() # backward compatibility: $ipv6_enable case $ipv6_enable in [Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1) - _ipv6_opts="${_ipv6_opts} accept_rtadv" - ;; + if ! checkyesno ipv6_gateway_enable; then + _ipv6_opts="${_ipv6_opts} accept_rtadv" + fi + ;; esac case $ipv6_cpe_wanif in @@ -139,6 +141,14 @@ ifconfig_up() _cfg=0 fi + # $ipv6_prefix_IF will be handled in + # ipv6_prefix_hostid_addr_common(). + ifconfig_args=`get_if_var $1 ipv6_prefix_IF` + if [ -n "${ifconfig_args}" ]; then + ifconfig $1 inet6 -ifdisabled + _cfg=0 + fi + # backward compatibility: $ipv6_ifconfig_IF ifconfig_args=`get_if_var $1 ipv6_ifconfig_IF` if [ -n "${ifconfig_args}" ]; then @@ -444,6 +454,12 @@ ipv6if() return 0 fi + # True if $ipv6_prefix_IF is defined. + _tmpargs=`get_if_var $_if ipv6_prefix_IF` + if [ -n "${_tmpargs}" ]; then + return 0 + fi + # backward compatibility: True if $ipv6_ifconfig_IF is defined. _tmpargs=`get_if_var $_if ipv6_ifconfig_IF` if [ -n "${_tmpargs}" ]; then @@ -559,10 +575,6 @@ ipv6_up() ipv6_prefix_hostid_addr_common ${_if} alias && _ret=0 ipv6_accept_rtadv_up ${_if} && _ret=0 - # wait for DAD - sleep `${SYSCTL_N} net.inet6.ip6.dad_count` - sleep 1 - return $_ret } Modified: head/etc/rc.d/netif ============================================================================== --- head/etc/rc.d/netif Sun Jan 22 10:41:58 2012 (r230452) +++ head/etc/rc.d/netif Sun Jan 22 10:57:32 2012 (r230453) @@ -123,16 +123,26 @@ network_common() _cooked_list="`list_net_interfaces`" fi + _dadwait= _fail= _ok= for ifn in ${_cooked_list}; do if ${_func} ${ifn} $2; then _ok="${_ok} ${ifn}" + if ipv6if ${ifn}; then + _dadwait=1 + fi else _fail="${_fail} ${ifn}" fi done + # inet6 address configuration needs sleep for DAD. + if [ -n "${_dadwait}" ]; then + sleep `${SYSCTL_N} net.inet6.ip6.dad_count` + sleep 1 + fi + _str= if [ -n "${_ok}" ]; then case ${_func} in From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 10:58:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 10A34106564A; Sun, 22 Jan 2012 10:58:18 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3A5A8FC1A; Sun, 22 Jan 2012 10:58:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MAwHYJ072888; Sun, 22 Jan 2012 10:58:17 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MAwHXx072886; Sun, 22 Jan 2012 10:58:17 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201221058.q0MAwHXx072886@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 22 Jan 2012 10:58:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230454 - head/sys/cddl/compat/opensolaris/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 10:58:18 -0000 Author: pjd Date: Sun Jan 22 10:58:17 2012 New Revision: 230454 URL: http://svn.freebsd.org/changeset/base/230454 Log: Use provided name when allocating ksid domain. It isn't really used on FreeBSD, but should fix a panic when pool is imported from another OS that is using this. MFC after: 1 week Modified: head/sys/cddl/compat/opensolaris/sys/sid.h Modified: head/sys/cddl/compat/opensolaris/sys/sid.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/sid.h Sun Jan 22 10:57:32 2012 (r230453) +++ head/sys/cddl/compat/opensolaris/sys/sid.h Sun Jan 22 10:58:17 2012 (r230454) @@ -30,7 +30,7 @@ #define _OPENSOLARIS_SYS_SID_H_ typedef struct ksiddomain { - char kd_name[16]; /* Domain part of SID */ + char kd_name[1]; /* Domain part of SID */ } ksiddomain_t; typedef void ksid_t; @@ -39,8 +39,8 @@ ksid_lookupdomain(const char *domain) { ksiddomain_t *kd; - kd = kmem_alloc(sizeof(*kd), KM_SLEEP); - strlcpy(kd->kd_name, "FreeBSD", sizeof(kd->kd_name)); + kd = kmem_alloc(sizeof(*kd) + strlen(domain), KM_SLEEP); + strcpy(kd->kd_name, domain); return (kd); } From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 11:01:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13346106566C; Sun, 22 Jan 2012 11:01:37 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 020B68FC15; Sun, 22 Jan 2012 11:01:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MB1aX0073049; Sun, 22 Jan 2012 11:01:36 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MB1aHC073046; Sun, 22 Jan 2012 11:01:36 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201221101.q0MB1aHC073046@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 22 Jan 2012 11:01:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230455 - in head/sys: arm/arm kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 11:01:37 -0000 Author: pjd Date: Sun Jan 22 11:01:36 2012 New Revision: 230455 URL: http://svn.freebsd.org/changeset/base/230455 Log: TDF_* flags should be used with td_flags field and TDP_* flags should be used with td_pflags field. Correct two places where it was not the case. Discussed with: kib MFC after: 1 week Modified: head/sys/arm/arm/machdep.c head/sys/kern/init_main.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sun Jan 22 10:58:17 2012 (r230454) +++ head/sys/arm/arm/machdep.c Sun Jan 22 11:01:36 2012 (r230455) @@ -137,7 +137,7 @@ sendsig(catcher, ksi, mask) catcher, sig); /* Allocate and validate space for the signal handler context. */ - if ((td->td_flags & TDP_ALTSTACK) != 0 && !(onstack) && + if ((td->td_pflags & TDP_ALTSTACK) != 0 && !(onstack) && SIGISMEMBER(psp->ps_sigonstack, sig)) { fp = (struct sigframe *)(td->td_sigstk.ss_sp + td->td_sigstk.ss_size); Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Sun Jan 22 10:58:17 2012 (r230454) +++ head/sys/kern/init_main.c Sun Jan 22 11:01:36 2012 (r230455) @@ -467,7 +467,8 @@ proc0_init(void *dummy __unused) td->td_priority = PVM; td->td_base_pri = PVM; td->td_oncpu = 0; - td->td_flags = TDF_INMEM|TDP_KTHREAD; + td->td_flags = TDF_INMEM; + td->td_pflags = TDP_KTHREAD; td->td_cpuset = cpuset_thread0(); prison0.pr_cpuset = cpuset_ref(td->td_cpuset); p->p_peers = 0; From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 11:15:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CDE5106564A; Sun, 22 Jan 2012 11:15:49 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BA048FC18; Sun, 22 Jan 2012 11:15:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MBFntH073519; Sun, 22 Jan 2012 11:15:49 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MBFnF7073516; Sun, 22 Jan 2012 11:15:49 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201221115.q0MBFnF7073516@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 22 Jan 2012 11:15:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230456 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 11:15:49 -0000 Author: pjd Date: Sun Jan 22 11:15:48 2012 New Revision: 230456 URL: http://svn.freebsd.org/changeset/base/230456 Log: The sys/uio.h header is needed only for readv(2), preadv(2), writev(2) and pwritev(2). Document it more precisely. Reviewed by: jilles MFC after: 3 days Modified: head/lib/libc/sys/read.2 head/lib/libc/sys/write.2 Modified: head/lib/libc/sys/read.2 ============================================================================== --- head/lib/libc/sys/read.2 Sun Jan 22 11:01:36 2012 (r230455) +++ head/lib/libc/sys/read.2 Sun Jan 22 11:15:48 2012 (r230456) @@ -28,7 +28,7 @@ .\" @(#)read.2 8.4 (Berkeley) 2/26/94 .\" $FreeBSD$ .\" -.Dd October 11, 2006 +.Dd January 22, 2012 .Dt READ 2 .Os .Sh NAME @@ -41,12 +41,12 @@ .Lb libc .Sh SYNOPSIS .In sys/types.h -.In sys/uio.h .In unistd.h .Ft ssize_t .Fn read "int d" "void *buf" "size_t nbytes" .Ft ssize_t .Fn pread "int d" "void *buf" "size_t nbytes" "off_t offset" +.In sys/uio.h .Ft ssize_t .Fn readv "int d" "const struct iovec *iov" "int iovcnt" .Ft ssize_t Modified: head/lib/libc/sys/write.2 ============================================================================== --- head/lib/libc/sys/write.2 Sun Jan 22 11:01:36 2012 (r230455) +++ head/lib/libc/sys/write.2 Sun Jan 22 11:15:48 2012 (r230456) @@ -28,7 +28,7 @@ .\" @(#)write.2 8.5 (Berkeley) 4/2/94 .\" $FreeBSD$ .\" -.Dd July 7, 2005 +.Dd January 22, 2012 .Dt WRITE 2 .Os .Sh NAME @@ -41,12 +41,12 @@ .Lb libc .Sh SYNOPSIS .In sys/types.h -.In sys/uio.h .In unistd.h .Ft ssize_t .Fn write "int d" "const void *buf" "size_t nbytes" .Ft ssize_t .Fn pwrite "int d" "const void *buf" "size_t nbytes" "off_t offset" +.In sys/uio.h .Ft ssize_t .Fn writev "int d" "const struct iovec *iov" "int iovcnt" .Ft ssize_t From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 11:20:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D351106566B; Sun, 22 Jan 2012 11:20:43 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C59E8FC15; Sun, 22 Jan 2012 11:20:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MBKgSt073708; Sun, 22 Jan 2012 11:20:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MBKgBl073706; Sun, 22 Jan 2012 11:20:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201221120.q0MBKgBl073706@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sun, 22 Jan 2012 11:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230457 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 11:20:43 -0000 Author: pjd Date: Sun Jan 22 11:20:42 2012 New Revision: 230457 URL: http://svn.freebsd.org/changeset/base/230457 Log: Free memory that won't be used in child. MFC after: 1 week Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Sun Jan 22 11:15:48 2012 (r230456) +++ head/sbin/hastd/hastd.c Sun Jan 22 11:20:42 2012 (r230457) @@ -99,10 +99,10 @@ g_gate_load(void) void descriptors_cleanup(struct hast_resource *res) { - struct hast_resource *tres; + struct hast_resource *tres, *tmres; struct hastd_listen *lst; - TAILQ_FOREACH(tres, &cfg->hc_resources, hr_next) { + TAILQ_FOREACH_SAFE(tres, &cfg->hc_resources, hr_next, tmres) { if (tres == res) { PJDLOG_VERIFY(res->hr_role == HAST_ROLE_SECONDARY || (res->hr_remotein == NULL && @@ -119,13 +119,17 @@ descriptors_cleanup(struct hast_resource proto_close(tres->hr_event); if (tres->hr_conn != NULL) proto_close(tres->hr_conn); + TAILQ_REMOVE(&cfg->hc_resources, tres, hr_next); + free(tres); } if (cfg->hc_controlin != NULL) proto_close(cfg->hc_controlin); proto_close(cfg->hc_controlconn); - TAILQ_FOREACH(lst, &cfg->hc_listen, hl_next) { + while ((lst = TAILQ_FIRST(&cfg->hc_listen)) != NULL) { + TAILQ_REMOVE(&cfg->hc_listen, lst, hl_next); if (lst->hl_conn != NULL) proto_close(lst->hl_conn); + free(lst); } (void)pidfile_close(pfh); hook_fini(); From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 11:34:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E1C3106566B; Sun, 22 Jan 2012 11:34:24 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 632D98FC13; Sun, 22 Jan 2012 11:34:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MBYOow074169; Sun, 22 Jan 2012 11:34:24 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MBYOho074166; Sun, 22 Jan 2012 11:34:24 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201221134.q0MBYOho074166@svn.freebsd.org> From: Hiroki Sato Date: Sun, 22 Jan 2012 11:34:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230458 - head/usr.bin/last X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 11:34:24 -0000 Author: hrs Date: Sun Jan 22 11:34:24 2012 New Revision: 230458 URL: http://svn.freebsd.org/changeset/base/230458 Log: - Replace "wtmp" with "utx.log" because last(1) no longer reads wtmp. - A real filename is now shown in an output report when "-f file" is specified. - Add Xr lastlogin into last(1) manual page. Reviewed by: ed MFC after: 1 week Modified: head/usr.bin/last/last.1 head/usr.bin/last/last.c Modified: head/usr.bin/last/last.1 ============================================================================== --- head/usr.bin/last/last.1 Sun Jan 22 11:20:42 2012 (r230457) +++ head/usr.bin/last/last.1 Sun Jan 22 11:34:24 2012 (r230458) @@ -198,6 +198,7 @@ login data base .El .Sh SEE ALSO .Xr lastcomm 1 , +.Xr lastlogin 8 , .Xr getutxent 3 , .Xr ac 8 .Sh HISTORY Modified: head/usr.bin/last/last.c ============================================================================== --- head/usr.bin/last/last.c Sun Jan 22 11:20:42 2012 (r230457) +++ head/usr.bin/last/last.c Sun Jan 22 11:34:24 2012 (r230458) @@ -83,7 +83,7 @@ struct idtab { static const char *crmsg; /* cause of last reboot */ static time_t currentout; /* current logout value */ static long maxrec; /* records to display */ -static const char *file = NULL; /* wtmp file */ +static const char *file = NULL; /* utx.log file */ static int sflag = 0; /* show delta in seconds */ static int width = 5; /* show seconds in delta */ static int yflag; /* show year */ @@ -194,7 +194,7 @@ main(int argc, char *argv[]) /* * wtmp -- - * read through the wtmp file + * read through the utx.log file */ static void wtmp(void) @@ -229,13 +229,13 @@ wtmp(void) doentry(&buf[--amount]); tm = localtime(&t); - (void) strftime(ct, sizeof(ct), "\nwtmp begins %+\n", tm); - printf("%s", ct); + (void) strftime(ct, sizeof(ct), "%+", tm); + printf("\n%s begins %s\n", ((file == NULL) ? "utx.log" : file), ct); } /* * doentry -- - * process a single wtmp entry + * process a single utx.log entry */ static void doentry(struct utmpx *bp) From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 11:35:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90156106566C; Sun, 22 Jan 2012 11:35:50 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7508FC0C; Sun, 22 Jan 2012 11:35:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MBZotO074265; Sun, 22 Jan 2012 11:35:50 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MBZo02074263; Sun, 22 Jan 2012 11:35:50 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201221135.q0MBZo02074263@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jan 2012 11:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230459 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 11:35:50 -0000 Author: kib Date: Sun Jan 22 11:35:50 2012 New Revision: 230459 URL: http://svn.freebsd.org/changeset/base/230459 Log: Fix typo. Submitted by: John Marino MFC after: 3 days Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sun Jan 22 11:34:24 2012 (r230458) +++ head/sys/sys/elf_common.h Sun Jan 22 11:35:50 2012 (r230459) @@ -384,7 +384,7 @@ typedef struct { #define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of initialization functions. */ #define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of - terminationfunctions. */ + termination functions. */ #define DT_RUNPATH 29 /* String table offset of a null-terminated library search path string. */ #define DT_FLAGS 30 /* Object specific flag values. */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 11:58:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37F93106564A; Sun, 22 Jan 2012 11:58:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 275828FC13; Sun, 22 Jan 2012 11:58:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MBwI8R074957; Sun, 22 Jan 2012 11:58:18 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MBwIvf074955; Sun, 22 Jan 2012 11:58:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201221158.q0MBwIvf074955@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 22 Jan 2012 11:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230460 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 11:58:18 -0000 Author: kib Date: Sun Jan 22 11:58:17 2012 New Revision: 230460 URL: http://svn.freebsd.org/changeset/base/230460 Log: Clarify the implementation-defined behaviour in case of close(2) returning error. MFC after: 1 week Modified: head/lib/libc/sys/close.2 Modified: head/lib/libc/sys/close.2 ============================================================================== --- head/lib/libc/sys/close.2 Sun Jan 22 11:35:50 2012 (r230459) +++ head/lib/libc/sys/close.2 Sun Jan 22 11:58:17 2012 (r230460) @@ -28,7 +28,7 @@ .\" @(#)close.2 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd December 4, 2006 +.Dd January 22, 2012 .Dt CLOSE 2 .Os .Sh NAME @@ -118,6 +118,10 @@ The underlying object did not fit, cache The underlying object was a stream socket that was shut down by the peer before all pending data was delivered. .El +.Pp +In case of any error except +.Er EBADF , +the supplied file descriptor is deallocated and therefore is no longer valid. .Sh SEE ALSO .Xr accept 2 , .Xr closefrom 2 , From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 12:49:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 741DE106566B; Sun, 22 Jan 2012 12:49:43 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id F2EA88FC0A; Sun, 22 Jan 2012 12:49:41 +0000 (UTC) Received: by bkbc12 with SMTP id c12so2235021bkb.13 for ; Sun, 22 Jan 2012 04:49:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=0P77k/Zclchz1rZwRfXo4crCI5LFqvub1CeeF8WCRiU=; b=ju0G/fFQifYk6++6lpBhen23OkKu576seArDDzItbO0nhGWBWbVQyuV12RN/hOHn2X 6T7PubxbwRzAq1AKrmgiKpiV3QxSntKdaGrvv2rMI7W5dBroQylIWTfUQJI09q9gQ8qP PSJO4lTKqvEqG/4GsPNOxLuqtRoQHXGdEjSsk= Received: by 10.205.122.134 with SMTP id gg6mr1746211bkc.41.1327236581025; Sun, 22 Jan 2012 04:49:41 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id fg16sm20597026bkb.16.2012.01.22.04.49.38 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Jan 2012 04:49:39 -0800 (PST) From: Mikolaj Golub To: Jaakko Heinonen References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> X-Comment-To: Jaakko Heinonen Sender: Mikolaj Golub Date: Sun, 22 Jan 2012 14:49:36 +0200 In-Reply-To: <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> (Jaakko Heinonen's message of "Tue, 17 Jan 2012 19:10:31 +0200") Message-ID: <86obtvvr4v.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 12:49:43 -0000 On Tue, 17 Jan 2012 19:10:31 +0200 Jaakko Heinonen wrote: JH> On 2012-01-17, Kevin Lo wrote: >> Return EOPNOTSUPP since we only support update mounts for NFS export. >> >> @@ -150,8 +150,12 @@ tmpfs_mount(struct mount *mp) >> return (EINVAL); >> >> if (mp->mnt_flag & MNT_UPDATE) { >> + /* >> + * Only support update mounts for NFS export. >> + */ >> if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) >> return (0); >> + return (EOPNOTSUPP); >> } JH> This doesn't look correct. As long as the option list includes the JH> "export" option, all options are accepted. An example: JH> # mount -u -o ro /mnt JH> mount: tmpfs : Operation not supported JH> # mount -u -o ro,export /mnt JH> # There is no error but ro is still ignored, so this is only the issue with reporting. Note, the code for nullfs (as an example) looks the same. It could be fixed with vfs_filteropt(9), not sure if this is worth doing here though. -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 13:42:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D6E5106566C; Sun, 22 Jan 2012 13:42:28 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw03.mail.saunalahti.fi (gw03.mail.saunalahti.fi [195.197.172.111]) by mx1.freebsd.org (Postfix) with ESMTP id B4CA18FC13; Sun, 22 Jan 2012 13:42:27 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw03.mail.saunalahti.fi (Postfix) with SMTP id A5D02216A4C; Sun, 22 Jan 2012 15:42:20 +0200 (EET) Date: Sun, 22 Jan 2012 15:42:18 +0200 From: Jaakko Heinonen To: Mikolaj Golub Message-ID: <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86obtvvr4v.fsf@kopusha.home.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 13:42:28 -0000 Hi, On 2012-01-22, Mikolaj Golub wrote: > JH> # mount -u -o ro /mnt > JH> mount: tmpfs : Operation not supported > JH> # mount -u -o ro,export /mnt > JH> # > > There is no error but ro is still ignored, so this is only the issue with > reporting. Note, the code for nullfs (as an example) looks the same. This is not true. "ro" is not ignored: # mount -t tmpfs tmpfs on /mnt (tmpfs, local) # mount -u -o ro /mnt mount: tmpfs: Operation not supported # mount -t tmpfs tmpfs on /mnt (tmpfs, local) # mount -u -o ro,export /mnt # mount -t tmpfs tmpfs on /mnt (tmpfs, local, read-only) > It could be fixed with vfs_filteropt(9), not sure if this is worth doing here > though. The problem with vfs_filteropt(9) is that it will allow some additional options (global_opts list in vfs_mount.c). However those options might already work sufficiently with update mount. Here is a mostly untested patch: %%% Index: sys/fs/tmpfs/tmpfs_vfsops.c =================================================================== --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 230328) +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { NULL }; +static const char *tmpfs_updateopts[] = { + "from", "export", NULL +}; + /* --------------------------------------------------------------------- */ static int @@ -150,12 +154,10 @@ tmpfs_mount(struct mount *mp) return (EINVAL); if (mp->mnt_flag & MNT_UPDATE) { - /* - * Only support update mounts for NFS export. - */ - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) - return (0); - return (EOPNOTSUPP); + /* Only support update mounts for certain options. */ + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) + return (EOPNOTSUPP); + return (0); } vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); %%% -- Jaakko From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 13:51:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0FE0F106566B; Sun, 22 Jan 2012 13:51:21 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2F558FC17; Sun, 22 Jan 2012 13:51:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MDpKds078458; Sun, 22 Jan 2012 13:51:20 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MDpKPJ078456; Sun, 22 Jan 2012 13:51:20 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201201221351.q0MDpKPJ078456@svn.freebsd.org> From: Christian Brueffer Date: Sun, 22 Jan 2012 13:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230461 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 13:51:21 -0000 Author: brueffer Date: Sun Jan 22 13:51:20 2012 New Revision: 230461 URL: http://svn.freebsd.org/changeset/base/230461 Log: Connect VirtIO-related manpages to the build. Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Sun Jan 22 11:58:17 2012 (r230460) +++ head/share/man/man4/Makefile Sun Jan 22 13:51:20 2012 (r230461) @@ -505,11 +505,15 @@ MAN= aac.4 \ viapm.4 \ ${_viawd.4} \ vinum.4 \ + ${_virtio.4} \ + ${_virtio_balloon.4} \ + ${_virtio_blk.4} \ vkbd.4 \ vlan.4 \ vpo.4 \ vr.4 \ vte.4 \ + ${_vtnet.4} \ ${_vxge.4} \ watchdog.4 \ wb.4 \ @@ -656,6 +660,7 @@ MLINKS+=vge.4 if_vge.4 MLINKS+=vlan.4 if_vlan.4 MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 +MLINKS+=${_vtnet.4} ${_if_vtnet.4} MLINKS+=${_vxge.4} ${_if_vxge.4} MLINKS+=watchdog.4 SW_WATCHDOG.4 MLINKS+=wb.4 if_wb.4 @@ -699,6 +704,7 @@ _if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 _if_nxge.4= if_nxge.4 _if_urtw.4= if_urtw.4 +_if_vtnet.4= if_vtnet.4 _if_vxge.4= if_vxge.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 @@ -711,6 +717,10 @@ _nfsmb.4= nfsmb.4 _nve.4= nve.4 _nvram.4= nvram.4 _nxge.4= nxge.4 +_virtio.4= virtio.4 +_virtio_balloon.4=virtio_balloon.4 +_virtio_blk.4= virtio_blk.4 +_vtnet.4= vtnet.4 _vxge.4= vxge.4 _padlock.4= padlock.4 _rr232x.4= rr232x.4 From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 13:55:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72D72106566C; Sun, 22 Jan 2012 13:55:16 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 619328FC1D; Sun, 22 Jan 2012 13:55:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MDtFNX078621; Sun, 22 Jan 2012 13:55:15 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MDtFxU078619; Sun, 22 Jan 2012 13:55:15 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201221355.q0MDtFxU078619@svn.freebsd.org> From: Jaakko Heinonen Date: Sun, 22 Jan 2012 13:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230462 - stable/9/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 13:55:16 -0000 Author: jh Date: Sun Jan 22 13:55:15 2012 New Revision: 230462 URL: http://svn.freebsd.org/changeset/base/230462 Log: MFC r229692: Check the return value of sbuf_finish() in pfs_readlink() and return ENAMETOOLONG if the buffer overflowed. Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/9/sys/fs/pseudofs/pseudofs_vnops.c Sun Jan 22 13:51:20 2012 (r230461) +++ stable/9/sys/fs/pseudofs/pseudofs_vnops.c Sun Jan 22 13:55:15 2012 (r230462) @@ -891,7 +891,11 @@ pfs_readlink(struct vop_readlink_args *v PFS_RETURN (error); } - sbuf_finish(&sb); + if (sbuf_finish(&sb) != 0) { + sbuf_delete(&sb); + PFS_RETURN (ENAMETOOLONG); + } + error = uiomove_frombuf(sbuf_data(&sb), sbuf_len(&sb), uio); sbuf_delete(&sb); PFS_RETURN (error); From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 14:00:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F2F1106564A; Sun, 22 Jan 2012 14:00:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 53A208FC2A; Sun, 22 Jan 2012 14:00:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0ME0Xut078850; Sun, 22 Jan 2012 14:00:33 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ME0XK4078846; Sun, 22 Jan 2012 14:00:33 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201221400.q0ME0XK4078846@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 22 Jan 2012 14:00:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230463 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 14:00:33 -0000 Author: jilles Date: Sun Jan 22 14:00:33 2012 New Revision: 230463 URL: http://svn.freebsd.org/changeset/base/230463 Log: sh: Fix $? in the first command of a 'for'. In the first command of a 'for', $? should be the exit status of the last pipeline (command substitution in the word list or command before 'for'), not always 0. Added: head/tools/regression/bin/sh/builtins/for2.0 (contents, props changed) head/tools/regression/bin/sh/builtins/for3.0 (contents, props changed) Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Jan 22 13:55:15 2012 (r230462) +++ head/bin/sh/eval.c Sun Jan 22 14:00:33 2012 (r230463) @@ -348,6 +348,7 @@ evalfor(union node *n, int flags) union node *argp; struct strlist *sp; struct stackmark smark; + int status; setstackmark(&smark); arglist.lastp = &arglist.list; @@ -357,11 +358,12 @@ evalfor(union node *n, int flags) } *arglist.lastp = NULL; - exitstatus = 0; loopnest++; + status = 0; for (sp = arglist.list ; sp ; sp = sp->next) { setvar(n->nfor.var, sp->text, 0); evaltree(n->nfor.body, flags); + status = exitstatus; if (evalskip) { if (evalskip == SKIPCONT && --skipcount <= 0) { evalskip = 0; @@ -374,6 +376,7 @@ evalfor(union node *n, int flags) } loopnest--; popstackmark(&smark); + exitstatus = status; } Added: head/tools/regression/bin/sh/builtins/for2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/for2.0 Sun Jan 22 14:00:33 2012 (r230463) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +r=x +f() { return 42; } +f +for i in x; do + r=$? +done +[ "$r" = 42 ] Added: head/tools/regression/bin/sh/builtins/for3.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/for3.0 Sun Jan 22 14:00:33 2012 (r230463) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +r=x +f() { return 42; } +for i in x`f`; do + r=$? +done +[ "$r" = 42 ] From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 14:04:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BF55106566B; Sun, 22 Jan 2012 14:04:43 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B31C8FC15; Sun, 22 Jan 2012 14:04:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0ME4hG2079010; Sun, 22 Jan 2012 14:04:43 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ME4hbG079008; Sun, 22 Jan 2012 14:04:43 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <201201221404.q0ME4hbG079008@svn.freebsd.org> From: Stefan Farfeleder Date: Sun, 22 Jan 2012 14:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230464 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 14:04:43 -0000 Author: stefanf Date: Sun Jan 22 14:04:42 2012 New Revision: 230464 URL: http://svn.freebsd.org/changeset/base/230464 Log: Document the values for hw.snd.default_auto. Modified: head/share/man/man4/pcm.4 Modified: head/share/man/man4/pcm.4 ============================================================================== --- head/share/man/man4/pcm.4 Sun Jan 22 14:00:33 2012 (r230463) +++ head/share/man/man4/pcm.4 Sun Jan 22 14:04:42 2012 (r230464) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2011 +.Dd January 22, 2012 .Dt SOUND 4 .Os .Sh NAME @@ -324,8 +324,17 @@ for Linux applications, and deny for eve Always allow PROT_EXEC page mappings. .El .It Va hw.snd.default_auto -Enable to automatically assign default sound unit to the most recent -attached device. +Automatically assign the default sound unit. +The following values are supported (default is 1): +.Bl -tag -width 2n +.It 0 +Do not assign the default sound unit automatically. +.It 1 +Use the best available sound device based on playing and recording +capabilities of the device. +.It 2 +Use the most recently attached device. +.El .It Va hw.snd.default_unit Default sound card for systems with multiple sound cards. When using From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 15:44:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47AE5106564A; Sun, 22 Jan 2012 15:44:21 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C87F8FC13; Sun, 22 Jan 2012 15:44:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MFiLAk082240; Sun, 22 Jan 2012 15:44:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MFiKDS082236; Sun, 22 Jan 2012 15:44:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201221544.q0MFiKDS082236@svn.freebsd.org> From: Alexander Motin Date: Sun, 22 Jan 2012 15:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230465 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 15:44:21 -0000 Author: mav Date: Sun Jan 22 15:44:20 2012 New Revision: 230465 URL: http://svn.freebsd.org/changeset/base/230465 Log: Increase snd_hda(4) default maximal buffer size from 16K to 64K and maximal from 64K to 256K. We usually don't need 750 sound interrupts per second (1.3ms latency) when playing 192K/24/8 stream. 187 should be better. On usual 48K/16/2 it is just enough for hw.snd.latency=9 at hw.snd.latency_profile=1 with 23 and 6 interrupts per second. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Sun Jan 22 14:04:42 2012 (r230464) +++ head/sys/dev/sound/pci/hda/hdaa.c Sun Jan 22 15:44:20 2012 (r230465) @@ -74,17 +74,6 @@ static const struct { #define HDAA_QUIRKS_TAB_LEN \ (sizeof(hdaa_quirks_tab) / sizeof(hdaa_quirks_tab[0])) -#define HDA_BDL_MIN 2 -#define HDA_BDL_MAX 256 -#define HDA_BDL_DEFAULT HDA_BDL_MIN - -#define HDA_BLK_MIN HDA_DMA_ALIGNMENT -#define HDA_BLK_ALIGN (~(HDA_BLK_MIN - 1)) - -#define HDA_BUFSZ_MIN 4096 -#define HDA_BUFSZ_MAX 65536 -#define HDA_BUFSZ_DEFAULT 16384 - #define HDA_PARSE_MAXDEPTH 10 MALLOC_DEFINE(M_HDAA, "hdaa", "HDA Audio"); Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Sun Jan 22 14:04:42 2012 (r230464) +++ head/sys/dev/sound/pci/hda/hdac.c Sun Jan 22 15:44:20 2012 (r230465) @@ -70,17 +70,6 @@ static const struct { #define HDAC_QUIRKS_TAB_LEN \ (sizeof(hdac_quirks_tab) / sizeof(hdac_quirks_tab[0])) -#define HDA_BDL_MIN 2 -#define HDA_BDL_MAX 256 -#define HDA_BDL_DEFAULT HDA_BDL_MIN - -#define HDA_BLK_MIN HDA_DMA_ALIGNMENT -#define HDA_BLK_ALIGN (~(HDA_BLK_MIN - 1)) - -#define HDA_BUFSZ_MIN 4096 -#define HDA_BUFSZ_MAX 65536 -#define HDA_BUFSZ_DEFAULT 16384 - MALLOC_DEFINE(M_HDAC, "hdac", "HDA Controller"); static const struct { Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Sun Jan 22 14:04:42 2012 (r230464) +++ head/sys/dev/sound/pci/hda/hdac.h Sun Jan 22 15:44:20 2012 (r230465) @@ -521,6 +521,18 @@ ****************************************************************************/ #define HDA_DMA_ALIGNMENT 128 + +#define HDA_BDL_MIN 2 +#define HDA_BDL_MAX 256 +#define HDA_BDL_DEFAULT HDA_BDL_MIN + +#define HDA_BLK_MIN HDA_DMA_ALIGNMENT +#define HDA_BLK_ALIGN (~(HDA_BLK_MIN - 1)) + +#define HDA_BUFSZ_MIN (HDA_BDL_MIN * HDA_BLK_MIN) +#define HDA_BUFSZ_MAX 262144 +#define HDA_BUFSZ_DEFAULT 65536 + #define HDA_GPIO_MAX 8 #define HDA_DEV_MATCH(fl, v) ((fl) == (v) || \ From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 16:18:37 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E260106573B; Sun, 22 Jan 2012 16:18:35 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id E96568FC08; Sun, 22 Jan 2012 16:18:34 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id q0MGIX9J004905; Mon, 23 Jan 2012 00:18:33 +0800 (CST) Message-ID: <1327249113.2057.5.camel@nsl> From: Kevin Lo To: Jaakko Heinonen Date: Mon, 23 Jan 2012 00:18:33 +0800 In-Reply-To: <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.1- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Cc: Mikolaj Golub , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 16:18:37 -0000 Jaakko Heinonen wrote: > Hi, Hi Jaakko, > On 2012-01-22, Mikolaj Golub wrote: > > JH> # mount -u -o ro /mnt > > JH> mount: tmpfs : Operation not supported > > JH> # mount -u -o ro,export /mnt > > JH> # > > > > There is no error but ro is still ignored, so this is only the issue with > > reporting. Note, the code for nullfs (as an example) looks the same. > > This is not true. "ro" is not ignored: > > # mount -t tmpfs > tmpfs on /mnt (tmpfs, local) > # mount -u -o ro /mnt > mount: tmpfs: Operation not supported > # mount -t tmpfs > tmpfs on /mnt (tmpfs, local) > # mount -u -o ro,export /mnt > # mount -t tmpfs > tmpfs on /mnt (tmpfs, local, read-only) > > > It could be fixed with vfs_filteropt(9), not sure if this is worth doing here > > though. > > The problem with vfs_filteropt(9) is that it will allow some additional > options (global_opts list in vfs_mount.c). However those options might > already work sufficiently with update mount. Here is a mostly untested > patch: > > %%% > Index: sys/fs/tmpfs/tmpfs_vfsops.c > =================================================================== > --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 230328) > +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) > @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { > NULL > }; > > +static const char *tmpfs_updateopts[] = { > + "from", "export", NULL > +}; > + > /* --------------------------------------------------------------------- */ > > static int > @@ -150,12 +154,10 @@ tmpfs_mount(struct mount *mp) > return (EINVAL); > > if (mp->mnt_flag & MNT_UPDATE) { > - /* > - * Only support update mounts for NFS export. > - */ > - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) > - return (0); > - return (EOPNOTSUPP); > + /* Only support update mounts for certain options. */ > + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) > + return (EOPNOTSUPP); > + return (0); > } > > vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); > %%% Sorry for the late reply since I'm still off work for holidays (Chinese New Year). I'll report back in a few weeks. If you have a patch, please commit it, thanks a lot! Kevin From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 17:00:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60BAE1065675 for ; Sun, 22 Jan 2012 17:00:09 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) by mx1.freebsd.org (Postfix) with ESMTP id 77BAA8FC18 for ; Sun, 22 Jan 2012 17:00:08 +0000 (UTC) Received: from uucp by gromit.grondar.org with local-rmail (Exim 4.76 (FreeBSD)) (envelope-from ) id 1Rp0lz-000Hxe-5k for svn-src-all@freebsd.org; Sun, 22 Jan 2012 17:00:07 +0000 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Rp0lq-000Gly-FT; Sun, 22 Jan 2012 16:59:58 +0000 To: Andrey Chernov In-reply-to: <20120120215649.GA40016@vniz.net> References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> <20120120055823.GA28177@vniz.net> <20120120215649.GA40016@vniz.net> From: Mark Murray Date: Sun, 22 Jan 2012 16:59:55 +0000 Message-Id: Cc: svn-src-head@FreeBSD.ORG, David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 17:00:09 -0000 Andrey Chernov writes: > > The usual way round this is with a flag. Set a static, volatile > > flag, defaulting "off", and set it to "on" when the seeding has > > happened. Then arc4random() can do the right thing, depending on > > this flag. > > Ok, what about this version, is it right? libkern/arc4rand.c is not a > module but always present in the kernel, so "arc4rand_iniseed_state" > will be always accessible. > > --- dev/random/randomdev_soft.c.old 2011-09-26 07:35:48.000000000 +0400 > +++ dev/random/randomdev_soft.c 2012-01-21 01:41:37.000000000 +0400 > @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD: src/sys/dev/random/r > > #define RANDOM_FIFO_MAX 256 /* How many events to queue up */ > > +extern int arc4rand_iniseed_state; > + Should be in a header file, nad _possibly_ should be volatile. If it works without being volatile, then OK. The rest is OK. I've not tested it, so this is not a review, simply an "OK" :-) M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 17:32:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B43A4106564A; Sun, 22 Jan 2012 17:32:28 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 471A08FC13; Sun, 22 Jan 2012 17:32:27 +0000 (UTC) Received: by bkbc12 with SMTP id c12so2366809bkb.13 for ; Sun, 22 Jan 2012 09:32:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=JuSKv8RMa9ugnNiSW1NjUxBCF91ERJxw//RcFWHAf74=; b=VsLPpttUVsVwrvS1OK/09rpIyFB1H+njvtZHlhx9bLEDQyTJalQ4drW7qDZguxZpVt rTlTTPkjEmGnfQoHzkeVRpe3ian4g2gFRtOCQ57XnTxC8K6l8uYaLhpHVIdoWdVCjy5e 5DgoZyTBEqI4fdxNMNPTNi/5iarzskLYWCuYw= Received: by 10.205.128.4 with SMTP id hc4mr1957696bkc.13.1327253546362; Sun, 22 Jan 2012 09:32:26 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id d2sm22101155bky.11.2012.01.22.09.32.24 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Jan 2012 09:32:25 -0800 (PST) From: Mikolaj Golub To: Jaakko Heinonen References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> X-Comment-To: Jaakko Heinonen Sender: Mikolaj Golub Date: Sun, 22 Jan 2012 19:32:22 +0200 In-Reply-To: <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> (Jaakko Heinonen's message of "Sun, 22 Jan 2012 15:42:18 +0200") Message-ID: <86lioztzh5.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 17:32:28 -0000 On Sun, 22 Jan 2012 15:42:18 +0200 Jaakko Heinonen wrote: JH> Hi, JH> On 2012-01-22, Mikolaj Golub wrote: >> JH> # mount -u -o ro /mnt >> JH> mount: tmpfs : Operation not supported >> JH> # mount -u -o ro,export /mnt >> JH> # >> >> There is no error but ro is still ignored, so this is only the issue with >> reporting. Note, the code for nullfs (as an example) looks the same. JH> This is not true. "ro" is not ignored: JH> # mount -t tmpfs JH> tmpfs on /mnt (tmpfs, local) JH> # mount -u -o ro /mnt JH> mount: tmpfs: Operation not supported JH> # mount -t tmpfs JH> tmpfs on /mnt (tmpfs, local) JH> # mount -u -o ro,export /mnt JH> # mount -t tmpfs JH> tmpfs on /mnt (tmpfs, local, read-only) Sorry, yes I was wrong. vfs_domount_update() stores old MNT flags and applies new ones, then calls VFS_MOUNT(), and if it only fails it will restore the old flags. So nullfs has the same issue now although the bug is more difficult to expose as nullfs uses its own mount_nullfs, which currently does not support update option. Thus to trigger the bug someone has to use nmount(2). >> It could be fixed with vfs_filteropt(9), not sure if this is worth doing here >> though. JH> The problem with vfs_filteropt(9) is that it will allow some additional JH> options (global_opts list in vfs_mount.c). However those options might JH> already work sufficiently with update mount. Here is a mostly untested JH> patch: When I was looking at mount option interface it also looked for me a bit "complicated" :-), that is why I hoped we could just ignore the issue if it were just reporting an error... Also, may be we should allow remounting ro (and may be some othe options) for tmpfs? JH> %%% JH> Index: sys/fs/tmpfs/tmpfs_vfsops.c JH> =================================================================== JH> --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 230328) JH> +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) JH> @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { JH> NULL JH> }; JH> JH> +static const char *tmpfs_updateopts[] = { JH> + "from", "export", NULL JH> +}; JH> + JH> /* --------------------------------------------------------------------- */ JH> JH> static int JH> @@ -150,12 +154,10 @@ tmpfs_mount(struct mount *mp) JH> return (EINVAL); JH> JH> if (mp->mnt_flag & MNT_UPDATE) { JH> - /* JH> - * Only support update mounts for NFS export. JH> - */ JH> - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) JH> - return (0); JH> - return (EOPNOTSUPP); JH> + /* Only support update mounts for certain options. */ JH> + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) JH> + return (EOPNOTSUPP); JH> + return (0); JH> } JH> JH> vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); JH> %%% JH> -- JH> Jaakko -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 18:27:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9B41106564A; Sun, 22 Jan 2012 18:27:24 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3EB78FC13; Sun, 22 Jan 2012 18:27:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MIROJR087501; Sun, 22 Jan 2012 18:27:24 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MIRO23087499; Sun, 22 Jan 2012 18:27:24 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201201221827.q0MIRO23087499@svn.freebsd.org> From: Peter Holm Date: Sun, 22 Jan 2012 18:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230466 - stable/9/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 18:27:24 -0000 Author: pho Date: Sun Jan 22 18:27:24 2012 New Revision: 230466 URL: http://svn.freebsd.org/changeset/base/230466 Log: MFC: r228360 Move cpu_set_upcall(newtd, td) up before the first call of thread_free(newtd). This to avoid a possible page fault in cpu_thread_clean() as seen on amd64 with syscall fuzzing. Modified: stable/9/sys/kern/kern_thr.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_thr.c ============================================================================== --- stable/9/sys/kern/kern_thr.c Sun Jan 22 15:44:20 2012 (r230465) +++ stable/9/sys/kern/kern_thr.c Sun Jan 22 18:27:24 2012 (r230466) @@ -200,6 +200,8 @@ create_thread(struct thread *td, mcontex goto fail; } + cpu_set_upcall(newtd, td); + /* * Try the copyout as soon as we allocate the td so we don't * have to tear things down in a failure case below. @@ -225,8 +227,6 @@ create_thread(struct thread *td, mcontex newtd->td_proc = td->td_proc; newtd->td_ucred = crhold(td->td_ucred); - cpu_set_upcall(newtd, td); - if (ctx != NULL) { /* old way to set user context */ error = set_mcontext(newtd, ctx); if (error != 0) { From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 18:55:51 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14A3C106566B; Sun, 22 Jan 2012 18:55:51 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 52AD38FC1A; Sun, 22 Jan 2012 18:55:49 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0MItlUk012021; Sun, 22 Jan 2012 22:55:48 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0MItlnw012020; Sun, 22 Jan 2012 22:55:47 +0400 (MSK) (envelope-from ache) Date: Sun, 22 Jan 2012 22:55:46 +0400 From: Andrey Chernov To: Mark Murray Message-ID: <20120122185545.GA11874@vniz.net> Mail-Followup-To: Andrey Chernov , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> <20120120055823.GA28177@vniz.net> <20120120215649.GA40016@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 18:55:51 -0000 On Sun, Jan 22, 2012 at 04:59:55PM +0000, Mark Murray wrote: > Andrey Chernov writes: > > > The usual way round this is with a flag. Set a static, volatile > > > flag, defaulting "off", and set it to "on" when the seeding has > > > happened. Then arc4random() can do the right thing, depending on > > > this flag. > > > > Ok, what about this version, is it right? libkern/arc4rand.c is not a > > module but always present in the kernel, so "arc4rand_iniseed_state" > > will be always accessible. > > > > --- dev/random/randomdev_soft.c.old 2011-09-26 07:35:48.000000000 +0400 > > +++ dev/random/randomdev_soft.c 2012-01-21 01:41:37.000000000 +0400 > > @@ -55,6 +55,8 @@ __FBSDID("$FreeBSD: src/sys/dev/random/r > > > > #define RANDOM_FIFO_MAX 256 /* How many events to queue up */ > > > > +extern int arc4rand_iniseed_state; > > + > > Should be in a header file, nad _possibly_ should be volatile. If it > works without being volatile, then OK. It was preliminary patch just to confirm/deny my understanding of your idea. I'll put it into header. In the final version I also plan to move that lines + if (arc4rand_iniseed_state == 1) + arc4rand_iniseed_state = -1; into arc4_randomstir() where they will be protected with mutex lock, so volatile will be not needed. It will be more logical, because other reseeding conditions are resetted there too. > The rest is OK. I've not tested it, so this is not a review, simply an > "OK" :-) Thanx for review! I'll send final version to this thread a bit later when I'll find more free time. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 20:25:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83F26106566B; Sun, 22 Jan 2012 20:25:00 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C96B8FC0C; Sun, 22 Jan 2012 20:25:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MKP0hQ091455; Sun, 22 Jan 2012 20:25:00 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MKP0Ix091451; Sun, 22 Jan 2012 20:25:00 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201222025.q0MKP0Ix091451@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 22 Jan 2012 20:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230470 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 20:25:00 -0000 Author: trociny Date: Sun Jan 22 20:25:00 2012 New Revision: 230470 URL: http://svn.freebsd.org/changeset/base/230470 Log: Change kern.proc.rlimit sysctl to: - retrive only one, specified limit for a process, not the whole array, as it was previously (the sysctl has been added recently and has not been backported to stable yet, so this change is ok); - allow to set a resource limit for another process. Submitted by: Andrey Zonov Discussed with: kib Reviewed by: kib MFC after: 2 weeks Modified: head/sys/kern/kern_proc.c head/sys/kern/kern_resource.c head/sys/sys/resourcevar.h Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Sun Jan 22 19:49:43 2012 (r230469) +++ head/sys/kern/kern_proc.c Sun Jan 22 20:25:00 2012 (r230470) @@ -2372,7 +2372,7 @@ sysctl_kern_proc_groups(SYSCTL_HANDLER_A } /* - * This sysctl allows a process to retrieve the resource limits for + * This sysctl allows a process to retrieve or/and set the resource limit for * another process. */ static int @@ -2380,30 +2380,53 @@ sysctl_kern_proc_rlimit(SYSCTL_HANDLER_A { int *name = (int *)arg1; u_int namelen = arg2; - struct plimit *limp; + struct rlimit rlim; struct proc *p; - int error = 0; + u_int which; + int flags, error; - if (namelen != 1) + if (namelen != 2) + return (EINVAL); + + which = (u_int)name[1]; + if (which >= RLIM_NLIMITS) return (EINVAL); - error = pget((pid_t)name[0], PGET_CANSEE, &p); + if (req->newptr != NULL && req->newlen != sizeof(rlim)) + return (EINVAL); + + flags = PGET_HOLD | PGET_NOTWEXIT; + if (req->newptr != NULL) + flags |= PGET_CANDEBUG; + else + flags |= PGET_CANSEE; + error = pget((pid_t)name[0], flags, &p); if (error != 0) return (error); + /* - * Check the request size. We alow sizes smaller rlimit array for - * backward binary compatibility: the number of resource limits may - * grow. + * Retrieve limit. */ - if (sizeof(limp->pl_rlimit) < req->oldlen) { + if (req->oldptr != NULL) { + PROC_LOCK(p); + lim_rlimit(p, which, &rlim); PROC_UNLOCK(p); - return (EINVAL); } + error = SYSCTL_OUT(req, &rlim, sizeof(rlim)); + if (error != 0) + goto errout; - limp = lim_hold(p->p_limit); - PROC_UNLOCK(p); - error = SYSCTL_OUT(req, limp->pl_rlimit, req->oldlen); - lim_free(limp); + /* + * Set limit. + */ + if (req->newptr != NULL) { + error = SYSCTL_IN(req, &rlim, sizeof(rlim)); + if (error == 0) + error = kern_proc_setrlimit(curthread, p, which, &rlim); + } + +errout: + PRELE(p); return (error); } @@ -2544,8 +2567,9 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC static SYSCTL_NODE(_kern_proc, KERN_PROC_GROUPS, groups, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc_groups, "Process groups"); -static SYSCTL_NODE(_kern_proc, KERN_PROC_RLIMIT, rlimit, CTLFLAG_RD | - CTLFLAG_MPSAFE, sysctl_kern_proc_rlimit, "Process resource limits"); +static SYSCTL_NODE(_kern_proc, KERN_PROC_RLIMIT, rlimit, CTLFLAG_RW | + CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_rlimit, + "Process resource limits"); static SYSCTL_NODE(_kern_proc, KERN_PROC_PS_STRINGS, ps_strings, CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, Modified: head/sys/kern/kern_resource.c ============================================================================== --- head/sys/kern/kern_resource.c Sun Jan 22 19:49:43 2012 (r230469) +++ head/sys/kern/kern_resource.c Sun Jan 22 20:25:00 2012 (r230470) @@ -649,13 +649,17 @@ lim_cb(void *arg) } int -kern_setrlimit(td, which, limp) - struct thread *td; - u_int which; - struct rlimit *limp; +kern_setrlimit(struct thread *td, u_int which, struct rlimit *limp) +{ + + return (kern_proc_setrlimit(td, td->td_proc, which, limp)); +} + +int +kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which, + struct rlimit *limp) { struct plimit *newlim, *oldlim; - struct proc *p; register struct rlimit *alimp; struct rlimit oldssiz; int error; @@ -672,7 +676,6 @@ kern_setrlimit(td, which, limp) limp->rlim_max = RLIM_INFINITY; oldssiz.rlim_cur = 0; - p = td->td_proc; newlim = lim_alloc(); PROC_LOCK(p); oldlim = p->p_limit; Modified: head/sys/sys/resourcevar.h ============================================================================== --- head/sys/sys/resourcevar.h Sun Jan 22 19:49:43 2012 (r230469) +++ head/sys/sys/resourcevar.h Sun Jan 22 20:25:00 2012 (r230470) @@ -120,6 +120,8 @@ int chgsbsize(struct uidinfo *uip, u_in rlim_t maxval); int chgptscnt(struct uidinfo *uip, int diff, rlim_t maxval); int fuswintr(void *base); +int kern_proc_setrlimit(struct thread *td, struct proc *p, u_int which, + struct rlimit *limp); struct plimit *lim_alloc(void); void lim_copy(struct plimit *dst, struct plimit *src); From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 20:26:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFFAA1065676; Sun, 22 Jan 2012 20:26:46 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB3A38FC0C; Sun, 22 Jan 2012 20:26:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MKQkew091548; Sun, 22 Jan 2012 20:26:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MKQkqu091546; Sun, 22 Jan 2012 20:26:46 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201222026.q0MKQkqu091546@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 22 Jan 2012 20:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230471 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 20:26:46 -0000 Author: trociny Date: Sun Jan 22 20:26:46 2012 New Revision: 230471 URL: http://svn.freebsd.org/changeset/base/230471 Log: Make procstat -l to work with the new version of kern.proc.rlimit. Submitted by: Andrey Zonov MFC after: 2 weeks Modified: head/usr.bin/procstat/procstat_rlimit.c Modified: head/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- head/usr.bin/procstat/procstat_rlimit.c Sun Jan 22 20:25:00 2012 (r230470) +++ head/usr.bin/procstat/procstat_rlimit.c Sun Jan 22 20:26:46 2012 (r230471) @@ -90,27 +90,28 @@ const char *humanize_rlimit(int indx, rl void procstat_rlimit(struct kinfo_proc *kipp) { - int error, i, name[4]; + int error, i, name[5]; size_t len; if (!hflag) { printf("%5s %-16s %-16s %16s %16s\n", "PID", "COMM", "RLIMIT", "SOFT ", "HARD "); } + len = sizeof(struct rlimit); name[0] = CTL_KERN; name[1] = KERN_PROC; name[2] = KERN_PROC_RLIMIT; name[3] = kipp->ki_pid; - len = sizeof(rlimit); - error = sysctl(name, 4, rlimit, &len, NULL, 0); - if (error < 0 && errno != ESRCH) { - warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid); - return; - } - if (error < 0 || len != sizeof(rlimit)) - return; - for (i = 0; i < RLIM_NLIMITS; i++) { + name[4] = i; + error = sysctl(name, 5, &rlimit[i], &len, NULL, 0); + if (error < 0 && errno != ESRCH) { + warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid); + return; + } + if (error < 0 || len != sizeof(struct rlimit)) + return; + printf("%5d %-16s %-16s ", kipp->ki_pid, kipp->ki_comm, rlimit_param[i].name); printf("%16s ", humanize_rlimit(i, rlimit[i].rlim_cur)); From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 20:31:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C02C1065674; Sun, 22 Jan 2012 20:31:53 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 748018FC08; Sun, 22 Jan 2012 20:31:52 +0000 (UTC) Received: by bkbc12 with SMTP id c12so2462170bkb.13 for ; Sun, 22 Jan 2012 12:31:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=bSMuAPSOc40hG5o35WDRUJK5PZL1rgxHaxyrqkL4r9o=; b=cZmXN7CcFT08pQ866TxcTTIvPTsEKJ1CnXcOl1I4zSeThU2F6MuTXp9rOeKsigq52u e9R3rGfyrgQxGUmGCQ6o2FcOWsRzejIzuBDBKRlaVY5jzuGnBh7zjmE0SEd+kODojDgf tvvQh6R5Qmo8Snank0z59LIRdLtydM3S9QjD4= Received: by 10.204.129.18 with SMTP id m18mr2089013bks.115.1327264310256; Sun, 22 Jan 2012 12:31:50 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id fg16sm22991338bkb.16.2012.01.22.12.31.47 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 22 Jan 2012 12:31:49 -0800 (PST) From: Mikolaj Golub To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201201222025.q0MKP0Ix091451@svn.freebsd.org> X-Comment-To: Mikolaj Golub Sender: Mikolaj Golub Date: Sun, 22 Jan 2012 22:31:45 +0200 In-Reply-To: <201201222025.q0MKP0Ix091451@svn.freebsd.org> (Mikolaj Golub's message of "Sun, 22 Jan 2012 20:25:00 +0000 (UTC)") Message-ID: <86d3abtr66.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: Andrey Zonov , Kostik Belousov Subject: Re: svn commit: r230470 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 20:31:53 -0000 --=-=-= On Sun, 22 Jan 2012 20:25:00 +0000 (UTC) Mikolaj Golub wrote: MG> Author: trociny MG> Date: Sun Jan 22 20:25:00 2012 MG> New Revision: 230470 MG> URL: http://svn.freebsd.org/changeset/base/230470 MG> Log: MG> Change kern.proc.rlimit sysctl to: MG> MG> - retrive only one, specified limit for a process, not the whole MG> array, as it was previously (the sysctl has been added recently and MG> has not been backported to stable yet, so this change is ok); MG> MG> - allow to set a resource limit for another process. MG> MG> Submitted by: Andrey Zonov MG> Discussed with: kib MG> Reviewed by: kib MG> MFC after: 2 weeks Andrey has also been working on the patch for limits(1), which allows to view/set limits for another process: - If '-P ' without the list of limits is specified it returns the limits for this process. - If '-P ' with the list of limits is specified it changes these limits for the process. - If '-P ' with list of limits is specified but also -a option is present it outputs all limits for the process updated by the command line setting. So if one want, for example, to set for a current shell all limits as they are for a process , but core dump is disabled, it could run: eval `limits -P -aBec 0` The latest version of the patch is attached. I am going to commit it if there are no objections or suggestions. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=limits.patch Index: usr.bin/limits/limits.1 =================================================================== --- usr.bin/limits/limits.1 (revision 230394) +++ usr.bin/limits/limits.1 (working copy) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2011 +.Dd January 18, 2011 .Dt LIMITS 1 .Os .Sh NAME @@ -28,11 +28,13 @@ .Sh SYNOPSIS .Nm .Op Fl C Ar class | Fl U Ar user +.Op Fl P Ar pid .Op Fl SHB .Op Fl ea .Op Fl bcdflmnstuvpw Op Ar val .Nm .Op Fl C Ar class | Fl U Ar user +.Op Fl P Ar pid .Op Fl SHB .Op Fl bcdflmnstuvpw Op Ar val .Op Fl E @@ -143,6 +145,9 @@ for the class are used, if it exists, or the .Dq Li root class if the user is a superuser account. +.It Fl P Ar pid +Select or set limits for the process identified by the +.Ar pid . .It Fl S Select display or setting of .Dq soft Index: usr.bin/limits/limits.c =================================================================== --- usr.bin/limits/limits.c (revision 230394) +++ usr.bin/limits/limits.c (working copy) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -249,6 +250,8 @@ static void usage(void); static int getshelltype(void); static void print_limit(rlim_t limit, unsigned divisor, const char *inf, const char *pfx, const char *sfx, const char *which); +static void getrlimit_proc(pid_t pid, int resource, struct rlimit *rlp); +static void setrlimit_proc(pid_t pid, int resource, const struct rlimit *rlp); extern char **environ; static const char rcs_string[] = RCS_STRING; @@ -262,24 +265,24 @@ main(int argc, char *argv[]) int rcswhich, shelltype; int i, num_limits = 0; int ch, doeval = 0, doall = 0; - int rtrn; + int rtrn, setproc; login_cap_t * lc = NULL; enum { ANY=0, SOFT=1, HARD=2, BOTH=3, DISPLAYONLY=4 } type = ANY; enum { RCSUNKNOWN=0, RCSSET=1, RCSSEL=2 } todo = RCSUNKNOWN; int which_limits[RLIM_NLIMITS]; rlim_t set_limits[RLIM_NLIMITS]; struct rlimit limits[RLIM_NLIMITS]; + pid_t pid; /* init resource tables */ for (i = 0; i < RLIM_NLIMITS; i++) { which_limits[i] = 0; /* Don't set/display any */ set_limits[i] = RLIM_INFINITY; - /* Get current resource values */ - getrlimit(i, &limits[i]); } + pid = -1; optarg = NULL; - while ((ch = getopt(argc, argv, ":EeC:U:BSHab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) { + while ((ch = getopt(argc, argv, ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) { switch(ch) { case 'a': doall = 1; @@ -312,6 +315,12 @@ main(int argc, char *argv[]) case 'B': type = SOFT|HARD; break; + case 'P': + if (!isdigit(*optarg) || (pid = atoi(optarg)) < 0) { + warnx("invalid pid `%s'", optarg); + usage(); + } + break; default: case ':': /* Without arg */ if ((p = strchr(rcs_string, optopt)) != NULL) { @@ -335,6 +344,30 @@ main(int argc, char *argv[]) optarg = NULL; } + if (pid != -1) { + if (cls != NULL) { + warnx("-C cannot be used with -P option"); + usage(); + } + if (pwd != NULL) { + warnx("-U cannot be used with -P option"); + usage(); + } + } + + /* Get current resource values */ + setproc = 0; + for (i = 0; i < RLIM_NLIMITS; i++) { + if (pid == -1) { + getrlimit(i, &limits[i]); + } else if (doall || num_limits == 0) { + getrlimit_proc(pid, i, &limits[i]); + } else if (which_limits[i] != 0) { + getrlimit_proc(pid, i, &limits[i]); + setproc = 1; + } + } + /* If user was specified, get class from that */ if (pwd != NULL) lc = login_getpwclass(pwd); @@ -414,6 +447,10 @@ main(int argc, char *argv[]) warnx("-e cannot be used with `cmd' option"); usage(); } + if (pid != -1) { + warnx("-P cannot be used with `cmd' option"); + usage(); + } login_close(lc); @@ -440,6 +477,14 @@ main(int argc, char *argv[]) err(1, "%s", *argv); } + if (setproc) { + for (rcswhich = 0; rcswhich < RLIM_NLIMITS; rcswhich++) { + if (which_limits[rcswhich] != 0) + setrlimit_proc(pid, rcswhich, &limits[rcswhich]); + } + exit(EXIT_SUCCESS); + } + shelltype = doeval ? getshelltype() : SH_NONE; if (type == ANY) /* Default to soft limits */ @@ -493,7 +538,8 @@ static void usage(void) { (void)fprintf(stderr, -"usage: limits [-C class|-U user] [-eaSHBE] [-bcdflmnstuvpw [val]] [[name=val ...] cmd]\n"); + "usage: limits [-C class|-U user|-P pid] [-eaSHBE] " + "[-bcdflmnstuvpw [val]] [[name=val ...] cmd]\n"); exit(EXIT_FAILURE); } @@ -677,3 +723,38 @@ getshelltype(void) return SH_SH; } +static void +getrlimit_proc(pid_t pid, int resource, struct rlimit *rlp) +{ + int error; + int name[5]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = pid; + name[4] = resource; + len = sizeof(*rlp); + error = sysctl(name, 5, rlp, &len, NULL, 0); + if (error == -1) + err(EXIT_FAILURE, "sysctl: kern.proc.rlimit: %d", pid); + if (len != sizeof(*rlp)) + errx(EXIT_FAILURE, "sysctl() returns wrong size"); +} + +static void +setrlimit_proc(pid_t pid, int resource, const struct rlimit *rlp) +{ + int error; + int name[5]; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = pid; + name[4] = resource; + error = sysctl(name, 5, NULL, 0, rlp, sizeof(*rlp)); + if (error == -1) + err(EXIT_FAILURE, "sysctl: kern.proc.rlimit: %d", pid); +} --=-=-=-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 21:25:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F0E77106564A; Sun, 22 Jan 2012 21:25:47 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D14F98FC08; Sun, 22 Jan 2012 21:25:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0MLPlYt093462; Sun, 22 Jan 2012 21:25:47 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0MLPlDg093459; Sun, 22 Jan 2012 21:25:47 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201201222125.q0MLPlDg093459@svn.freebsd.org> From: Gavin Atkinson Date: Sun, 22 Jan 2012 21:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230472 - in stable/8/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 21:25:48 -0000 Author: gavin Date: Sun Jan 22 21:25:47 2012 New Revision: 230472 URL: http://svn.freebsd.org/changeset/base/230472 Log: Merge r229085 from head: Default to not performing the early-boot memory tests when we detect we are booting inside a VM. There are three reasons to disable this: o It causes the VM host to believe that all the tested pages or RAM are in use. This in turn may force the host to page out pages of RAM belonging to other VMs, or otherwise cause problems with fair resource sharing on the VM cluster. o It adds significant time to the boot process (around 1 second/Gig in testing) o It is unnecessary - the host should have already verified that the memory is functional etc. Note that this simply changes the default when in a VM - it can still be overridden using the hw.memtest.tests tunable. Early MFC requested by: bz Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/i386/i386/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Sun Jan 22 20:26:46 2012 (r230471) +++ stable/8/sys/amd64/amd64/machdep.c Sun Jan 22 21:25:47 2012 (r230472) @@ -1351,10 +1351,13 @@ getmemsize(caddr_t kmdp, u_int64_t first Maxmem = atop(physmem_tunable); /* - * By default keep the memtest enabled. Use a general name so that + * By default enable the memory test on real hardware, and disable + * it if we appear to be running in a VM. This avoids touching all + * pages unnecessarily, which doesn't matter on real hardware but is + * bad for shared VM hosts. Use a general name so that * one could eventually do more with the code than just disable it. */ - memtest = 1; + memtest = (vm_guest > VM_GUEST_NO) ? 0 : 1; TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest); /* Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Sun Jan 22 20:26:46 2012 (r230471) +++ stable/8/sys/i386/i386/machdep.c Sun Jan 22 21:25:47 2012 (r230472) @@ -2302,10 +2302,13 @@ physmap_done: Maxmem = atop(physmap[physmap_idx + 1]); /* - * By default keep the memtest enabled. Use a general name so that + * By default enable the memory test on real hardware, and disable + * it if we appear to be running in a VM. This avoids touching all + * pages unnecessarily, which doesn't matter on real hardware but is + * bad for shared VM hosts. Use a general name so that * one could eventually do more with the code than just disable it. */ - memtest = 1; + memtest = (vm_guest > VM_GUEST_NO) ? 0 : 1; TUNABLE_ULONG_FETCH("hw.memtest.tests", &memtest); if (atop(physmap[physmap_idx + 1]) != Maxmem && From owner-svn-src-all@FreeBSD.ORG Sun Jan 22 21:50:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 795E41065675 for ; Sun, 22 Jan 2012 21:50:32 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [93.89.92.32]) by mx1.freebsd.org (Postfix) with ESMTP id 360238FC1F for ; Sun, 22 Jan 2012 21:50:31 +0000 (UTC) Received: from uucp by gromit.grondar.org with local-rmail (Exim 4.76 (FreeBSD)) (envelope-from ) id 1Rp5Dm-000ILe-3d for svn-src-all@freebsd.org; Sun, 22 Jan 2012 21:45:06 +0000 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Rp5Bn-000HBl-2P; Sun, 22 Jan 2012 21:43:03 +0000 To: Andrey Chernov In-reply-to: <20120122185545.GA11874@vniz.net> References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> <20120120055823.GA28177@vniz.net> <20120120215649.GA40016@vniz.net> <20120122185545.GA11874@vniz.net> From: Mark Murray Date: Sun, 22 Jan 2012 21:43:02 +0000 Message-Id: Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 21:50:32 -0000 Andrey Chernov writes: > > Should be in a header file, nad _possibly_ should be volatile. If it > > works without being volatile, then OK. > > It was preliminary patch just to confirm/deny my understanding of your > idea. Ah, OK - in which case you got the idea correctly! > I'll put it into header. Cool. > In the final version I also plan to move that lines > + if (arc4rand_iniseed_state == 1) > + arc4rand_iniseed_state = -1; > into arc4_randomstir() where they will be protected with mutex lock, so > volatile will be not needed. It will be more logical, because other > reseeding conditions are resetted there too. Great. > > The rest is OK. I've not tested it, so this is not a review, simply an > > "OK" :-) > > Thanx for review! I'll send final version to this thread a bit > later when I'll find more free time. No problem. M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 04:30:09 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A6B0106566C; Mon, 23 Jan 2012 04:30:09 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id F05038FC0C; Mon, 23 Jan 2012 04:30:07 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0N4Ts50002922; Mon, 23 Jan 2012 13:30:04 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0N4Tm1X061049; Mon, 23 Jan 2012 13:29:50 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Mon, 23 Jan 2012 13:28:40 +0900 (JST) Message-Id: <20120123.132840.618925004528110765.hrs@allbsd.org> To: eadler@FreeBSD.org From: Hiroki Sato In-Reply-To: References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Mon_Jan_23_13_28_40_2012_675)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Mon, 23 Jan 2012 13:30:05 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 04:30:09 -0000 ----Security_Multipart(Mon_Jan_23_13_28_40_2012_675)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Eitan Adler wrote in : ea> I was was unaware this code was contributed. I just looked at the ea> NetBSD version and I don't think it suffers from the same problem - ea> the loop appears to be used later. If that is because of some other Just checking, but the variables dot and semi are not used even in the NetBSD version since the initial import (in the NetBSD tree). What is "the same problem" you mentioned here? The problem I pointed out is just "removing the useless loop would be good but leaving the related comments is bad"... ea> bug fix which could be upstreamed that would be great. On the other ea> hand I would like to continue with my goal of making the non-contrib ea> world compilable with CC=gcc46. ea> ea> Should I revert this commit? I don't think it is needed. The makefs utility is a special case because it will probably diverge from the upstream to support FreeBSD-specific feature in the future (this is one of the reasons why it is not in contrib/). It didn't happen so far, however. By the way, does gcc46 no longer allow unused code? Generally speaking, I think it is enough to clean up unused code only when we actually change the code. -- Hiroki ----Security_Multipart(Mon_Jan_23_13_28_40_2012_675)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8c4fgACgkQTyzT2CeTzy1+pwCfWJuGJplAJB335qdB4fMrYY1Q clcAoNVXKwsVsjnHVVk0uxVcLDXtJ6OV =Qzz4 -----END PGP SIGNATURE----- ----Security_Multipart(Mon_Jan_23_13_28_40_2012_675)---- From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 06:36:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BFCD106564A; Mon, 23 Jan 2012 06:36:42 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F75C8FC14; Mon, 23 Jan 2012 06:36:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0N6agVm011155; Mon, 23 Jan 2012 06:36:42 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0N6af1Z011147; Mon, 23 Jan 2012 06:36:41 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201201230636.q0N6af1Z011147@svn.freebsd.org> From: David Schultz Date: Mon, 23 Jan 2012 06:36:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230475 - in head/sys: amd64/include arm/include i386/include ia64/include mips/include powerpc/include sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 06:36:42 -0000 Author: das Date: Mon Jan 23 06:36:41 2012 New Revision: 230475 URL: http://svn.freebsd.org/changeset/base/230475 Log: Add C11 macros describing subnormal numbers to float.h. Reviewed by: bde Modified: head/sys/amd64/include/float.h head/sys/arm/include/float.h head/sys/i386/include/float.h head/sys/ia64/include/float.h head/sys/mips/include/float.h head/sys/powerpc/include/float.h head/sys/sparc64/include/float.h Modified: head/sys/amd64/include/float.h ============================================================================== --- head/sys/amd64/include/float.h Mon Jan 23 04:38:31 2012 (r230474) +++ head/sys/amd64/include/float.h Mon Jan 23 06:36:41 2012 (r230475) @@ -55,6 +55,11 @@ __END_DECLS #define FLT_MAX_EXP 128 /* emax */ #define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ #define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ +#if __ISO_C_VISIBLE >= 2011 +#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ +#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ +#define FLT_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define DBL_MANT_DIG 53 #define DBL_EPSILON 2.2204460492503131E-16 @@ -65,6 +70,11 @@ __END_DECLS #define DBL_MAX_EXP 1024 #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 +#if __ISO_C_VISIBLE >= 2011 +#define DBL_TRUE_MIN 4.9406564584124654E-324 +#define DBL_DECIMAL_DIG 17 +#define DBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define LDBL_MANT_DIG 64 #define LDBL_EPSILON 1.0842021724855044340E-19L @@ -75,4 +85,10 @@ __END_DECLS #define LDBL_MAX_EXP 16384 #define LDBL_MAX 1.1897314953572317650E+4932L #define LDBL_MAX_10_EXP 4932 +#if __ISO_C_VISIBLE >= 2011 +#define LDBL_TRUE_MIN 3.6451995318824746025E-4951L +#define LDBL_DECIMAL_DIG 21 +#define LDBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ + #endif /* _MACHINE_FLOAT_H_ */ Modified: head/sys/arm/include/float.h ============================================================================== --- head/sys/arm/include/float.h Mon Jan 23 04:38:31 2012 (r230474) +++ head/sys/arm/include/float.h Mon Jan 23 06:36:41 2012 (r230475) @@ -63,6 +63,11 @@ __END_DECLS #define FLT_MAX_EXP 128 /* emax */ #define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ #define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ +#if __ISO_C_VISIBLE >= 2011 +#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ +#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ +#define FLT_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define DBL_MANT_DIG 53 #define DBL_EPSILON 2.2204460492503131E-16 @@ -73,6 +78,11 @@ __END_DECLS #define DBL_MAX_EXP 1024 #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 +#if __ISO_C_VISIBLE >= 2011 +#define DBL_TRUE_MIN 4.9406564584124654E-324 +#define DBL_DECIMAL_DIG 17 +#define DBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define LDBL_MANT_DIG DBL_MANT_DIG #define LDBL_EPSILON ((long double)DBL_EPSILON) @@ -83,4 +93,10 @@ __END_DECLS #define LDBL_MAX_EXP DBL_MAX_EXP #define LDBL_MAX ((long double)DBL_MAX) #define LDBL_MAX_10_EXP DBL_MAX_10_EXP +#if __ISO_C_VISIBLE >= 2011 +#define LDBL_TRUE_MIN ((long double)DBL_TRUE_MIN) +#define LDBL_DECIMAL_DIG DBL_DECIMAL_DIG +#define LDBL_HAS_SUBNORM DBL_HAS_SUBNORM +#endif /* __ISO_C_VISIBLE >= 2011 */ + #endif /* _MACHINE_FLOAT_H_ */ Modified: head/sys/i386/include/float.h ============================================================================== --- head/sys/i386/include/float.h Mon Jan 23 04:38:31 2012 (r230474) +++ head/sys/i386/include/float.h Mon Jan 23 06:36:41 2012 (r230475) @@ -55,6 +55,11 @@ __END_DECLS #define FLT_MAX_EXP 128 /* emax */ #define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ #define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ +#if __ISO_C_VISIBLE >= 2011 +#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ +#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ +#define FLT_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define DBL_MANT_DIG 53 #define DBL_EPSILON 2.2204460492503131E-16 @@ -65,6 +70,11 @@ __END_DECLS #define DBL_MAX_EXP 1024 #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 +#if __ISO_C_VISIBLE >= 2011 +#define DBL_TRUE_MIN 4.9406564584124654E-324 +#define DBL_DECIMAL_DIG 17 +#define DBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define LDBL_MANT_DIG 64 #define LDBL_EPSILON 1.0842021724855044340E-19L @@ -75,4 +85,10 @@ __END_DECLS #define LDBL_MAX_EXP 16384 #define LDBL_MAX 1.1897314953572317650E+4932L #define LDBL_MAX_10_EXP 4932 +#if __ISO_C_VISIBLE >= 2011 +#define LDBL_TRUE_MIN 3.6451995318824746025E-4951L +#define LDBL_DECIMAL_DIG 21 +#define LDBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ + #endif /* _MACHINE_FLOAT_H_ */ Modified: head/sys/ia64/include/float.h ============================================================================== --- head/sys/ia64/include/float.h Mon Jan 23 04:38:31 2012 (r230474) +++ head/sys/ia64/include/float.h Mon Jan 23 06:36:41 2012 (r230475) @@ -55,6 +55,11 @@ __END_DECLS #define FLT_MAX_EXP 128 /* emax */ #define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ #define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ +#if __ISO_C_VISIBLE >= 2011 +#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ +#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ +#define FLT_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define DBL_MANT_DIG 53 #define DBL_EPSILON 2.2204460492503131E-16 @@ -65,6 +70,11 @@ __END_DECLS #define DBL_MAX_EXP 1024 #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 +#if __ISO_C_VISIBLE >= 2011 +#define DBL_TRUE_MIN 4.9406564584124654E-324 +#define DBL_DECIMAL_DIG 17 +#define DBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define LDBL_MANT_DIG 64 #define LDBL_EPSILON 1.0842021724855044340E-19L @@ -75,5 +85,10 @@ __END_DECLS #define LDBL_MAX_EXP 16384 #define LDBL_MAX 1.1897314953572317650E+4932L #define LDBL_MAX_10_EXP 4932 +#if __ISO_C_VISIBLE >= 2011 +#define LDBL_TRUE_MIN 3.6451995318824746025E-4951L +#define LDBL_DECIMAL_DIG 21 +#define LDBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #endif /* _MACHINE_FLOAT_H_ */ Modified: head/sys/mips/include/float.h ============================================================================== --- head/sys/mips/include/float.h Mon Jan 23 04:38:31 2012 (r230474) +++ head/sys/mips/include/float.h Mon Jan 23 06:36:41 2012 (r230475) @@ -62,6 +62,11 @@ __END_DECLS #define FLT_MAX_EXP 128 /* emax */ #define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ #define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ +#if __ISO_C_VISIBLE >= 2011 +#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ +#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ +#define FLT_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define DBL_MANT_DIG 53 #define DBL_EPSILON 2.2204460492503131E-16 @@ -72,6 +77,11 @@ __END_DECLS #define DBL_MAX_EXP 1024 #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 +#if __ISO_C_VISIBLE >= 2011 +#define DBL_TRUE_MIN 4.9406564584124654E-324 +#define DBL_DECIMAL_DIG 17 +#define DBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define LDBL_MANT_DIG DBL_MANT_DIG #define LDBL_EPSILON ((long double)DBL_EPSILON) @@ -82,5 +92,10 @@ __END_DECLS #define LDBL_MAX_EXP DBL_MAX_EXP #define LDBL_MAX ((long double)DBL_MAX) #define LDBL_MAX_10_EXP DBL_MAX_10_EXP +#if __ISO_C_VISIBLE >= 2011 +#define LDBL_TRUE_MIN ((long double)DBL_TRUE_MIN) +#define LDBL_DECIMAL_DIG DBL_DECIMAL_DIG +#define LDBL_HAS_SUBNORM DBL_HAS_SUBNORM +#endif /* __ISO_C_VISIBLE >= 2011 */ #endif /* _MACHINE_FLOAT_H_ */ Modified: head/sys/powerpc/include/float.h ============================================================================== --- head/sys/powerpc/include/float.h Mon Jan 23 04:38:31 2012 (r230474) +++ head/sys/powerpc/include/float.h Mon Jan 23 06:36:41 2012 (r230475) @@ -60,6 +60,11 @@ __END_DECLS #define FLT_MAX_EXP 128 /* emax */ #define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ #define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ +#if __ISO_C_VISIBLE >= 2011 +#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ +#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ +#define FLT_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define DBL_MANT_DIG 53 #define DBL_EPSILON 2.2204460492503131E-16 @@ -70,6 +75,11 @@ __END_DECLS #define DBL_MAX_EXP 1024 #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 +#if __ISO_C_VISIBLE >= 2011 +#define DBL_TRUE_MIN 4.9406564584124654E-324 +#define DBL_DECIMAL_DIG 17 +#define DBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define LDBL_MANT_DIG DBL_MANT_DIG #define LDBL_EPSILON ((long double)DBL_EPSILON) @@ -80,5 +90,10 @@ __END_DECLS #define LDBL_MAX_EXP DBL_MAX_EXP #define LDBL_MAX ((long double)DBL_MAX) #define LDBL_MAX_10_EXP DBL_MAX_10_EXP +#if __ISO_C_VISIBLE >= 2011 +#define LDBL_TRUE_MIN ((long double)DBL_TRUE_MIN) +#define LDBL_DECIMAL_DIG DBL_DECIMAL_DIG +#define LDBL_HAS_SUBNORM DBL_HAS_SUBNORM +#endif /* __ISO_C_VISIBLE >= 2011 */ #endif /* _MACHINE_FLOAT_H_ */ Modified: head/sys/sparc64/include/float.h ============================================================================== --- head/sys/sparc64/include/float.h Mon Jan 23 04:38:31 2012 (r230474) +++ head/sys/sparc64/include/float.h Mon Jan 23 06:36:41 2012 (r230475) @@ -60,6 +60,11 @@ __END_DECLS #define FLT_MAX_EXP 128 /* emax */ #define FLT_MAX 3.40282347E+38F /* (1-b**(-p))*b**emax */ #define FLT_MAX_10_EXP 38 /* floor(log10((1-b**(-p))*b**emax)) */ +#if __ISO_C_VISIBLE >= 2011 +#define FLT_TRUE_MIN 1.40129846E-45F /* b**(emin-p) */ +#define FLT_DECIMAL_DIG 9 /* ceil(1+p*log10(b)) */ +#define FLT_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define DBL_MANT_DIG 53 #define DBL_EPSILON 2.2204460492503131E-16 @@ -70,6 +75,11 @@ __END_DECLS #define DBL_MAX_EXP 1024 #define DBL_MAX 1.7976931348623157E+308 #define DBL_MAX_10_EXP 308 +#if __ISO_C_VISIBLE >= 2011 +#define DBL_TRUE_MIN 4.9406564584124654E-324 +#define DBL_DECIMAL_DIG 17 +#define DBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #define LDBL_MANT_DIG 113 #define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L @@ -80,5 +90,10 @@ __END_DECLS #define LDBL_MAX_EXP (+16384) #define LDBL_MAX 1.189731495357231765085759326628007016E+4932L #define LDBL_MAX_10_EXP (+4932) +#if __ISO_C_VISIBLE >= 2011 +#define LDBL_TRUE_MIN 6.475175119438025110924438958227646552E-4966L +#define LDBL_DECIMAL_DIG 36 +#define LDBL_HAS_SUBNORM 1 +#endif /* __ISO_C_VISIBLE >= 2011 */ #endif /* _MACHINE_FLOAT_H_ */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 08:29:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F7B31065670; Mon, 23 Jan 2012 08:29:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6198FC12; Mon, 23 Jan 2012 08:29:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0N8Twdh014635; Mon, 23 Jan 2012 08:29:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0N8Twv2014632; Mon, 23 Jan 2012 08:29:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201230829.q0N8Twv2014632@svn.freebsd.org> From: Martin Matuska Date: Mon, 23 Jan 2012 08:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230476 - in stable/9/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 08:29:58 -0000 Author: mm Date: Mon Jan 23 08:29:58 2012 New Revision: 230476 URL: http://svn.freebsd.org/changeset/base/230476 Log: MFC r230402, r230404: Add accidentially removed copyright lines in r228103 Reported by: pjd Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Jan 23 06:36:41 2012 (r230475) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Jan 23 08:29:58 2012 (r230476) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . + * All rights reserved. * Copyright (c) 2011 Martin Matuska . All rights reserved. */ Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Jan 23 06:36:41 2012 (r230475) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Jan 23 08:29:58 2012 (r230476) @@ -22,6 +22,8 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek . + * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * All rights reserved. */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 08:30:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 743841065670; Mon, 23 Jan 2012 08:30:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 623BC8FC14; Mon, 23 Jan 2012 08:30:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0N8UIUu014694; Mon, 23 Jan 2012 08:30:18 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0N8UIio014691; Mon, 23 Jan 2012 08:30:18 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201230830.q0N8UIio014691@svn.freebsd.org> From: Martin Matuska Date: Mon, 23 Jan 2012 08:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230477 - in stable/8/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 08:30:18 -0000 Author: mm Date: Mon Jan 23 08:30:17 2012 New Revision: 230477 URL: http://svn.freebsd.org/changeset/base/230477 Log: MFC r230402, r230404: Add accidentially removed copyright lines in r228103 Reported by: pjd Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Jan 23 08:29:58 2012 (r230476) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Mon Jan 23 08:30:17 2012 (r230477) @@ -24,6 +24,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * Copyright (c) 2011 Pawel Jakub Dawidek . + * All rights reserved. * Copyright (c) 2011 Martin Matuska . All rights reserved. */ Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Jan 23 08:29:58 2012 (r230476) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Jan 23 08:30:17 2012 (r230477) @@ -22,6 +22,8 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2011 Pawel Jakub Dawidek . + * All rights reserved. * Copyright (c) 2011 by Delphix. All rights reserved. * All rights reserved. */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 09:23:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48CA81065678; Mon, 23 Jan 2012 09:23:08 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 37F708FC12; Mon, 23 Jan 2012 09:23:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0N9N8GJ016434; Mon, 23 Jan 2012 09:23:08 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0N9N8A5016432; Mon, 23 Jan 2012 09:23:08 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201201230923.q0N9N8A5016432@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 23 Jan 2012 09:23:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230478 - head/lib/libfetch X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 09:23:08 -0000 Author: des Date: Mon Jan 23 09:23:07 2012 New Revision: 230478 URL: http://svn.freebsd.org/changeset/base/230478 Log: Fix two nits in previous commit pointed out by pjd@. MFC after: 3 weeks Modified: head/lib/libfetch/common.c Modified: head/lib/libfetch/common.c ============================================================================== --- head/lib/libfetch/common.c Mon Jan 23 08:30:17 2012 (r230477) +++ head/lib/libfetch/common.c Mon Jan 23 09:23:07 2012 (r230478) @@ -416,7 +416,6 @@ fetch_cache_data(conn_t *conn, char *src if (conn->cache.size < nbytes) { tmp = realloc(conn->cache.buf, nbytes); if (tmp == NULL) { - errno = ENOMEM; fetch_syserr(); return (-1); } @@ -481,7 +480,7 @@ fetch_read(conn_t *conn, char *buf, size conn->cache.len -= total; conn->cache.pos += total; len -= total; - buf+= total; + buf += total; } while (len > 0) { From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 11:10:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A958F106567D; Mon, 23 Jan 2012 11:10:11 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 860558FC17; Mon, 23 Jan 2012 11:10:10 +0000 (UTC) Received: by lagv3 with SMTP id v3so867668lag.13 for ; Mon, 23 Jan 2012 03:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:x-gm-message-state :content-type:content-transfer-encoding; bh=g47UfsS3A1cTA9KSU15bLBPBKajIdgCotuiiV6qoPnE=; b=sic2L9734SgMKQnVmqr77LHuvUD0nqj4tdEfLEMyMwG3nqlnfAZ5vSfbucBU7Z4bEk OGQ24/6c8NonyNiKS7WnjmzUBjXlHeDCrJSSh76v6Zab+miWCNEKG+lxvO6vzg48r2ib ZL9GgQFSUBYif/QYtyb5eWepb9GlRl7DiFEPs= Received: by 10.112.82.226 with SMTP id l2mr2038608lby.102.1327317009206; Mon, 23 Jan 2012 03:10:09 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.196 with HTTP; Mon, 23 Jan 2012 03:09:37 -0800 (PST) In-Reply-To: <20120123.132840.618925004528110765.hrs@allbsd.org> References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> <20120123.132840.618925004528110765.hrs@allbsd.org> From: Eitan Adler Date: Mon, 23 Jan 2012 06:09:37 -0500 X-Google-Sender-Auth: 4lL3GDt_hGy73Lq6D3XYkebIitQ Message-ID: To: Hiroki Sato X-Gm-Message-State: ALoCoQlt5AV9MzJiWQcfwTnY6QA/GN0rXV0aGqFdXHjDf9xwSgdvSVvjjQCFGzy0wOgedkvV3wrv Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 11:10:11 -0000 On Sun, Jan 22, 2012 at 11:28 PM, Hiroki Sato wrote: > ea> bug fix which could be upstreamed that would be great. On the other > ea> hand I would like to continue with my goal of making the non-contrib > ea> world compilable with CC=3Dgcc46. > ea> > ea> Should I revert this commit? > > =C2=A0I don't think it is needed. =C2=A0The makefs utility is a special c= ase > =C2=A0because it will probably diverge from the upstream to support > =C2=A0FreeBSD-specific feature in the future (this is one of the reasons > =C2=A0why it is not in contrib/). =C2=A0It didn't happen so far, however. Understood. > =C2=A0By the way, does gcc46 no longer allow unused code? gcc46 enables -Wunused-but-set-variable enabled with -Wextra. One possible solution is to just disable the warning, but IMHO having random unused variables just makes code harder to understand. It also enables a few other stricter checks for C conformance. > Generally speaking, I think it is enough to clean up unused code only whe= n we > =C2=A0actually change the code. If these were style(9) or "best practice" cleanups - I'd agree. However this was prompted by my specific goal of making the userland code compile with gcc46. It would be nice to see FreeBSD as compiler agnostic as possible. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 11:37:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F433106564A; Mon, 23 Jan 2012 11:37:41 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B5068FC0A; Mon, 23 Jan 2012 11:37:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NBbfYk022640; Mon, 23 Jan 2012 11:37:41 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NBbf64022598; Mon, 23 Jan 2012 11:37:41 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201201231137.q0NBbf64022598@svn.freebsd.org> From: Alexander Leidinger Date: Mon, 23 Jan 2012 11:37:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230479 - head/tools/kerneldoc/subsys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 11:37:41 -0000 Author: netchild Date: Mon Jan 23 11:37:40 2012 New Revision: 230479 URL: http://svn.freebsd.org/changeset/base/230479 Log: Mechanically add a config for all missing drivers. No cross-referencing was added to the configs, so no automatic linking to the documentation of other subsystems. Drivers which already contain doxygen markup: agp ath bktr bxe cxgb cxgbe dpt drm e1000 iir ixgbe mwl nxge ofw pccard siba wpi xen Added: head/tools/kerneldoc/subsys/Doxyfile-dev_aac (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_acpi_support (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_acpica (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_adb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_adlink (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_advansys (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ae (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_age (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_agp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_aha (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ahb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ahci (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_aic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_aic7xxx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_alc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ale (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdsbwd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amdtemp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_amr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_an (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_arcmsr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_asmc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_asr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ata (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ath (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_atkbdc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_auxio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bce (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bfe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bktr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_buslogic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bwi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bwn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_bxe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cardbus (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cas (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ce (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cesa (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cfe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cfi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ciss (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cmx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_coretemp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cpuctl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cpufreq (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cs (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ct (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ctau (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cxgb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cxgbe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_cy (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dcons (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_de (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_digi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dpms (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_dpt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_drm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_e1000 (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ed (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_eisa (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_en (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ep (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_esp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_et (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ex (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_exca (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_fatm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_fb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_fdc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_fdt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_fe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_firewire (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_flash (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_fxp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_gem (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_glxiic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_glxsb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_gpio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hatm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hifn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hme (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hpt27xx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hptiop (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hptmv (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hptrr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_hwpmc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ic (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ichsmb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ichwd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ida (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ie (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ieee488 (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_if_ndis (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iicbus (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iir (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_io (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ipmi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ips (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ipw (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iscsi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_isp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ispfw (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iwi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_iwn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ixgb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ixgbe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_jme (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_joy (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_kbd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_kbdmux (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ksyms (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_le (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_led (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_lge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_lindev (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_lmc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_malo (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mc146818 (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mca (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mcd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_md (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mem (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mfi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mii (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mk48txx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mlx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mly (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mmc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mps (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mpt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mse (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_msk (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mvs (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mwl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_mxge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_my (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ncv (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_netmap (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nfe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nmdm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nsp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_null (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nve (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nvram (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nvram2env (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_nxge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ofw (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_patm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pbio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pccard (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pccbb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pcf (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pcn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pdq (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_powermac_nvram (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ppbus (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ppc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pst (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_pty (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_puc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_qlxgb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_quicc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ral (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_random (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_re (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rndtest (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_rt (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_safe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sbni (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_scc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_scd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sdhci (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sec (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sf (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sfxge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_si (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_siba (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_siis (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sis (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sk (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_smbus (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_smc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sn (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_snc (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_snp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_speaker (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_spibus (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ste (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_stg (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_stge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_streams (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sym (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_syscons (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_tdfx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ti (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_tl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_tpm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_trm (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_tsec (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_twa (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_twe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_tws (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_tx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_txp (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_uart (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_ubsec (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_utopia (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_viawd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_virtio (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vkbd (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vr (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vte (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vx (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_vxge (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_watchdog (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_wb (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_wds (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_wi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_wl (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_wpi (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_wtap (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_xe (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_xen (contents, props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_xl (contents, props changed) Modified: Directory Properties: head/tools/kerneldoc/subsys/Doxyfile-dev_pci (props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_sound (props changed) head/tools/kerneldoc/subsys/Doxyfile-dev_usb (props changed) Added: head/tools/kerneldoc/subsys/Doxyfile-dev_aac ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aac Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AAC device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_aac/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/aac/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/aac/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_aac/dev_aac.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_acpi_support ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_acpi_support Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ACPI_SUPPORT device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_acpi_support/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/acpi_support/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/acpi_support/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_acpi_support/dev_acpi_support.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_acpica ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_acpica Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ACPICA device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_acpica/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/acpica/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/acpica/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_acpica/dev_acpica.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_adb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_adb Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ADB device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_adb/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/adb/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/adb/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_adb/dev_adb.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_adlink ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_adlink Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ADLINK device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_adlink/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/adlink/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/adlink/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_adlink/dev_adlink.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_advansys ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_advansys Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ADVANSYS device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_advansys/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/advansys/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/advansys/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_advansys/dev_advansys.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ae ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ae Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AE device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ae/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ae/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ae/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ae/dev_ae.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_age ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_age Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AGE device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_age/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/age/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/age/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_age/dev_age.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_agp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_agp Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AGP device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_agp/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/agp/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/agp/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_agp/dev_agp.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_aha ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aha Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AHA device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_aha/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/aha/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/aha/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_aha/dev_aha.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ahb ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ahb Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AHB device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ahb/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ahb/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ahb/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ahb/dev_ahb.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ahci ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ahci Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AHCI device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ahci/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ahci/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ahci/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ahci/dev_ahci.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_aic ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aic Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AIC device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_aic/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/aic/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/aic/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_aic/dev_aic.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_aic7xxx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_aic7xxx Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AIC7XXX device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_aic7xxx/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/aic7xxx/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/aic7xxx/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_aic7xxx/dev_aic7xxx.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_alc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_alc Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ALC device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_alc/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/alc/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/alc/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_alc/dev_alc.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ale ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ale Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ALE device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ale/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ale/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ale/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ale/dev_ale.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdsbwd ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdsbwd Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AMDSBWD device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdsbwd/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdsbwd/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/amdsbwd/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdsbwd/dev_amdsbwd.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amdtemp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amdtemp Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AMDTEMP device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amdtemp/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amdtemp/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/amdtemp/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amdtemp/dev_amdtemp.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_amr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_amr Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AMR device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_amr/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/amr/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/amr/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_amr/dev_amr.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_an ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_an Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AN device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_an/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/an/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/an/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_an/dev_an.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_arcmsr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_arcmsr Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ARCMSR device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_arcmsr/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/arcmsr/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/arcmsr/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_arcmsr/dev_arcmsr.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_asmc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_asmc Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ASMC device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_asmc/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/asmc/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/asmc/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_asmc/dev_asmc.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_asr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_asr Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ASR device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_asr/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/asr/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/asr/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_asr/dev_asr.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ata ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ata Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ATA device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ata/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ata/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ata/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ata/dev_ata.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ath ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ath Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ATH device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ath/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ath/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ath/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ath/dev_ath.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_atkbdc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_atkbdc Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel ATKBDC device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_atkbdc/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/atkbdc/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/atkbdc/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_atkbdc/dev_atkbdc.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_auxio ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_auxio Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel AUXIO device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_auxio/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/auxio/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/auxio/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_auxio/dev_auxio.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bce ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bce Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel BCE device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bce/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bce/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bce/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bce/dev_bce.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bfe ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bfe Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel BFE device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bfe/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bfe/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bfe/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bfe/dev_bfe.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bge ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bge Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel BGE device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bge/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bge/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bge/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bge/dev_bge.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bktr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bktr Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel BKTR device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bktr/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bktr/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bktr/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bktr/dev_bktr.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bm ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bm Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel BM device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bm/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bm/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bm/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bm/dev_bm.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_buslogic ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_buslogic Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel BUSLOGIC device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_buslogic/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/buslogic/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/buslogic/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_buslogic/dev_buslogic.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bwi ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bwi Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel BWI device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bwi/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bwi/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bwi/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bwi/dev_bwi.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bwn ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bwn Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel BWN device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bwn/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bwn/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bwn/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bwn/dev_bwn.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_bxe ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_bxe Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel BXE device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_bxe/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/bxe/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/bxe/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_bxe/dev_bxe.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_cardbus ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cardbus Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel CARDBUS device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_cardbus/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/cardbus/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cardbus/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_cardbus/dev_cardbus.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_cas ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cas Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel CAS device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_cas/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/cas/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cas/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_cas/dev_cas.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_ce ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_ce Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel CE device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_ce/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/ce/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/ce/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_ce/dev_ce.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + Added: head/tools/kerneldoc/subsys/Doxyfile-dev_cesa ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/kerneldoc/subsys/Doxyfile-dev_cesa Mon Jan 23 11:37:40 2012 (r230479) @@ -0,0 +1,22 @@ +# Doxyfile 1.5.2 + +# $FreeBSD$ + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- +PROJECT_NAME = "FreeBSD kernel CESA device code" +OUTPUT_DIRECTORY = $(DOXYGEN_DEST_PATH)/dev_cesa/ +EXTRACT_ALL = YES # for undocumented src, no warnings enabled +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = $(DOXYGEN_SRC_PATH)/dev/cesa/ \ + $(DOXYGEN_SRC_PATH)/$(DOXYGEN_TARGET_ARCH)/cesa/ \ + $(NOTREVIEWED) + +GENERATE_TAGFILE = dev_cesa/dev_cesa.tag + +@INCLUDE_PATH = $(DOXYGEN_INCLUDE_PATH) +@INCLUDE = common-Doxyfile + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 12:25:07 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E17B106566C; Mon, 23 Jan 2012 12:25:07 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 06DE48FC0A; Mon, 23 Jan 2012 12:25:07 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d887:2a58:6ed8:8aa] (unknown [IPv6:2001:7b8:3a7:0:d887:2a58:6ed8:8aa]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 355545C37; Mon, 23 Jan 2012 13:25:06 +0100 (CET) Message-ID: <4F1D51A0.6040405@FreeBSD.org> Date: Mon, 23 Jan 2012 13:25:04 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120106 Thunderbird/10.0 MIME-Version: 1.0 To: Hiroki Sato References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> <20120123.132840.618925004528110765.hrs@allbsd.org> In-Reply-To: <20120123.132840.618925004528110765.hrs@allbsd.org> Content-Type: multipart/mixed; boundary="------------010104080804070801050505" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, eadler@FreeBSD.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 12:25:07 -0000 This is a multi-part message in MIME format. --------------010104080804070801050505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 2012-01-23 05:28, Hiroki Sato wrote: ... > I don't think it is needed. The makefs utility is a special case > because it will probably diverge from the upstream to support > FreeBSD-specific feature in the future (this is one of the reasons > why it is not in contrib/). It didn't happen so far, however. > > By the way, does gcc46 no longer allow unused code? Generally > speaking, I think it is enough to clean up unused code only when we > actually change the code. The warnings are not about unused code, but about variables which are assigned, but then never referenced anymore. Sometimes this is just a cosmetic issue, and the compiler will hopefully optimize out the unreferenced variable(s). In other situations there are real bugs. In any case, gcc 4.5 and 4.6 just enable more warnings by default, and when using -Wall; in particular the "variable set but not used" one. This warning should really be suppressed when WARNS is set to a low level, such as with makefs (it has WARNS?=2). Attached diff makes it so, for gcc45 and gcc46. It uses the same approach as I added earlier for clang. It can also be easily extended to other warnings. --------------010104080804070801050505 Content-Type: text/x-diff; name="gcc46-warnings-1.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gcc46-warnings-1.diff" Index: share/mk/bsd.sys.mk =================================================================== --- share/mk/bsd.sys.mk (revision 230479) +++ share/mk/bsd.sys.mk (working copy) @@ -74,7 +74,14 @@ . if defined(NO_WARRAY_BOUNDS) CWARNFLAGS += -Wno-array-bounds . endif -. endif +. endif # clang +# Gcc 4.5 and 4.6 have more warnings enabled by default, and when using -Wall, +# so if WARNS is set to low values, these have to be disabled explicitly. +. if ${CC:T:Mgcc45} == "gcc45" || ${CC:T:Mgcc45} == "gcc46" +. if ${WARNS} <= 2 +CWARNFLAGS += -Wno-unused-but-set-variable +. endif +. endif # gcc45 || gcc46 . endif . if defined(FORMAT_AUDIT) --------------010104080804070801050505-- From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 12:31:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8389E106564A; Mon, 23 Jan 2012 12:31:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 670578FC0C; Mon, 23 Jan 2012 12:31:36 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0NCVWWF079526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Jan 2012 14:31:32 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0NCVWVr085655; Mon, 23 Jan 2012 14:31:32 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0NCVWsl085654; Mon, 23 Jan 2012 14:31:32 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 23 Jan 2012 14:31:32 +0200 From: Kostik Belousov To: Dimitry Andric Message-ID: <20120123123132.GM31224@deviant.kiev.zoral.com.ua> References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> <20120123.132840.618925004528110765.hrs@allbsd.org> <4F1D51A0.6040405@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wFtFFPDCaES44eZG" Content-Disposition: inline In-Reply-To: <4F1D51A0.6040405@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , eadler@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 12:31:38 -0000 --wFtFFPDCaES44eZG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 23, 2012 at 01:25:04PM +0100, Dimitry Andric wrote: > On 2012-01-23 05:28, Hiroki Sato wrote: > ... > > I don't think it is needed. The makefs utility is a special case > > because it will probably diverge from the upstream to support > > FreeBSD-specific feature in the future (this is one of the reasons > > why it is not in contrib/). It didn't happen so far, however. > > > > By the way, does gcc46 no longer allow unused code? Generally > > speaking, I think it is enough to clean up unused code only when we > > actually change the code. >=20 > The warnings are not about unused code, but about variables which are > assigned, but then never referenced anymore. Sometimes this is just a > cosmetic issue, and the compiler will hopefully optimize out the > unreferenced variable(s). In other situations there are real bugs. >=20 > In any case, gcc 4.5 and 4.6 just enable more warnings by default, and > when using -Wall; in particular the "variable set but not used" one. >=20 > This warning should really be suppressed when WARNS is set to a low > level, such as with makefs (it has WARNS?=3D2). >=20 > Attached diff makes it so, for gcc45 and gcc46. It uses the same > approach as I added earlier for clang. It can also be easily extended > to other warnings. There is a typo in the second or condition, should it be gcc46 both times ? Anyway, the reason to answer this message is two ask the for seemingly unreasonable approach of matching compiler type/version based on the driver name. This completely precludes anybody from using gcc installed not from the ports tree. Could the tests performed based on the driver version information instead of name ? --wFtFFPDCaES44eZG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8dUyMACgkQC3+MBN1Mb4iKqgCg8glXah5zu8+ZhSHWgj+FHMyG 6SwAnid/dyzGYZysvACwEKGVQ8D5x3hU =LDJn -----END PGP SIGNATURE----- --wFtFFPDCaES44eZG-- From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 14:13:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9BB41065672; Mon, 23 Jan 2012 14:13:09 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 82F158FC0A; Mon, 23 Jan 2012 14:13:09 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:d887:2a58:6ed8:8aa] (unknown [IPv6:2001:7b8:3a7:0:d887:2a58:6ed8:8aa]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id B5E465C37; Mon, 23 Jan 2012 15:13:08 +0100 (CET) Message-ID: <4F1D6AF3.2030303@FreeBSD.org> Date: Mon, 23 Jan 2012 15:13:07 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120106 Thunderbird/10.0 MIME-Version: 1.0 To: Kostik Belousov References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> <20120123.132840.618925004528110765.hrs@allbsd.org> <4F1D51A0.6040405@FreeBSD.org> <20120123123132.GM31224@deviant.kiev.zoral.com.ua> In-Reply-To: <20120123123132.GM31224@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , eadler@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 14:13:09 -0000 On 2012-01-23 13:31, Kostik Belousov wrote: > On Mon, Jan 23, 2012 at 01:25:04PM +0100, Dimitry Andric wrote: ... > There is a typo in the second or condition, should it be gcc46 both times ? Ah, sorry, that was a copy/paste error. > Anyway, the reason to answer this message is two ask the for seemingly > unreasonable approach of matching compiler type/version based on the > driver name. This completely precludes anybody from using gcc installed > not from the ports tree. Yes, that is indeed the big problem with this approach. Although I think the number of people that hand-build gcc, and not use the ports will be rather low. :) > Could the tests performed based on the driver version information > instead of name ? Probably, but then you would have to run "${CC} --version" plus some sed/awk'ing from bsd.sys.mk. That could add quite some extra forking during buildworld. It may be easier to add a COMPILER_FLAVOR (just an example name) setting in make.conf, which can be set independently of CC, CXX and so on, to tell which specific variant of gcc, clang etc you want to use. The processing of that setting could happen in either sys.mk or bsd.sys.mk, or be separated out to a bsd.compiler.mk, for instance. In each .mk file or Makefile that needs it, the ${CC:T:M:foo} == "foo" comparisons can then be replaced with ${COMPILER_FLAVOR} == "foo". From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 14:24:45 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 870A2106564A; Mon, 23 Jan 2012 14:24:45 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 2EC4B8FC13; Mon, 23 Jan 2012 14:24:44 +0000 (UTC) Received: from lstewart1.loshell.room52.net (ppp59-167-184-191.static.internode.on.net [59.167.184.191]) by lauren.room52.net (Postfix) with ESMTPSA id C39FF7E880; Tue, 24 Jan 2012 01:24:42 +1100 (EST) Message-ID: <4F1D6DAA.9060108@freebsd.org> Date: Tue, 24 Jan 2012 01:24:42 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:7.0.1) Gecko/20111016 Thunderbird/7.0.1 MIME-Version: 1.0 To: Andre Oppermann References: <201110071639.p97Gd3t4019128@svn.freebsd.org> In-Reply-To: <201110071639.p97Gd3t4019128@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r226113 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 14:24:45 -0000 Hi Andre, On 10/08/11 03:39, Andre Oppermann wrote: > Author: andre > Date: Fri Oct 7 16:39:03 2011 > New Revision: 226113 > URL: http://svn.freebsd.org/changeset/base/226113 > > Log: > Prevent TCP sessions from stalling indefinitely in reassembly > when reaching the zone limit of reassembly queue entries. [snip] Any reason this was not MFCed to stable/8 and stable/7 when you MFCed to stable/9? As far as I can tell, both r226113 and r228016 need to be MFCed to 8 and 7. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 14:33:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C153E106566B; Mon, 23 Jan 2012 14:33:00 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 8748E8FC17; Mon, 23 Jan 2012 14:32:59 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0NEWnbG090317 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 23 Jan 2012 16:32:49 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0NEWmET086247; Mon, 23 Jan 2012 16:32:48 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0NEWm7E086246; Mon, 23 Jan 2012 16:32:48 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 23 Jan 2012 16:32:48 +0200 From: Kostik Belousov To: Dimitry Andric Message-ID: <20120123143248.GN31224@deviant.kiev.zoral.com.ua> References: <201201200138.q0K1cSou016739@svn.freebsd.org> <20120120.123256.1432718473132856309.hrs@allbsd.org> <20120123.132840.618925004528110765.hrs@allbsd.org> <4F1D51A0.6040405@FreeBSD.org> <20120123123132.GM31224@deviant.kiev.zoral.com.ua> <4F1D6AF3.2030303@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="q2pmJDE/j/QXHq4m" Content-Disposition: inline In-Reply-To: <4F1D6AF3.2030303@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , eadler@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230354 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 14:33:01 -0000 --q2pmJDE/j/QXHq4m Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 23, 2012 at 03:13:07PM +0100, Dimitry Andric wrote: > On 2012-01-23 13:31, Kostik Belousov wrote: > >On Mon, Jan 23, 2012 at 01:25:04PM +0100, Dimitry Andric wrote: > ... > >There is a typo in the second or condition, should it be gcc46 both time= s ? >=20 > Ah, sorry, that was a copy/paste error. >=20 >=20 > >Anyway, the reason to answer this message is two ask the for seemingly > >unreasonable approach of matching compiler type/version based on the > >driver name. This completely precludes anybody from using gcc installed > >not from the ports tree. >=20 > Yes, that is indeed the big problem with this approach. Although I > think the number of people that hand-build gcc, and not use the ports > will be rather low. :) >=20 >=20 > >Could the tests performed based on the driver version information > >instead of name ? >=20 > Probably, but then you would have to run "${CC} --version" plus some > sed/awk'ing from bsd.sys.mk. That could add quite some extra forking > during buildworld. >=20 > It may be easier to add a COMPILER_FLAVOR (just an example name) setting > in make.conf, which can be set independently of CC, CXX and so on, to > tell which specific variant of gcc, clang etc you want to use. >=20 > The processing of that setting could happen in either sys.mk or > bsd.sys.mk, or be separated out to a bsd.compiler.mk, for instance. >=20 > In each .mk file or Makefile that needs it, the ${CC:T:M:foo} =3D=3D "foo" > comparisons can then be replaced with ${COMPILER_FLAVOR} =3D=3D "foo". I agree that even such palliative measures are more useful and provides better future-proof of the build system then current name matching. --q2pmJDE/j/QXHq4m Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8db5AACgkQC3+MBN1Mb4iN0ACfavyI6/xbVlaWH90do+LZJ02w enQAoOuR+annDwPbInQTD/K/GFnrDl5C =Fy83 -----END PGP SIGNATURE----- --q2pmJDE/j/QXHq4m-- From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 15:17:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A4821065677; Mon, 23 Jan 2012 15:17:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DBAC8FC08; Mon, 23 Jan 2012 15:17:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NFHFSG030966; Mon, 23 Jan 2012 15:17:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NFHFgu030964; Mon, 23 Jan 2012 15:17:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201231517.q0NFHFgu030964@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 23 Jan 2012 15:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230480 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 15:17:15 -0000 Author: glebius Date: Mon Jan 23 15:17:14 2012 New Revision: 230480 URL: http://svn.freebsd.org/changeset/base/230480 Log: Convert locks that protect name hash, ID hash and typelist from mutex(9) to rwlock(9) based locks. While here remove dropping lock when processing NGM_LISTNODES, and NGM_LISTTYPES generic commands. We don't need to drop it since memory allocation is done with M_NOWAIT. Modified: head/sys/netgraph/ng_base.c Modified: head/sys/netgraph/ng_base.c ============================================================================== --- head/sys/netgraph/ng_base.c Mon Jan 23 11:37:40 2012 (r230479) +++ head/sys/netgraph/ng_base.c Mon Jan 23 15:17:14 2012 (r230480) @@ -50,6 +50,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,7 @@ #include #include #include +#include #include #include #include @@ -163,19 +165,28 @@ static struct mtx ng_worklist_mtx; /* /* List of installed types */ static LIST_HEAD(, ng_type) ng_typelist; -static struct mtx ng_typelist_mtx; +static struct rwlock ng_typelist_lock; +#define TYPELIST_RLOCK() rw_rlock(&ng_typelist_lock) +#define TYPELIST_RUNLOCK() rw_runlock(&ng_typelist_lock) +#define TYPELIST_WLOCK() rw_wlock(&ng_typelist_lock) +#define TYPELIST_WUNLOCK() rw_wunlock(&ng_typelist_lock) /* Hash related definitions */ /* XXX Don't need to initialise them because it's a LIST */ static VNET_DEFINE(LIST_HEAD(, ng_node), ng_ID_hash[NG_ID_HASH_SIZE]); #define V_ng_ID_hash VNET(ng_ID_hash) -static struct mtx ng_idhash_mtx; +static struct rwlock ng_idhash_lock; +#define IDHASH_RLOCK() rw_rlock(&ng_idhash_lock) +#define IDHASH_RUNLOCK() rw_runlock(&ng_idhash_lock) +#define IDHASH_WLOCK() rw_wlock(&ng_idhash_lock) +#define IDHASH_WUNLOCK() rw_wunlock(&ng_idhash_lock) + /* Method to find a node.. used twice so do it here */ #define NG_IDHASH_FN(ID) ((ID) % (NG_ID_HASH_SIZE)) #define NG_IDHASH_FIND(ID, node) \ do { \ - mtx_assert(&ng_idhash_mtx, MA_OWNED); \ + rw_assert(&ng_idhash_lock, RA_LOCKED); \ LIST_FOREACH(node, &V_ng_ID_hash[NG_IDHASH_FN(ID)], \ nd_idnodes) { \ if (NG_NODE_IS_VALID(node) \ @@ -188,7 +199,6 @@ static struct mtx ng_idhash_mtx; static VNET_DEFINE(LIST_HEAD(, ng_node), ng_name_hash[NG_NAME_HASH_SIZE]); #define V_ng_name_hash VNET(ng_name_hash) -static struct mtx ng_namehash_mtx; #define NG_NAMEHASH(NAME, HASH) \ do { \ u_char h = 0; \ @@ -198,6 +208,11 @@ static struct mtx ng_namehash_mtx; (HASH) = h % (NG_NAME_HASH_SIZE); \ } while (0) +static struct rwlock ng_namehash_lock; +#define NAMEHASH_RLOCK() rw_rlock(&ng_namehash_lock) +#define NAMEHASH_RUNLOCK() rw_runlock(&ng_namehash_lock) +#define NAMEHASH_WLOCK() rw_wlock(&ng_namehash_lock) +#define NAMEHASH_WUNLOCK() rw_wunlock(&ng_namehash_lock) /* Internal functions */ static int ng_add_hook(node_p node, const char *name, hook_p * hookp); @@ -650,12 +665,12 @@ ng_make_node_common(struct ng_type *type LIST_INIT(&node->nd_hooks); /* Link us into the name hash. */ - mtx_lock(&ng_namehash_mtx); + NAMEHASH_WLOCK(); LIST_INSERT_HEAD(&V_ng_name_hash[0], node, nd_nodes); - mtx_unlock(&ng_namehash_mtx); + NAMEHASH_WUNLOCK(); /* get an ID and put us in the hash chain */ - mtx_lock(&ng_idhash_mtx); + IDHASH_WLOCK(); for (;;) { /* wrap protection, even if silly */ node_p node2 = NULL; node->nd_ID = V_nextID++; /* 137/sec for 1 year before wrap */ @@ -668,7 +683,7 @@ ng_make_node_common(struct ng_type *type } LIST_INSERT_HEAD(&V_ng_ID_hash[NG_IDHASH_FN(node->nd_ID)], node, nd_idnodes); - mtx_unlock(&ng_idhash_mtx); + IDHASH_WUNLOCK(); /* Done */ *nodepp = node; @@ -780,14 +795,14 @@ ng_unref_node(node_p node) if (refcount_release(&node->nd_refs)) { /* we were the last */ - mtx_lock(&ng_namehash_mtx); node->nd_type->refs--; /* XXX maybe should get types lock? */ + NAMEHASH_WLOCK(); LIST_REMOVE(node, nd_nodes); - mtx_unlock(&ng_namehash_mtx); + NAMEHASH_WUNLOCK(); - mtx_lock(&ng_idhash_mtx); + IDHASH_WLOCK(); LIST_REMOVE(node, nd_idnodes); - mtx_unlock(&ng_idhash_mtx); + IDHASH_WUNLOCK(); mtx_destroy(&node->nd_input_queue.q_mtx); NG_FREE_NODE(node); @@ -801,11 +816,11 @@ static node_p ng_ID2noderef(ng_ID_t ID) { node_p node; - mtx_lock(&ng_idhash_mtx); + IDHASH_RLOCK(); NG_IDHASH_FIND(ID, node); if(node) NG_NODE_REF(node); - mtx_unlock(&ng_idhash_mtx); + IDHASH_RUNLOCK(); return(node); } @@ -854,10 +869,10 @@ ng_name_node(node_p node, const char *na /* Update name hash. */ NG_NAMEHASH(name, hash); - mtx_lock(&ng_namehash_mtx); + NAMEHASH_WLOCK(); LIST_REMOVE(node, nd_nodes); LIST_INSERT_HEAD(&V_ng_name_hash[hash], node, nd_nodes); - mtx_unlock(&ng_namehash_mtx); + NAMEHASH_WUNLOCK(); return (0); } @@ -892,16 +907,15 @@ ng_name2noderef(node_p here, const char /* Find node by name */ NG_NAMEHASH(name, hash); - mtx_lock(&ng_namehash_mtx); - LIST_FOREACH(node, &V_ng_name_hash[hash], nd_nodes) { + NAMEHASH_RLOCK(); + LIST_FOREACH(node, &V_ng_name_hash[hash], nd_nodes) if (NG_NODE_IS_VALID(node) && (strcmp(NG_NODE_NAME(node), name) == 0)) { + NG_NODE_REF(node); break; } - } - if (node) - NG_NODE_REF(node); - mtx_unlock(&ng_namehash_mtx); + NAMEHASH_RUNLOCK(); + return (node); } @@ -1190,10 +1204,10 @@ ng_newtype(struct ng_type *tp) /* Link in new type */ - mtx_lock(&ng_typelist_mtx); + TYPELIST_WLOCK(); LIST_INSERT_HEAD(&ng_typelist, tp, types); tp->refs = 1; /* first ref is linked list */ - mtx_unlock(&ng_typelist_mtx); + TYPELIST_WUNLOCK(); return (0); } @@ -1211,9 +1225,9 @@ ng_rmtype(struct ng_type *tp) } /* Unlink type */ - mtx_lock(&ng_typelist_mtx); + TYPELIST_WLOCK(); LIST_REMOVE(tp, types); - mtx_unlock(&ng_typelist_mtx); + TYPELIST_WUNLOCK(); return (0); } @@ -1225,12 +1239,12 @@ ng_findtype(const char *typename) { struct ng_type *type; - mtx_lock(&ng_typelist_mtx); + TYPELIST_RLOCK(); LIST_FOREACH(type, &ng_typelist, types) { if (strcmp(type->name, typename) == 0) break; } - mtx_unlock(&ng_typelist_mtx); + TYPELIST_RUNLOCK(); return (type); } @@ -2568,7 +2582,7 @@ ng_generic_msg(node_p here, item_p item, node_p node; int num = 0, i; - mtx_lock(&ng_namehash_mtx); + NAMEHASH_RLOCK(); /* Count number of nodes */ for (i = 0; i < NG_NAME_HASH_SIZE; i++) { LIST_FOREACH(node, &V_ng_name_hash[i], nd_nodes) { @@ -2578,12 +2592,12 @@ ng_generic_msg(node_p here, item_p item, } } } - mtx_unlock(&ng_namehash_mtx); /* Get response struct */ NG_MKRESPONSE(resp, msg, sizeof(*nl) + (num * sizeof(struct nodeinfo)), M_NOWAIT); if (resp == NULL) { + NAMEHASH_RUNLOCK(); error = ENOMEM; break; } @@ -2591,7 +2605,6 @@ ng_generic_msg(node_p here, item_p item, /* Cycle through the linked list of nodes */ nl->numnames = 0; - mtx_lock(&ng_namehash_mtx); for (i = 0; i < NG_NAME_HASH_SIZE; i++) { LIST_FOREACH(node, &V_ng_name_hash[i], nd_nodes) { struct nodeinfo *const np = @@ -2601,20 +2614,17 @@ ng_generic_msg(node_p here, item_p item, continue; if (!unnamed && (! NG_NODE_HAS_NAME(node))) continue; - if (nl->numnames >= num) { - log(LOG_ERR, "%s: number of nodes changed\n", - __func__); - break; - } if (NG_NODE_HAS_NAME(node)) strcpy(np->name, NG_NODE_NAME(node)); strcpy(np->type, node->nd_type->name); np->id = ng_node2ID(node); np->hooks = node->nd_numhooks; + KASSERT(nl->numnames < num, ("%s: no space", + __func__)); nl->numnames++; } } - mtx_unlock(&ng_namehash_mtx); + NAMEHASH_RUNLOCK(); break; } @@ -2624,17 +2634,16 @@ ng_generic_msg(node_p here, item_p item, struct ng_type *type; int num = 0; - mtx_lock(&ng_typelist_mtx); + TYPELIST_RLOCK(); /* Count number of types */ - LIST_FOREACH(type, &ng_typelist, types) { + LIST_FOREACH(type, &ng_typelist, types) num++; - } - mtx_unlock(&ng_typelist_mtx); /* Get response struct */ NG_MKRESPONSE(resp, msg, sizeof(*tl) + (num * sizeof(struct typeinfo)), M_NOWAIT); if (resp == NULL) { + TYPELIST_RUNLOCK(); error = ENOMEM; break; } @@ -2642,20 +2651,15 @@ ng_generic_msg(node_p here, item_p item, /* Cycle through the linked list of types */ tl->numtypes = 0; - mtx_lock(&ng_typelist_mtx); LIST_FOREACH(type, &ng_typelist, types) { struct typeinfo *const tp = &tl->typeinfo[tl->numtypes]; - if (tl->numtypes >= num) { - log(LOG_ERR, "%s: number of %s changed\n", - __func__, "types"); - break; - } strcpy(tp->type_name, type->name); tp->numnodes = type->refs - 1; /* don't count list */ + KASSERT(tl->numtypes < num, ("%s: no space", __func__)); tl->numtypes++; } - mtx_unlock(&ng_typelist_mtx); + TYPELIST_RUNLOCK(); break; } @@ -2989,10 +2993,10 @@ ng_mod_event(module_t mod, int event, vo /* Call type specific code */ if (type->mod_event != NULL) if ((error = (*type->mod_event)(mod, event, data))) { - mtx_lock(&ng_typelist_mtx); + TYPELIST_WLOCK(); type->refs--; /* undo it */ LIST_REMOVE(type, types); - mtx_unlock(&ng_typelist_mtx); + TYPELIST_WUNLOCK(); } break; @@ -3007,9 +3011,9 @@ ng_mod_event(module_t mod, int event, vo if (error != 0) /* type refuses.. */ break; } - mtx_lock(&ng_typelist_mtx); + TYPELIST_WLOCK(); LIST_REMOVE(type, types); - mtx_unlock(&ng_typelist_mtx); + TYPELIST_WUNLOCK(); } break; @@ -3032,7 +3036,7 @@ vnet_netgraph_uninit(const void *unused do { /* Find a node to kill */ - mtx_lock(&ng_namehash_mtx); + NAMEHASH_RLOCK(); for (i = 0; i < NG_NAME_HASH_SIZE; i++) { LIST_FOREACH(node, &V_ng_name_hash[i], nd_nodes) { if (node != &ng_deadnode) { @@ -3043,7 +3047,7 @@ vnet_netgraph_uninit(const void *unused if (node != NULL) break; } - mtx_unlock(&ng_namehash_mtx); + NAMEHASH_RUNLOCK(); /* Attempt to kill it only if it is a regular node */ if (node != NULL) { @@ -3081,12 +3085,9 @@ ngb_mod_event(module_t mod, int event, v case MOD_LOAD: /* Initialize everything. */ NG_WORKLIST_LOCK_INIT(); - mtx_init(&ng_typelist_mtx, "netgraph types mutex", NULL, - MTX_DEF); - mtx_init(&ng_idhash_mtx, "netgraph idhash mutex", NULL, - MTX_DEF); - mtx_init(&ng_namehash_mtx, "netgraph namehash mutex", NULL, - MTX_DEF); + rw_init(&ng_typelist_lock, "netgraph types"); + rw_init(&ng_idhash_lock, "netgraph idhash"); + rw_init(&ng_namehash_lock, "netgraph namehash"); mtx_init(&ng_topo_mtx, "netgraph topology mutex", NULL, MTX_DEF); #ifdef NETGRAPH_DEBUG From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 15:35:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2C79106566B; Mon, 23 Jan 2012 15:35:05 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw02.mail.saunalahti.fi (gw02.mail.saunalahti.fi [195.197.172.116]) by mx1.freebsd.org (Postfix) with ESMTP id 71A1D8FC0A; Mon, 23 Jan 2012 15:35:05 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw02.mail.saunalahti.fi (Postfix) with SMTP id 4150B139E4A; Mon, 23 Jan 2012 17:34:58 +0200 (EET) Date: Mon, 23 Jan 2012 17:34:57 +0200 From: Jaakko Heinonen To: Mikolaj Golub Message-ID: <20120123153457.GA2246@a91-153-116-96.elisa-laajakaista.fi> References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> <86lioztzh5.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86lioztzh5.fsf@kopusha.home.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 15:35:05 -0000 On 2012-01-22, Mikolaj Golub wrote: > Also, may be we should allow remounting ro (and may be some othe options) for > tmpfs? Yes, the patch below does that. I suspect that flipping the MNT_RDONLY flag may be enough for tmpfs but I am not sure. > JH> %%% > JH> Index: sys/fs/tmpfs/tmpfs_vfsops.c > JH> =================================================================== > JH> --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 230328) > JH> +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) > JH> @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { > JH> NULL > JH> }; > JH> > JH> +static const char *tmpfs_updateopts[] = { > JH> + "from", "export", NULL > JH> +}; > JH> + > JH> /* --------------------------------------------------------------------- */ > JH> > JH> static int > JH> @@ -150,12 +154,10 @@ tmpfs_mount(struct mount *mp) > JH> return (EINVAL); > JH> > JH> if (mp->mnt_flag & MNT_UPDATE) { > JH> - /* > JH> - * Only support update mounts for NFS export. > JH> - */ > JH> - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) > JH> - return (0); > JH> - return (EOPNOTSUPP); > JH> + /* Only support update mounts for certain options. */ > JH> + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) > JH> + return (EOPNOTSUPP); > JH> + return (0); > JH> } > JH> > JH> vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); > JH> %%% -- Jaakko From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 15:39:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 813AA106564A; Mon, 23 Jan 2012 15:39:45 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 661DA8FC14; Mon, 23 Jan 2012 15:39:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NFdjqY032644; Mon, 23 Jan 2012 15:39:45 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NFdjwo032640; Mon, 23 Jan 2012 15:39:45 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201231539.q0NFdjwo032640@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 23 Jan 2012 15:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230481 - in head: sys/netgraph usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 15:39:45 -0000 Author: glebius Date: Mon Jan 23 15:39:45 2012 New Revision: 230481 URL: http://svn.freebsd.org/changeset/base/230481 Log: In ng_socket(4) expose less kernel internals to userland. This commit breaks ABI, but makes probability of ABI breakage in future less. Modified: head/sys/netgraph/ng_socket.c head/sys/netgraph/ng_socketvar.h head/usr.bin/netstat/netgraph.c Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Mon Jan 23 15:17:14 2012 (r230480) +++ head/sys/netgraph/ng_socket.c Mon Jan 23 15:39:45 2012 (r230481) @@ -162,6 +162,19 @@ static struct mtx ngsocketlist_mtx; #define TRAP_ERROR #endif +/* Per-node private data */ +struct ngsock { + struct ng_node *node; /* the associated netgraph node */ + struct ngpcb *datasock; /* optional data socket */ + struct ngpcb *ctlsock; /* optional control socket */ + int flags; + int refs; + struct mtx mtx; /* mtx to wait on */ + int error; /* place to store error */ +}; + +#define NGS_FLAG_NOLINGER 1 /* close with last hook */ + /*************************************************************** Control sockets ***************************************************************/ @@ -535,9 +548,7 @@ ng_attach_cntl(struct socket *so) pcbp->sockdata = priv; priv->refs++; priv->node = node; - - /* Store a hint for netstat(1). */ - priv->node_id = priv->node->nd_ID; + pcbp->node_id = node->nd_ID; /* hint for netstat(1) */ /* Link the node and the private data. */ NG_NODE_SET_PRIVATE(priv->node, priv); @@ -608,6 +619,7 @@ ng_detach_common(struct ngpcb *pcbp, int panic("%s", __func__); } pcbp->sockdata = NULL; + pcbp->node_id = 0; ng_socket_free_priv(priv); } @@ -698,6 +710,7 @@ ng_connect_data(struct sockaddr *nam, st mtx_lock(&priv->mtx); priv->datasock = pcbp; pcbp->sockdata = priv; + pcbp->node_id = priv->node->nd_ID; /* hint for netstat(1) */ priv->refs++; mtx_unlock(&priv->mtx); NG_FREE_ITEM(item); /* drop the reference to the node */ Modified: head/sys/netgraph/ng_socketvar.h ============================================================================== --- head/sys/netgraph/ng_socketvar.h Mon Jan 23 15:17:14 2012 (r230480) +++ head/sys/netgraph/ng_socketvar.h Mon Jan 23 15:39:45 2012 (r230481) @@ -50,20 +50,6 @@ struct ngpcb { struct ngsock *sockdata; /* netgraph info */ LIST_ENTRY(ngpcb) socks; /* linked list of sockets */ int type; /* NG_CONTROL or NG_DATA */ -}; - -/* Per-node private data */ -struct ngsock { - struct ng_node *node; /* the associated netgraph node */ - struct ngpcb *datasock; /* optional data socket */ - struct ngpcb *ctlsock; /* optional control socket */ - int flags; - int refs; - struct mtx mtx; /* mtx to wait on */ - int error; /* place to store error */ ng_ID_t node_id; /* a hint for netstat(1) to find the node */ }; -#define NGS_FLAG_NOLINGER 1 /* close with last hook */ - #endif /* _NETGRAPH_NG_SOCKETVAR_H_ */ - Modified: head/usr.bin/netstat/netgraph.c ============================================================================== --- head/usr.bin/netstat/netgraph.c Mon Jan 23 15:17:14 2012 (r230480) +++ head/usr.bin/netstat/netgraph.c Mon Jan 23 15:39:45 2012 (r230481) @@ -67,7 +67,6 @@ netgraphprotopr(u_long off, const char * { struct ngpcb *this, *next; struct ngpcb ngpcb; - struct ngsock info; struct socket sockb; int debug = 1; @@ -165,15 +164,10 @@ netgraphprotopr(u_long off, const char * printf("%-5.5s %6u %6u ", name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); - /* Get ngsock structure */ - if (ngpcb.sockdata == NULL) /* unconnected data socket */ - goto finish; - kread((u_long)ngpcb.sockdata, (char *)&info, sizeof(info)); - /* Get info on associated node */ - if (info.node_id == 0 || csock == -1) + if (ngpcb.node_id == 0 || csock == -1) goto finish; - snprintf(path, sizeof(path), "[%x]:", info.node_id); + snprintf(path, sizeof(path), "[%x]:", ngpcb.node_id); if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_NODEINFO, NULL, 0) < 0) goto finish; From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 15:44:53 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3B3CD106564A; Mon, 23 Jan 2012 15:44:53 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29F1B8FC1A; Mon, 23 Jan 2012 15:44:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NFir95032861; Mon, 23 Jan 2012 15:44:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NFirMh032859; Mon, 23 Jan 2012 15:44:53 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201231544.q0NFirMh032859@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 23 Jan 2012 15:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230482 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 15:44:53 -0000 Author: nwhitehorn Date: Mon Jan 23 15:44:52 2012 New Revision: 230482 URL: http://svn.freebsd.org/changeset/base/230482 Log: Per popular demand, if installing from a graphics terminal, run the installer on a VTY with no kernel messages (VTY 2), show the installer log in real time on VTY 3, and spawn a shell on VTY 4. PR: bin/161047, bin/161048 MFC after: 2 weeks Modified: head/release/rc.local Modified: head/release/rc.local ============================================================================== --- head/release/rc.local Mon Jan 23 15:39:45 2012 (r230481) +++ head/release/rc.local Mon Jan 23 15:44:52 2012 (r230482) @@ -10,8 +10,19 @@ kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then - # Syscons: use xterm + # Syscons: use xterm, start interesting things on other VTYs TERM=xterm + + if [ "$EXTERNAL_VTY_STARTED" -ne 1 ]; then + vidcontrol -s 2 # Switch to a VTY with no kernel messages + # Init will clean these processes up if/when the system + # goes multiuser + touch /tmp/bsdinstall_log + tail -f /tmp/bsdinstall_log > /dev/ttyv2 & + /usr/libexec/getty autologin ttyv3 + EXTERNAL_VTY_STARTED=1 + trap "vidcontrol -s 1" EXIT + fi else # Serial or other console echo From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 15:50:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FEA71065670; Mon, 23 Jan 2012 15:50:16 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EAFE8FC1B; Mon, 23 Jan 2012 15:50:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NFoG1H033076; Mon, 23 Jan 2012 15:50:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NFoGAU033074; Mon, 23 Jan 2012 15:50:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201231550.q0NFoGAU033074@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 23 Jan 2012 15:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230483 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 15:50:16 -0000 Author: nwhitehorn Date: Mon Jan 23 15:50:16 2012 New Revision: 230483 URL: http://svn.freebsd.org/changeset/base/230483 Log: Do a test in a better way. Editing files after testing them is never wise. Modified: head/release/rc.local Modified: head/release/rc.local ============================================================================== --- head/release/rc.local Mon Jan 23 15:44:52 2012 (r230482) +++ head/release/rc.local Mon Jan 23 15:50:16 2012 (r230483) @@ -13,7 +13,7 @@ if [ $? -eq 0 ]; then # Syscons: use xterm, start interesting things on other VTYs TERM=xterm - if [ "$EXTERNAL_VTY_STARTED" -ne 1 ]; then + if [ -z "$EXTERNAL_VTY_STARTED" ]; then vidcontrol -s 2 # Switch to a VTY with no kernel messages # Init will clean these processes up if/when the system # goes multiuser From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 16:03:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F10D3106564A; Mon, 23 Jan 2012 16:03:41 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 8E0118FC14; Mon, 23 Jan 2012 16:03:41 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 689242A28CF8; Mon, 23 Jan 2012 17:03:40 +0100 (CET) Date: Mon, 23 Jan 2012 17:03:40 +0100 From: Ed Schouten To: Nathan Whitehorn Message-ID: <20120123160340.GI95413@hoeg.nl> References: <201201231544.q0NFirMh032859@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CEK8Nf/5gFSxJ2tb" Content-Disposition: inline In-Reply-To: <201201231544.q0NFirMh032859@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 16:03:42 -0000 --CEK8Nf/5gFSxJ2tb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Nathan, * Nathan Whitehorn , 20120123 16:44: > TERM=3Dxterm This code is also used on pc98, right? I think on pc98 we still need to use TERM=3Dcons25w, to support Japanese character sets and keyboard input. --=20 Ed Schouten WWW: http://80386.nl/ --CEK8Nf/5gFSxJ2tb Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iQIcBAEBAgAGBQJPHYTbAAoJEG5e2P40kaK7iMgP/jHrC8uZWZmurXrJr1SpMfGk AqfW1/OaOfg3J64KuVh8KFlFnL63BwVB7wGmWZeUW+zWOlexqaXiGNngW4IS2s+d 8yE2q6jL4qKns4J8TKV/OpvpXaPXcDksTVwK61b8X5SWRWdk5gMvS8ozOaoLif9a /yChDssaBzJ6zyszcvNUE1ujdxVTsJg5kORdKnitSUcjcPVIu7tTnWz02AMZMB/3 jEkov0RwgciQz5xpqNPnwjHq4LqJIIaxbMyk4688ICS+2LqgTHvnmLBczK0pjXOD yih9zAWfDYGX3o6kymR1259GtvTyzmFQMhyUrBwNCo/86MN/dU+IkzpIkY3olR6q S4ClgkXjWkFMNwbhlevhZ+lpKsVmwLKlvzLpUaX/P4CSfzrc67uqYmnv5zdHnuN+ hSp+SROc2dGibcrdPHJu6A6ZqeoN+KzC/kwM11rEEMrLoau+G3n4DMMTciZYhd80 Vh59zhMcbPIxHsuAGK9M06WyLZOr4S5Nu3Q8eOBgb60vUjFFIYK+OTyBAtOD8emB +qC4fW5R6D603XkecYg1SS4ChV/NATr2Y2//s/coJ2lNTrL9+dpzZSmS45p2JRjK K2uonKcldsr8I1dRs44wMJ+eS35g1KgoRkSM9L3HRWLiC6wNW0KieFrIbRl2pX+x yUUCimSQW5xVWS2K0K2d =iup4 -----END PGP SIGNATURE----- --CEK8Nf/5gFSxJ2tb-- From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 16:17:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4FC91106564A; Mon, 23 Jan 2012 16:17:55 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EA978FC0C; Mon, 23 Jan 2012 16:17:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NGHtXh033981; Mon, 23 Jan 2012 16:17:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NGHtPq033979; Mon, 23 Jan 2012 16:17:55 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201231617.q0NGHtPq033979@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 23 Jan 2012 16:17:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230484 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 16:17:55 -0000 Author: nwhitehorn Date: Mon Jan 23 16:17:54 2012 New Revision: 230484 URL: http://svn.freebsd.org/changeset/base/230484 Log: Part of r230482 didn't actually work. Revert it for now. This means PR 161047 isn't actually fixed. PR: bin/161047 Modified: head/release/rc.local Modified: head/release/rc.local ============================================================================== --- head/release/rc.local Mon Jan 23 15:50:16 2012 (r230483) +++ head/release/rc.local Mon Jan 23 16:17:54 2012 (r230484) @@ -14,14 +14,12 @@ if [ $? -eq 0 ]; then TERM=xterm if [ -z "$EXTERNAL_VTY_STARTED" ]; then - vidcontrol -s 2 # Switch to a VTY with no kernel messages # Init will clean these processes up if/when the system # goes multiuser touch /tmp/bsdinstall_log tail -f /tmp/bsdinstall_log > /dev/ttyv2 & /usr/libexec/getty autologin ttyv3 EXTERNAL_VTY_STARTED=1 - trap "vidcontrol -s 1" EXIT fi else # Serial or other console From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 16:28:36 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C9C7106566B; Mon, 23 Jan 2012 16:28:36 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2083B8FC0C; Mon, 23 Jan 2012 16:28:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NGSaNq034351; Mon, 23 Jan 2012 16:28:36 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NGSaMw034349; Mon, 23 Jan 2012 16:28:36 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201231628.q0NGSaMw034349@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 23 Jan 2012 16:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230485 - stable/9/sys/fs/pseudofs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 16:28:36 -0000 Author: jh Date: Mon Jan 23 16:28:35 2012 New Revision: 230485 URL: http://svn.freebsd.org/changeset/base/230485 Log: MFC r229694: r222004 changed sbuf_finish() to not clear the buffer error status. As a consequence sbuf_len() will return -1 for buffers which had the error status set prior to sbuf_finish() call. This causes a problem in pfs_read() which purposely uses a fixed size sbuf to discard bytes which are not needed to fulfill the read request. Work around the problem by using the full buffer length when sbuf_finish() indicates an overflow. An overflowed sbuf with fixed size is always full. PR: kern/163076 Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/pseudofs/pseudofs_vnops.c ============================================================================== --- stable/9/sys/fs/pseudofs/pseudofs_vnops.c Mon Jan 23 16:17:54 2012 (r230484) +++ stable/9/sys/fs/pseudofs/pseudofs_vnops.c Mon Jan 23 16:28:35 2012 (r230485) @@ -630,14 +630,14 @@ pfs_read(struct vop_read_args *va) if (uio->uio_offset < 0 || uio->uio_resid < 0 || (offset = uio->uio_offset) != uio->uio_offset || (resid = uio->uio_resid) != uio->uio_resid || - (buflen = offset + resid + 1) < offset || buflen > INT_MAX) { + (buflen = offset + resid) < offset || buflen >= INT_MAX) { error = EINVAL; goto ret; } - if (buflen > MAXPHYS + 1) - buflen = MAXPHYS + 1; + if (buflen > MAXPHYS) + buflen = MAXPHYS; - sb = sbuf_new(sb, NULL, buflen, 0); + sb = sbuf_new(sb, NULL, buflen + 1, 0); if (sb == NULL) { error = EIO; goto ret; @@ -650,8 +650,14 @@ pfs_read(struct vop_read_args *va) goto ret; } - sbuf_finish(sb); - error = uiomove_frombuf(sbuf_data(sb), sbuf_len(sb), uio); + /* + * XXX: If the buffer overflowed, sbuf_len() will not return + * the data length. Then just use the full length because an + * overflowed sbuf must be full. + */ + if (sbuf_finish(sb) == 0) + buflen = sbuf_len(sb); + error = uiomove_frombuf(sbuf_data(sb), buflen, uio); sbuf_delete(sb); ret: vn_lock(vn, locked | LK_RETRY); From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 16:31:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF631106564A; Mon, 23 Jan 2012 16:31:46 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AE2378FC0C; Mon, 23 Jan 2012 16:31:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NGVkqF034494; Mon, 23 Jan 2012 16:31:46 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NGVkMP034492; Mon, 23 Jan 2012 16:31:46 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201231631.q0NGVkMP034492@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 23 Jan 2012 16:31:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230486 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 16:31:46 -0000 Author: glebius Date: Mon Jan 23 16:31:46 2012 New Revision: 230486 URL: http://svn.freebsd.org/changeset/base/230486 Log: Convert panic()s to KASSERT()s. This is an optimisation for hashdestroy() since in absence of INVARIANTS a compiler will drop the entire for() cycle. Modified: head/sys/kern/subr_hash.c Modified: head/sys/kern/subr_hash.c ============================================================================== --- head/sys/kern/subr_hash.c Mon Jan 23 16:28:35 2012 (r230485) +++ head/sys/kern/subr_hash.c Mon Jan 23 16:31:46 2012 (r230486) @@ -52,9 +52,7 @@ hashinit_flags(int elements, struct mall LIST_HEAD(generic, generic) *hashtbl; int i; - if (elements <= 0) - panic("hashinit: bad elements"); - + KASSERT(elements > 0, ("%s: bad elements", __func__)); /* Exactly one of HASH_WAITOK and HASH_NOWAIT must be set. */ KASSERT((flags & HASH_WAITOK) ^ (flags & HASH_NOWAIT), ("Bad flags (0x%x) passed to hashinit_flags", flags)); @@ -95,8 +93,7 @@ hashdestroy(void *vhashtbl, struct mallo hashtbl = vhashtbl; for (hp = hashtbl; hp <= &hashtbl[hashmask]; hp++) - if (!LIST_EMPTY(hp)) - panic("hashdestroy: hash not empty"); + KASSERT(LIST_EMPTY(hp), ("%s: hash not empty", __func__)); free(hashtbl, type); } @@ -115,8 +112,7 @@ phashinit(int elements, struct malloc_ty LIST_HEAD(generic, generic) *hashtbl; int i; - if (elements <= 0) - panic("phashinit: bad elements"); + KASSERT(elements > 0, ("%s: bad elements", __func__)); for (i = 1, hashsize = primes[1]; hashsize <= elements;) { i++; if (i == NPRIMES) From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 16:43:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47DA6106564A; Mon, 23 Jan 2012 16:43:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2C5FA8FC1A; Mon, 23 Jan 2012 16:43:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NGhEEx034944; Mon, 23 Jan 2012 16:43:14 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NGhE9B034942; Mon, 23 Jan 2012 16:43:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201231643.q0NGhE9B034942@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 23 Jan 2012 16:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230487 - head/sys/netgraph X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 16:43:14 -0000 Author: glebius Date: Mon Jan 23 16:43:13 2012 New Revision: 230487 URL: http://svn.freebsd.org/changeset/base/230487 Log: Provide a findhook method for ng_socket(4). The node stores a hash with names of its hooks. It starts with size of 16, and grows when number of hooks reaches twice the current size. A failure to grow (memory is allocated with M_NOWAIT) isn't fatal, however. I used standard hash(9) function for the hash. With 25000 hooks named in the mpd (ports/net/mpd5) manner of "b%u", the distributions is the following: 72.1% entries consist of one element, 22.1% consist of two, 5.2% consist of three and 0.6% of four. Speedup in a synthetic test that creates 25000 hooks and then runs through a long cyclce dereferencing them in a random order is over 25 times. Modified: head/sys/netgraph/ng_socket.c Modified: head/sys/netgraph/ng_socket.c ============================================================================== --- head/sys/netgraph/ng_socket.c Mon Jan 23 16:31:46 2012 (r230486) +++ head/sys/netgraph/ng_socket.c Mon Jan 23 16:43:13 2012 (r230487) @@ -51,6 +51,7 @@ #include #include +#include #include #include #include @@ -112,6 +113,7 @@ static ng_rcvmsg_t ngs_rcvmsg; static ng_shutdown_t ngs_shutdown; static ng_newhook_t ngs_newhook; static ng_connect_t ngs_connect; +static ng_findhook_t ngs_findhook; static ng_rcvdata_t ngs_rcvdata; static ng_disconnect_t ngs_disconnect; @@ -137,6 +139,7 @@ static struct ng_type typestruct = { .shutdown = ngs_shutdown, .newhook = ngs_newhook, .connect = ngs_connect, + .findhook = ngs_findhook, .rcvdata = ngs_rcvdata, .disconnect = ngs_disconnect, }; @@ -162,11 +165,19 @@ static struct mtx ngsocketlist_mtx; #define TRAP_ERROR #endif +struct hookpriv { + LIST_ENTRY(hookpriv) next; + hook_p hook; +}; +LIST_HEAD(ngshash, hookpriv); + /* Per-node private data */ struct ngsock { struct ng_node *node; /* the associated netgraph node */ struct ngpcb *datasock; /* optional data socket */ struct ngpcb *ctlsock; /* optional control socket */ + struct ngshash *hash; /* hash for hook names */ + u_long hmask; /* hash mask */ int flags; int refs; struct mtx mtx; /* mtx to wait on */ @@ -537,8 +548,14 @@ ng_attach_cntl(struct socket *so) return (error); } - /* Allocate node private info */ + /* + * Allocate node private info and hash. We start + * with 16 hash entries, however we may grow later + * in ngs_newhook(). We can't predict how much hooks + * does this node plan to have. + */ priv = malloc(sizeof(*priv), M_NETGRAPH_SOCK, M_WAITOK | M_ZERO); + priv->hash = hashinit(16, M_NETGRAPH_SOCK, &priv->hmask); /* Initialize mutex. */ mtx_init(&priv->mtx, "ng_socket", NULL, MTX_DEF); @@ -643,6 +660,7 @@ ng_socket_free_priv(struct ngsock *priv) if (priv->refs == 0) { mtx_destroy(&priv->mtx); + hashdestroy(priv->hash, M_NETGRAPH_SOCK, priv->hmask); free(priv, M_NETGRAPH_SOCK); return; } @@ -752,6 +770,35 @@ ngs_constructor(node_p nodep) return (EINVAL); } +static void +ngs_rehash(node_p node) +{ + struct ngsock *priv = NG_NODE_PRIVATE(node); + struct ngshash *new; + struct hookpriv *hp; + hook_p hook; + uint32_t h; + u_long hmask; + + new = hashinit_flags((priv->hmask + 1) * 2, M_NETGRAPH_SOCK, &hmask, + HASH_NOWAIT); + if (new == NULL) + return; + + LIST_FOREACH(hook, &node->nd_hooks, hk_hooks) { + hp = NG_HOOK_PRIVATE(hook); +#ifdef INVARIANTS + LIST_REMOVE(hp, next); +#endif + h = hash32_str(NG_HOOK_NAME(hook), HASHINIT) & hmask; + LIST_INSERT_HEAD(&new[h], hp, next); + } + + hashdestroy(priv->hash, M_NETGRAPH_SOCK, priv->hmask); + priv->hash = new; + priv->hmask = hmask; +} + /* * We allow any hook to be connected to the node. * There is no per-hook private information though. @@ -759,7 +806,20 @@ ngs_constructor(node_p nodep) static int ngs_newhook(node_p node, hook_p hook, const char *name) { - NG_HOOK_SET_PRIVATE(hook, NG_NODE_PRIVATE(node)); + struct ngsock *const priv = NG_NODE_PRIVATE(node); + struct hookpriv *hp; + uint32_t h; + + hp = malloc(sizeof(*hp), M_NETGRAPH_SOCK, M_NOWAIT); + if (hp == NULL) + return (ENOMEM); + if (node->nd_numhooks * 2 > priv->hmask) + ngs_rehash(node); + hp->hook = hook; + h = hash32_str(name, HASHINIT) & priv->hmask; + LIST_INSERT_HEAD(&priv->hash[h], hp, next); + NG_HOOK_SET_PRIVATE(hook, hp); + return (0); } @@ -781,6 +841,41 @@ ngs_connect(hook_p hook) return (0); } +/* Look up hook by name */ +static hook_p +ngs_findhook(node_p node, const char *name) +{ + struct ngsock *priv = NG_NODE_PRIVATE(node); + struct hookpriv *hp; + uint32_t h; + + /* + * Microoptimisations for a ng_socket with no + * hooks, or with a single hook, which is a + * common case. + */ + if (node->nd_numhooks == 0) + return (NULL); + if (node->nd_numhooks == 1) { + hook_p hook; + + hook = LIST_FIRST(&node->nd_hooks); + + if (strcmp(NG_HOOK_NAME(hook), name) == 0) + return (hook); + else + return (NULL); + } + + h = hash32_str(name, HASHINIT) & priv->hmask; + + LIST_FOREACH(hp, &priv->hash[h], next) + if (strcmp(NG_HOOK_NAME(hp->hook), name) == 0) + return (hp->hook); + + return (NULL); +} + /* * Incoming messages get passed up to the control socket. * Unless they are for us specifically (socket_type) @@ -948,6 +1043,10 @@ ngs_disconnect(hook_p hook) { node_p node = NG_HOOK_NODE(hook); struct ngsock *const priv = NG_NODE_PRIVATE(node); + struct hookpriv *hp = NG_HOOK_PRIVATE(hook); + + LIST_REMOVE(hp, next); + free(hp, M_NETGRAPH_SOCK); if ((priv->datasock) && (priv->datasock->ng_socket)) { if (NG_NODE_NUMHOOKS(node) == 1) From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 17:05:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75D4A1065672; Mon, 23 Jan 2012 17:05:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 648718FC08; Mon, 23 Jan 2012 17:05:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NH5BWK035681; Mon, 23 Jan 2012 17:05:11 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NH5B7C035679; Mon, 23 Jan 2012 17:05:11 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201231705.q0NH5B7C035679@svn.freebsd.org> From: Alexander Motin Date: Mon, 23 Jan 2012 17:05:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230488 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 17:05:11 -0000 Author: mav Date: Mon Jan 23 17:05:11 2012 New Revision: 230488 URL: http://svn.freebsd.org/changeset/base/230488 Log: Realtek CODECs declare support for 32bit samples on S/PDIF input/output widgets. I am not sure if S/PDIF supports 32bit samples, but my Marantz SR4001 doesn't, producing only single clicks on playback start/stop. Because HDA controller requires 32bit alignment for all samples above 16bit, we can't handle this situation in regular way and have to set 32bit format in sound(4) for anything above 16bit. To workaround the problem, prefer to setup hardware to use 24/20bit samples when 32bit format requested. Add dev.pcm.X.play.32bit and dev.pcm.X.rec.32bit sysctls to control what format really use for 32bit samples. MFC after: 2 months Sponsored by: iXsystems, Inc. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Mon Jan 23 16:43:13 2012 (r230487) +++ head/sys/dev/sound/pci/hda/hdaa.c Mon Jan 23 17:05:11 2012 (r230488) @@ -4897,12 +4897,12 @@ hdaa_pcmchannel_setup(struct hdaa_chan * ch->bit16 = 1; else if (HDA_PARAM_SUPP_PCM_SIZE_RATE_8BIT(pcmcap)) ch->bit16 = 0; - if (HDA_PARAM_SUPP_PCM_SIZE_RATE_32BIT(pcmcap)) - ch->bit32 = 4; - else if (HDA_PARAM_SUPP_PCM_SIZE_RATE_24BIT(pcmcap)) + if (HDA_PARAM_SUPP_PCM_SIZE_RATE_24BIT(pcmcap)) ch->bit32 = 3; else if (HDA_PARAM_SUPP_PCM_SIZE_RATE_20BIT(pcmcap)) ch->bit32 = 2; + else if (HDA_PARAM_SUPP_PCM_SIZE_RATE_32BIT(pcmcap)) + ch->bit32 = 4; if (!(devinfo->quirks & HDAA_QUIRK_FORCESTEREO)) { ch->fmtlist[i++] = SND_FORMAT(AFMT_S16_LE, 1, 0); if (ch->bit32) @@ -6444,6 +6444,36 @@ hdaa_chan_formula(struct hdaa_devinfo *d } static int +hdaa_sysctl_32bit(SYSCTL_HANDLER_ARGS) +{ + struct hdaa_audio_as *as = (struct hdaa_audio_as *)oidp->oid_arg1; + struct hdaa_pcm_devinfo *pdevinfo = as->pdevinfo; + struct hdaa_devinfo *devinfo = pdevinfo->devinfo; + struct hdaa_chan *ch; + int error, val, i; + uint32_t pcmcap; + + ch = &devinfo->chans[as->chans[0]]; + val = (ch->bit32 == 4) ? 32 : ((ch->bit32 == 3) ? 24 : + ((ch->bit32 == 2) ? 20 : 0)); + error = sysctl_handle_int(oidp, &val, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + pcmcap = ch->supp_pcm_size_rate; + if (val == 32 && HDA_PARAM_SUPP_PCM_SIZE_RATE_32BIT(pcmcap)) + ch->bit32 = 4; + else if (val == 24 && HDA_PARAM_SUPP_PCM_SIZE_RATE_24BIT(pcmcap)) + ch->bit32 = 3; + else if (val == 20 && HDA_PARAM_SUPP_PCM_SIZE_RATE_20BIT(pcmcap)) + ch->bit32 = 2; + else + return (EINVAL); + for (i = 1; i < as->num_chans; i++) + devinfo->chans[as->chans[i]].bit32 = ch->bit32; + return (0); +} + +static int hdaa_pcm_probe(device_t dev) { struct hdaa_pcm_devinfo *pdevinfo = @@ -6500,6 +6530,7 @@ hdaa_pcm_attach(device_t dev) (struct hdaa_pcm_devinfo *)device_get_ivars(dev); struct hdaa_devinfo *devinfo = pdevinfo->devinfo; struct hdaa_audio_as *as; + struct snddev_info *d; char status[SND_STATUSLEN]; int i; @@ -6576,17 +6607,28 @@ hdaa_pcm_attach(device_t dev) pdevinfo->registered++; + d = device_get_softc(dev); if (pdevinfo->playas >= 0) { as = &devinfo->as[pdevinfo->playas]; for (i = 0; i < as->num_chans; i++) pcm_addchan(dev, PCMDIR_PLAY, &hdaa_channel_class, &devinfo->chans[as->chans[i]]); + SYSCTL_ADD_PROC(&d->play_sysctl_ctx, + SYSCTL_CHILDREN(d->play_sysctl_tree), OID_AUTO, + "32bit", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + as, sizeof(as), hdaa_sysctl_32bit, "I", + "Resolution of 32bit samples (20/24/32bit)"); } if (pdevinfo->recas >= 0) { as = &devinfo->as[pdevinfo->recas]; for (i = 0; i < as->num_chans; i++) pcm_addchan(dev, PCMDIR_REC, &hdaa_channel_class, &devinfo->chans[as->chans[i]]); + SYSCTL_ADD_PROC(&d->rec_sysctl_ctx, + SYSCTL_CHILDREN(d->rec_sysctl_tree), OID_AUTO, + "32bit", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, + as, sizeof(as), hdaa_sysctl_32bit, "I", + "Resolution of 32bit samples (20/24/32bit)"); } snprintf(status, SND_STATUSLEN, "on %s %s", From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 17:09:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DEEF106564A; Mon, 23 Jan 2012 17:09:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 31CD58FC17; Mon, 23 Jan 2012 17:09:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0NH9OI1035839; Mon, 23 Jan 2012 17:09:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0NH9Oek035837; Mon, 23 Jan 2012 17:09:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201231709.q0NH9Oek035837@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 23 Jan 2012 17:09:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230489 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 17:09:24 -0000 Author: kib Date: Mon Jan 23 17:09:23 2012 New Revision: 230489 URL: http://svn.freebsd.org/changeset/base/230489 Log: Apparently, both nfs clients do not use cache_enter_time() consistently, creating some namecache entries without NCF_TS flag. This causes panic due to failed assertion. As a temporal relief, remove the assert. Return epoch timestamp for the entries without timestamp if asked. While there, consolidate the code which returns timestamps, into a helper cache_out_ts(). Discussed with: jhb MFC after: 2 weeks Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Jan 23 17:05:11 2012 (r230488) +++ head/sys/kern/vfs_cache.c Mon Jan 23 17:09:23 2012 (r230489) @@ -233,6 +233,24 @@ nc_get_name(struct namecache *ncp) return (ncp_ts->nc_name); } +static void +cache_out_ts(struct namecache *ncp, struct timespec *tsp, int *ticksp) +{ + + if ((ncp->nc_flag & NCF_TS) == 0) { + if (tsp != NULL) + bzero(tsp, sizeof(*tsp)); + if (ticksp != NULL) + *ticksp = 0; + return; + } + + if (tsp != NULL) + *tsp = ((struct namecache_ts *)ncp)->nc_time; + if (ticksp != NULL) + *ticksp = ((struct namecache_ts *)ncp)->nc_ticks; +} + static int doingcache = 1; /* 1 => enable the cache */ SYSCTL_INT(_debug, OID_AUTO, vfscache, CTLFLAG_RW, &doingcache, 0, "VFS namecache enabled"); @@ -506,17 +524,7 @@ retry_wlocked: dvp, cnp->cn_nameptr, *vpp); SDT_PROBE(vfs, namecache, lookup, hit, dvp, "..", *vpp, 0, 0); - if (tsp != NULL) { - KASSERT((ncp->nc_flag & NCF_TS) != 0, - ("No NCF_TS")); - *tsp = ((struct namecache_ts *)ncp)->nc_time; - } - if (ticksp != NULL) { - KASSERT((ncp->nc_flag & NCF_TS) != 0, - ("No NCF_TS")); - *ticksp = ((struct namecache_ts *)ncp)-> - nc_ticks; - } + cache_out_ts(ncp, tsp, ticksp); goto success; } } @@ -563,14 +571,7 @@ retry_wlocked: dvp, cnp->cn_nameptr, *vpp, ncp); SDT_PROBE(vfs, namecache, lookup, hit, dvp, nc_get_name(ncp), *vpp, 0, 0); - if (tsp != NULL) { - KASSERT((ncp->nc_flag & NCF_TS) != 0, ("No NCF_TS")); - *tsp = ((struct namecache_ts *)ncp)->nc_time; - } - if (ticksp != NULL) { - KASSERT((ncp->nc_flag & NCF_TS) != 0, ("No NCF_TS")); - *ticksp = ((struct namecache_ts *)ncp)->nc_ticks; - } + cache_out_ts(ncp, tsp, ticksp); goto success; } @@ -602,14 +603,7 @@ negative_success: cnp->cn_flags |= ISWHITEOUT; SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, nc_get_name(ncp), 0, 0, 0); - if (tsp != NULL) { - KASSERT((ncp->nc_flag & NCF_TS) != 0, ("No NCF_TS")); - *tsp = ((struct namecache_ts *)ncp)->nc_time; - } - if (ticksp != NULL) { - KASSERT((ncp->nc_flag & NCF_TS) != 0, ("No NCF_TS")); - *ticksp = ((struct namecache_ts *)ncp)->nc_ticks; - } + cache_out_ts(ncp, tsp, ticksp); CACHE_WUNLOCK(); return (ENOENT); @@ -797,8 +791,8 @@ cache_enter_time(dvp, vp, cnp, tsp) n2->nc_nlen == cnp->cn_namelen && !bcmp(nc_get_name(n2), cnp->cn_nameptr, n2->nc_nlen)) { if (tsp != NULL) { - KASSERT((n2->nc_flag & NCF_TS) != 0, - ("no NCF_TS")); + if ((n2->nc_flag & NCF_TS) == 0) + continue; n3 = (struct namecache_ts *)n2; n3->nc_time = ((struct namecache_ts *)ncp)->nc_time; From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 18:10:53 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED28B1065673 for ; Mon, 23 Jan 2012 18:10:53 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 59F348FC12 for ; Mon, 23 Jan 2012 18:10:52 +0000 (UTC) Received: (qmail 8249 invoked from network); 23 Jan 2012 16:32:47 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 23 Jan 2012 16:32:47 -0000 Message-ID: <4F1DA2AB.6010702@freebsd.org> Date: Mon, 23 Jan 2012 19:10:51 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Lawrence Stewart References: <201110071639.p97Gd3t4019128@svn.freebsd.org> <4F1D6DAA.9060108@freebsd.org> In-Reply-To: <4F1D6DAA.9060108@freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r226113 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 18:10:54 -0000 On 23.01.2012 15:24, Lawrence Stewart wrote: > Hi Andre, > > On 10/08/11 03:39, Andre Oppermann wrote: >> Author: andre >> Date: Fri Oct 7 16:39:03 2011 >> New Revision: 226113 >> URL: http://svn.freebsd.org/changeset/base/226113 >> >> Log: >> Prevent TCP sessions from stalling indefinitely in reassembly >> when reaching the zone limit of reassembly queue entries. > > [snip] > > Any reason this was not MFCed to stable/8 and stable/7 when you MFCed to stable/9? As far as I can > tell, both r226113 and r228016 need to be MFCed to 8 and 7. Thanks for the reminder. Test build for MFC is under way, including your later fixup. I'll send it to you for review to make sure everything's correct. -- Andre From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 21:05:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DE891065670; Mon, 23 Jan 2012 21:05:49 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id AA3078FC13; Mon, 23 Jan 2012 21:05:47 +0000 (UTC) Received: by bkbc12 with SMTP id c12so3719712bkb.13 for ; Mon, 23 Jan 2012 13:05:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=M2MZaP/4+TJw4hIBVLC5690KhddqOO5d0GgDVqggnx8=; b=bfysHsgWTc3l3IFA3pkN1KA84tewTDfMIdXA2RzrA+GQL3gfBZJkyNkJLPJy+P9tW9 aCd6EqkMo6vj5ylpL6pOddsFUiYQJHChALjjbTR6C203fHQAsTU7+ilgLH/lcyujqSV0 6pafXpCL2hWqcbxqXRHSesg//RBZt1QKhqyLg= Received: by 10.204.10.82 with SMTP id o18mr3944297bko.20.1327352746676; Mon, 23 Jan 2012 13:05:46 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id iu2sm31116982bkb.0.2012.01.23.13.05.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 23 Jan 2012 13:05:45 -0800 (PST) From: Mikolaj Golub To: Jaakko Heinonen References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> <86lioztzh5.fsf@kopusha.home.net> <20120123153457.GA2246@a91-153-116-96.elisa-laajakaista.fi> X-Comment-To: Jaakko Heinonen Sender: Mikolaj Golub Date: Mon, 23 Jan 2012 23:05:42 +0200 In-Reply-To: <20120123153457.GA2246@a91-153-116-96.elisa-laajakaista.fi> (Jaakko Heinonen's message of "Mon, 23 Jan 2012 17:34:57 +0200") Message-ID: <86vco2yvrt.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 21:05:49 -0000 On Mon, 23 Jan 2012 17:34:57 +0200 Jaakko Heinonen wrote: JH> On 2012-01-22, Mikolaj Golub wrote: >> Also, may be we should allow remounting ro (and may be some othe options) for >> tmpfs? JH> Yes, the patch below does that. I suspect that flipping the MNT_RDONLY JH> flag may be enough for tmpfs but I am not sure. I see two issues with this patch: 1) 'mount -u -o rw /mnt' does not upgrade to rw, although it returns success. 2) if you have a file open for write, after remounting ro you still can write to the file. The expected behaviour: remount fails with EBUSY if force option is not specified; after remounting with force writing to the fail fails with EIO. I think when remounting ro you should call vflush(), something like below: flags = WRITECLOSE; if (mp->mnt_flag & MNT_FORCE) flags |= FORCECLOSE; error = vflush(mp, 0, flags, curthread); if (error != 0) return (error); MNT_ILOCK(mp); mp->mnt_flag |= MNT_RDONLY; MNT_IUNLOCK(mp); and when upgrading to rw reset MNT_RDONLY flag: MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_RDONLY; MNT_IUNLOCK(mp); I have no idea if something else is needed for tmpfs. >> JH> %%% >> JH> Index: sys/fs/tmpfs/tmpfs_vfsops.c >> JH> =================================================================== >> JH> --- sys/fs/tmpfs/tmpfs_vfsops.c (revision 230328) >> JH> +++ sys/fs/tmpfs/tmpfs_vfsops.c (working copy) >> JH> @@ -82,6 +82,10 @@ static const char *tmpfs_opts[] = { >> JH> NULL >> JH> }; >> JH> >> JH> +static const char *tmpfs_updateopts[] = { >> JH> + "from", "export", NULL >> JH> +}; >> JH> + >> JH> /* --------------------------------------------------------------------- */ >> JH> >> JH> static int >> JH> @@ -150,12 +154,10 @@ tmpfs_mount(struct mount *mp) >> JH> return (EINVAL); >> JH> >> JH> if (mp->mnt_flag & MNT_UPDATE) { >> JH> - /* >> JH> - * Only support update mounts for NFS export. >> JH> - */ >> JH> - if (vfs_flagopt(mp->mnt_optnew, "export", NULL, 0)) >> JH> - return (0); >> JH> - return (EOPNOTSUPP); >> JH> + /* Only support update mounts for certain options. */ >> JH> + if (vfs_filteropt(mp->mnt_optnew, tmpfs_updateopts) != 0) >> JH> + return (EOPNOTSUPP); >> JH> + return (0); >> JH> } >> JH> >> JH> vn_lock(mp->mnt_vnodecovered, LK_SHARED | LK_RETRY); >> JH> %%% JH> -- JH> Jaakko -- Mikolaj Golub From owner-svn-src-all@FreeBSD.ORG Mon Jan 23 22:53:54 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA1B9106566C; Mon, 23 Jan 2012 22:53:54 +0000 (UTC) (envelope-from flo@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 86D078FC13; Mon, 23 Jan 2012 22:53:54 +0000 (UTC) Received: from nibbler-wlan.fritz.box (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0NMrpmk044561; Mon, 23 Jan 2012 22:53:52 GMT (envelope-from flo@FreeBSD.org) Message-ID: <4F1DE4FF.3080606@FreeBSD.org> Date: Mon, 23 Jan 2012 23:53:51 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0) Gecko/20120118 Thunderbird/10.0 MIME-Version: 1.0 To: Andriy Gapon References: <201112112102.pBBL21kB068967@svn.freebsd.org> In-Reply-To: <201112112102.pBBL21kB068967@svn.freebsd.org> X-Enigmail-Version: 1.4a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig7C52202A2C5BCF9A80799909" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r228424 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 22:53:54 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7C52202A2C5BCF9A80799909 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 11.12.11 22:02, Andriy Gapon wrote: > Author: avg > Date: Sun Dec 11 21:02:01 2011 > New Revision: 228424 > URL: http://svn.freebsd.org/changeset/base/228424 >=20 > Log: > panic: add a switch and infrastructure for stopping other CPUs in SMP= case > =20 Hi, Attilio asked me to verify that this commit does not introduce a performance regression. The box used to run these tests was a 40 Core 32GB Xeon box (HTT was turned off, so 40 real hardware cores). As benchmark pgbench/PostgreSQL were used, a snapshot of PostgreSQL 9.2 from 16.01.2012 was used as they did a lot of scaling work in 9.2 which improved the numbers quite a lot vs. 9.1. The initial benchmarks were run with a scaling factor of 100 which creates a database work set of ~1.5GB. Max throughput was achieved at 20 Clients. x 228423-20 + 228424-20 +----------------------------------------------------------------------+ | x + | |x x x +* + + xxx * ++ + + x| | |___________________A______M_____________| | | |___________A____M_____| | +----------------------------------------------------------------------+ N Min Max Median Avg Stdd= ev x 10 111073.26 115016.79 113113.49 112745.69 1169.21= 32 + 10 112583.56 114454.33 113668.08 113343.31 661.317= 61 No difference proven at 95.0% confidence At 40 threads the results varied between 43000 - 76500 across reboots. Attilio suspects that this can be caused by the kernel memory layout changing under the woods creating cache effects difficult to control, therefor the scaling factor was reduced to 10 (~150MB work set) and the numbers got deterministic across reboot. x 228423-40-sf10 + 228424-40-sf10 * 228424-40-sf10-cl +----------------------------------------------------------------------+ |x x x *** * * + x **+ *+ * * ** + + +| | |__________A__________| | | |______________MA________________| | | |__________A__M_______| | +----------------------------------------------------------------------+ N Min Max Median Avg Stdd= ev x 10 192489.43 196045.39 194138.34 194149.19 986.615= 61 + 10 194093.35 198864.83 196129.36 196214.69 1545.87= 83 Difference at 95.0% confidence 2065.5 +/- 1218.43 1.06387% +/- 0.627572% (Student's t, pooled s =3D 1296.76) * 10 194288.28 197083.85 195955.26 195733.15 1012.35= 29 Difference at 95.0% confidence 1583.96 +/- 939.189 0.815847% +/- 0.483746% (Student's t, pooled s =3D 999.567) The 228424-40-sf10-cl results are with a patch from Attilio [1] which he will followup on. If anybody wants to look at the raw numbers they are available at [2]. There are results for pbzip2 runs here [3] also, the numbers are "real" time from /usr/bin/time. Cheers, Florian [1] http://people.freebsd.org/~attilio/cachelineunshare.patch [2] http://tb.smeets.im/~flo/stop-sched/pgsql/ [3] http://tb.smeets.im/~flo/stop-sched/pbzip2/ --------------enig7C52202A2C5BCF9A80799909 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAk8d5P8ACgkQapo8P8lCvwl5fgCgpfVmcd/4MSX3T2DaXj7/QfVK hqUAoNQ52OncFi3wsFTnrwJcN7exjFyG =eOKw -----END PGP SIGNATURE----- --------------enig7C52202A2C5BCF9A80799909-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 06:07:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B5EAB1065670; Tue, 24 Jan 2012 06:07:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A17868FC16; Tue, 24 Jan 2012 06:07:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0O676KR060518; Tue, 24 Jan 2012 06:07:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0O676pF060516; Tue, 24 Jan 2012 06:07:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201240607.q0O676pF060516@svn.freebsd.org> From: Adrian Chadd Date: Tue, 24 Jan 2012 06:07:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230492 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 06:07:06 -0000 Author: adrian Date: Tue Jan 24 06:07:05 2012 New Revision: 230492 URL: http://svn.freebsd.org/changeset/base/230492 Log: Add a missing HAL method macro. I'm using this as part of some personal DFS radar stuff. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Mon Jan 23 22:30:09 2012 (r230491) +++ head/sys/dev/ath/if_athvar.h Tue Jan 24 06:07:05 2012 (r230492) @@ -968,8 +968,9 @@ void ath_intr(void *); ((*(_ah)->ah_gpioGet)((_ah), (_gpio))) #define ath_hal_gpiosetintr(_ah, _gpio, _b) \ ((*(_ah)->ah_gpioSetIntr)((_ah), (_gpio), (_b))) - #define ath_hal_radar_wait(_ah, _chan) \ ((*(_ah)->ah_radarWait)((_ah), (_chan))) +#define ath_hal_get_chan_ext_busy(_ah) \ + ((*(_ah)->ah_get11nExtBusy)((_ah))) #endif /* _DEV_ATH_ATHVAR_H */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 06:12:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDBA4106564A; Tue, 24 Jan 2012 06:12:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CD728FC0A; Tue, 24 Jan 2012 06:12:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0O6Cmoo060740; Tue, 24 Jan 2012 06:12:48 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0O6CmSc060738; Tue, 24 Jan 2012 06:12:48 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201240612.q0O6CmSc060738@svn.freebsd.org> From: Adrian Chadd Date: Tue, 24 Jan 2012 06:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230493 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 06:12:48 -0000 Author: adrian Date: Tue Jan 24 06:12:48 2012 New Revision: 230493 URL: http://svn.freebsd.org/changeset/base/230493 Log: Fix up some style(9) indenting and reorganise some of the hal methods. There should be no functional change due to this commit. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Tue Jan 24 06:07:05 2012 (r230492) +++ head/sys/dev/ath/if_athvar.h Tue Jan 24 06:12:48 2012 (r230493) @@ -874,11 +874,14 @@ void ath_intr(void *); #define ath_hal_settpcts(_ah, _tpcts) \ ath_hal_setcapability(_ah, HAL_CAP_TPC_CTS, 0, _tpcts, NULL) #define ath_hal_hasintmit(_ah) \ - (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, HAL_CAP_INTMIT_PRESENT, NULL) == HAL_OK) + (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, \ + HAL_CAP_INTMIT_PRESENT, NULL) == HAL_OK) #define ath_hal_getintmit(_ah) \ - (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, HAL_CAP_INTMIT_ENABLE, NULL) == HAL_OK) + (ath_hal_getcapability(_ah, HAL_CAP_INTMIT, \ + HAL_CAP_INTMIT_ENABLE, NULL) == HAL_OK) #define ath_hal_setintmit(_ah, _v) \ - ath_hal_setcapability(_ah, HAL_CAP_INTMIT, HAL_CAP_INTMIT_ENABLE, _v, NULL) + ath_hal_setcapability(_ah, HAL_CAP_INTMIT, \ + HAL_CAP_INTMIT_ENABLE, _v, NULL) #define ath_hal_getchannoise(_ah, _c) \ ((*(_ah)->ah_getChanNoise)((_ah), (_c))) #define ath_hal_getrxchainmask(_ah, _prxchainmask) \ @@ -886,14 +889,16 @@ void ath_intr(void *); #define ath_hal_gettxchainmask(_ah, _ptxchainmask) \ (ath_hal_getcapability(_ah, HAL_CAP_TX_CHAINMASK, 0, _ptxchainmask)) #define ath_hal_split4ktrans(_ah) \ - (ath_hal_getcapability(_ah, HAL_CAP_SPLIT_4KB_TRANS, 0, NULL) == HAL_OK) + (ath_hal_getcapability(_ah, HAL_CAP_SPLIT_4KB_TRANS, \ + 0, NULL) == HAL_OK) #define ath_hal_self_linked_final_rxdesc(_ah) \ - (ath_hal_getcapability(_ah, HAL_CAP_RXDESC_SELFLINK, 0, NULL) == HAL_OK) + (ath_hal_getcapability(_ah, HAL_CAP_RXDESC_SELFLINK, \ + 0, NULL) == HAL_OK) #define ath_hal_gtxto_supported(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_GTXTO, 0, NULL) == HAL_OK) #define ath_hal_has_long_rxdesc_tsf(_ah) \ - (ath_hal_getcapability(_ah, HAL_CAP_LONG_RXDESC_TSF, 0, NULL) == HAL_OK) - + (ath_hal_getcapability(_ah, HAL_CAP_LONG_RXDESC_TSF, \ + 0, NULL) == HAL_OK) #define ath_hal_setuprxdesc(_ah, _ds, _size, _intreq) \ ((*(_ah)->ah_setupRxDesc)((_ah), (_ds), (_size), (_intreq))) #define ath_hal_rxprocdesc(_ah, _ds, _dspa, _dsnext, _rs) \ @@ -945,6 +950,15 @@ void ath_intr(void *); #define ath_hal_clr11n_aggr(_ah, _ds) \ ((*(_ah)->ah_clr11nAggr)((_ah), (_ds))) +#define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ + ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) +#define ath_hal_gpioset(_ah, _gpio, _b) \ + ((*(_ah)->ah_gpioSet)((_ah), (_gpio), (_b))) +#define ath_hal_gpioget(_ah, _gpio) \ + ((*(_ah)->ah_gpioGet)((_ah), (_gpio))) +#define ath_hal_gpiosetintr(_ah, _gpio, _b) \ + ((*(_ah)->ah_gpioSetIntr)((_ah), (_gpio), (_b))) + /* * This is badly-named; you need to set the correct parameters * to begin to receive useful radar events; and even then @@ -956,21 +970,13 @@ void ath_intr(void *); #define ath_hal_getdfsthresh(_ah, _param) \ ((*(_ah)->ah_getDfsThresh)((_ah), (_param))) #define ath_hal_procradarevent(_ah, _rxs, _fulltsf, _buf, _event) \ - ((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), (_buf), (_event))) + ((*(_ah)->ah_procRadarEvent)((_ah), (_rxs), (_fulltsf), \ + (_buf), (_event))) #define ath_hal_is_fast_clock_enabled(_ah) \ ((*(_ah)->ah_isFastClockEnabled)((_ah))) - -#define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ - ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) -#define ath_hal_gpioset(_ah, _gpio, _b) \ - ((*(_ah)->ah_gpioSet)((_ah), (_gpio), (_b))) -#define ath_hal_gpioget(_ah, _gpio) \ - ((*(_ah)->ah_gpioGet)((_ah), (_gpio))) -#define ath_hal_gpiosetintr(_ah, _gpio, _b) \ - ((*(_ah)->ah_gpioSetIntr)((_ah), (_gpio), (_b))) -#define ath_hal_radar_wait(_ah, _chan) \ +#define ath_hal_radar_wait(_ah, _chan) \ ((*(_ah)->ah_radarWait)((_ah), (_chan))) -#define ath_hal_get_chan_ext_busy(_ah) \ +#define ath_hal_get_chan_ext_busy(_ah) \ ((*(_ah)->ah_get11nExtBusy)((_ah))) #endif /* _DEV_ATH_ATHVAR_H */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 06:21:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA9CA106566C; Tue, 24 Jan 2012 06:21:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C5FFE8FC08; Tue, 24 Jan 2012 06:21:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0O6Lct2061044; Tue, 24 Jan 2012 06:21:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0O6Lcuc061042; Tue, 24 Jan 2012 06:21:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201240621.q0O6Lcuc061042@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 24 Jan 2012 06:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230494 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 06:21:38 -0000 Author: bz Date: Tue Jan 24 06:21:38 2012 New Revision: 230494 URL: http://svn.freebsd.org/changeset/base/230494 Log: Remove unnecessary line break. MFC after: 3 days Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jan 24 06:12:48 2012 (r230493) +++ head/sys/netinet6/in6.c Tue Jan 24 06:21:38 2012 (r230494) @@ -1387,8 +1387,7 @@ in6_purgeaddr(struct ifaddr *ifa) mltaddr.sin6_family = AF_INET6; mltaddr.sin6_addr = in6addr_linklocal_allnodes; - if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != - 0) + if ((error = in6_setscope(&mltaddr.sin6_addr, ifp, NULL)) != 0) goto cleanup; rt = rtalloc1((struct sockaddr *)&mltaddr, 0, 0UL); From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 08:04:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 892E7106564A; Tue, 24 Jan 2012 08:04:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74F798FC14; Tue, 24 Jan 2012 08:04:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0O84dbs064201; Tue, 24 Jan 2012 08:04:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0O84dLq064199; Tue, 24 Jan 2012 08:04:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201240804.q0O84dLq064199@svn.freebsd.org> From: Martin Matuska Date: Tue, 24 Jan 2012 08:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230495 - head/usr.sbin/jail X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 08:04:39 -0000 Author: mm Date: Tue Jan 24 08:04:38 2012 New Revision: 230495 URL: http://svn.freebsd.org/changeset/base/230495 Log: Try resolving jail path with realpath(3). jail(8) does a chdir(2) to the given path argument. Kernel evaluates the jail path from the new cwd and not from the original cwd, which leads to undesired behavior if given a relative path. Reviewed by: jamie MFC after: 2 weeks Modified: head/usr.sbin/jail/jail.c Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Tue Jan 24 06:21:38 2012 (r230494) +++ head/usr.sbin/jail/jail.c Tue Jan 24 08:04:38 2012 (r230495) @@ -508,6 +508,7 @@ static void set_param(const char *name, char *value) { struct jailparam *param; + char path[PATH_MAX]; int i; static int paramlistsize; @@ -520,8 +521,13 @@ set_param(const char *name, char *value) } /* jail_set won't chdir along with its chroot, so do it here. */ - if (!strcmp(name, "path") && chdir(value) < 0) - err(1, "chdir: %s", value); + if (!strcmp(name, "path")) { + /* resolve the path with realpath(3) */ + if (realpath(value, path) != NULL) + value = path; + if (chdir(value) < 0) + err(1, "chdir: %s", value); + } /* Check for repeat parameters */ for (i = 0; i < nparams; i++) From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 09:51:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6831C106564A; Tue, 24 Jan 2012 09:51:43 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52F5E8FC08; Tue, 24 Jan 2012 09:51:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0O9phYH067629; Tue, 24 Jan 2012 09:51:43 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0O9phn9067627; Tue, 24 Jan 2012 09:51:43 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201240951.q0O9phn9067627@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 24 Jan 2012 09:51:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230496 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 09:51:43 -0000 Author: pluknet Date: Tue Jan 24 09:51:42 2012 New Revision: 230496 URL: http://svn.freebsd.org/changeset/base/230496 Log: Remove the stale XXX rt_newaddrmsg comment. A routing socket message is generated since r192282. Reviewed by: bz MFC after: 3 days Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jan 24 08:04:38 2012 (r230495) +++ head/sys/netinet6/in6.c Tue Jan 24 09:51:42 2012 (r230496) @@ -154,10 +154,6 @@ in6_ifaddloop(struct ifaddr *ifa) ifp = ifa->ifa_ifp; IF_AFDATA_LOCK(ifp); ifa->ifa_rtrequest = nd6_rtrequest; - - /* XXX QL - * we need to report rt_newaddrmsg - */ ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR | LLE_EXCLUSIVE), (struct sockaddr *)&ia->ia_addr); IF_AFDATA_UNLOCK(ifp); From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 10:09:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34B7B106566B; Tue, 24 Jan 2012 10:09:21 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C50918FC12; Tue, 24 Jan 2012 10:09:20 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so6050530obc.13 for ; Tue, 24 Jan 2012 02:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=/3feTYrrQOV3T6qV2zX+CS7WnRuChBsQjO3/V5JAUko=; b=WSRJLFmD7WO6oxZm+YM6mNNKA0MnwKkTpBRL5+HkOZ+sl44bdDXQi9zas9QRozi91J xMmFH4/WD/QBV9te5I8WfPKPghxQXLbRcyFhhyKf96xO/PL33skIEmFpR64euoQBQKli 7v51cKVceqs4aXkO/6FyCCZvVoHp6QrgVnv4E= Received: by 10.182.216.101 with SMTP id op5mr10655002obc.54.1327399760101; Tue, 24 Jan 2012 02:09:20 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.182.2.137 with HTTP; Tue, 24 Jan 2012 02:08:39 -0800 (PST) In-Reply-To: <4F1DE4FF.3080606@FreeBSD.org> References: <201112112102.pBBL21kB068967@svn.freebsd.org> <4F1DE4FF.3080606@FreeBSD.org> From: Ivan Voras Date: Tue, 24 Jan 2012 11:08:39 +0100 X-Google-Sender-Auth: 79P-RlHBDmC-nBCqRvhxJtdJxGw Message-ID: To: Florian Smeets Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r228424 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 10:09:21 -0000 On 23 January 2012 23:53, Florian Smeets wrote: > which creates a database work set of ~1.5GB. Max throughput was achieved > at 20 Clients. > At 40 threads the results varied between 43000 - 76500 across reboots. > Attilio suspects that this can be caused by the kernel memory layout > changing under the woods creating cache effects difficult to control, > therefor the scaling factor was reduced to 10 (~150MB work set) and the > numbers got deterministic across reboot. Or possibly NUMA? Though 40 processes and 1.5 GB seem too low for NUMA effects to be so noticable... Was the round-robin allocator talked about in here: http://lists.freebsd.org/pipermail/freebsd-hackers/2011-October/036525.html ever actually committed? I seem to remember some other thread which said it wasn't yet but can't find it now, and I also cannot find the commit. AFAIK the current state of NUMA is still described in http://svn.freebsd.org/changeset/base/210550 From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 10:21:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C6BF106566C; Tue, 24 Jan 2012 10:21:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id A54BC8FC15; Tue, 24 Jan 2012 10:21:12 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0OAL4Z9001238 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 24 Jan 2012 12:21:05 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0OAL4O3071964; Tue, 24 Jan 2012 12:21:04 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0OAL4Yx071963; Tue, 24 Jan 2012 12:21:04 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 24 Jan 2012 12:21:04 +0200 From: Kostik Belousov To: Mikolaj Golub Message-ID: <20120124102104.GA17476@deviant.kiev.zoral.com.ua> References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> <86lioztzh5.fsf@kopusha.home.net> <20120123153457.GA2246@a91-153-116-96.elisa-laajakaista.fi> <86vco2yvrt.fsf@kopusha.home.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <86vco2yvrt.fsf@kopusha.home.net> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, Jaakko Heinonen , svn-src-all@freebsd.org, src-committers@freebsd.org, Kevin Lo Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 10:21:13 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 23, 2012 at 11:05:42PM +0200, Mikolaj Golub wrote: >=20 > On Mon, 23 Jan 2012 17:34:57 +0200 Jaakko Heinonen wrote: >=20 > JH> On 2012-01-22, Mikolaj Golub wrote: > >> Also, may be we should allow remounting ro (and may be some othe opti= ons) for > >> tmpfs? >=20 > JH> Yes, the patch below does that. I suspect that flipping the MNT_RDON= LY > JH> flag may be enough for tmpfs but I am not sure. >=20 > I see two issues with this patch: >=20 > 1) 'mount -u -o rw /mnt' does not upgrade to rw, although it returns succ= ess. >=20 > 2) if you have a file open for write, after remounting ro you still can w= rite > to the file. The expected behaviour: remount fails with EBUSY if force op= tion > is not specified; after remounting with force writing to the fail fails w= ith EIO. >=20 > I think when remounting ro you should call vflush(), something like below: >=20 > flags =3D WRITECLOSE; > if (mp->mnt_flag & MNT_FORCE) > flags |=3D FORCECLOSE; > error =3D vflush(mp, 0, flags, curthread); > if (error !=3D 0) > return (error); > MNT_ILOCK(mp); > mp->mnt_flag |=3D MNT_RDONLY; > MNT_IUNLOCK(mp); >=20 > and when upgrading to rw reset MNT_RDONLY flag: >=20 > MNT_ILOCK(mp); > mp->mnt_flag &=3D ~MNT_RDONLY; > MNT_IUNLOCK(mp); >=20 > I have no idea if something else is needed for tmpfs. Yes, this is needed but not enough. Since other writeable opens may happen during the vflush(), you might still end up with the mount point which is not safe to set MNT_RDONLY flag. FFS suspends the writes on the mp while doing remount. Other filesystems like tmpfs and nfs could also perform suspend during remounts and unmounts, but the complications are the atime and deferred inactivations. See ufs/ffs/ffs_snapshot.c:process_deferred_inactive(), the handling of IN_LAZYACCESS and ufs_inactive(). --J2SCkAp4GZ/dPZZf Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8ehhAACgkQC3+MBN1Mb4gQ/QCgxb9f+y+6TvmcqNbkINgwJdvt 1wUAn0Z4CQXetSlLYMlJHt9lOSrFLruC =4ICW -----END PGP SIGNATURE----- --J2SCkAp4GZ/dPZZf-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 10:28:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6992C1065673; Tue, 24 Jan 2012 10:28:20 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D0938FC0C; Tue, 24 Jan 2012 10:28:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OASKa0068966; Tue, 24 Jan 2012 10:28:20 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OASKPY068964; Tue, 24 Jan 2012 10:28:20 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201241028.q0OASKPY068964@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 24 Jan 2012 10:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230497 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 10:28:20 -0000 Author: pluknet Date: Tue Jan 24 10:28:19 2012 New Revision: 230497 URL: http://svn.freebsd.org/changeset/base/230497 Log: MFC r230256: Fix the "lock &zrl->zr_mtx already initialized" assertion by initializing the allocated memory before calling mtx_init(9) on mtx pointing to it. Otherwize, random contents of uninitialized memory might occasionally trigger the assertion. Reported by: Pavel Polyakov Reviewed by: pjd Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 24 09:51:42 2012 (r230496) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 24 10:28:19 2012 (r230497) @@ -1077,7 +1077,7 @@ dnode_hold_impl(objset_t *os, uint64_t o if (children_dnodes == NULL) { int i; dnode_children_t *winner; - children_dnodes = kmem_alloc(sizeof (dnode_children_t) + + children_dnodes = kmem_zalloc(sizeof (dnode_children_t) + (epb - 1) * sizeof (dnode_handle_t), KM_SLEEP); children_dnodes->dnc_count = epb; dnh = &children_dnodes->dnc_children[0]; From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 10:32:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AAAD106564A; Tue, 24 Jan 2012 10:32:03 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 483C78FC1E; Tue, 24 Jan 2012 10:32:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OAW3wf069138; Tue, 24 Jan 2012 10:32:03 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OAW30F069136; Tue, 24 Jan 2012 10:32:03 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201241032.q0OAW30F069136@svn.freebsd.org> From: Sergey Kandaurov Date: Tue, 24 Jan 2012 10:32:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230498 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 10:32:03 -0000 Author: pluknet Date: Tue Jan 24 10:32:02 2012 New Revision: 230498 URL: http://svn.freebsd.org/changeset/base/230498 Log: MFC r230256: Fix the "lock &zrl->zr_mtx already initialized" assertion by initializing the allocated memory before calling mtx_init(9) on mtx pointing to it. Otherwize, random contents of uninitialized memory might occasionally trigger the assertion. Reported by: Pavel Polyakov Reviewed by: pjd Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 24 10:28:19 2012 (r230497) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Tue Jan 24 10:32:02 2012 (r230498) @@ -1077,7 +1077,7 @@ dnode_hold_impl(objset_t *os, uint64_t o if (children_dnodes == NULL) { int i; dnode_children_t *winner; - children_dnodes = kmem_alloc(sizeof (dnode_children_t) + + children_dnodes = kmem_zalloc(sizeof (dnode_children_t) + (epb - 1) * sizeof (dnode_handle_t), KM_SLEEP); children_dnodes->dnc_count = epb; dnh = &children_dnodes->dnc_children[0]; From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 10:56:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DEEF1065670; Tue, 24 Jan 2012 10:56:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F087C8FC18; Tue, 24 Jan 2012 10:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OAue7K072052; Tue, 24 Jan 2012 10:56:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OAueHm072050; Tue, 24 Jan 2012 10:56:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201241056.q0OAueHm072050@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Jan 2012 10:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230499 - stable/9/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 10:56:41 -0000 Author: kib Date: Tue Jan 24 10:56:40 2012 New Revision: 230499 URL: http://svn.freebsd.org/changeset/base/230499 Log: MFC r230260: Add macro IS_BSP() to check whether the current CPU is BSP. Modified: stable/9/sys/amd64/include/pcpu.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/pcpu.h ============================================================================== --- stable/9/sys/amd64/include/pcpu.h Tue Jan 24 10:32:02 2012 (r230498) +++ stable/9/sys/amd64/include/pcpu.h Tue Jan 24 10:56:40 2012 (r230499) @@ -226,6 +226,8 @@ __curthread(void) } #define curthread (__curthread()) +#define IS_BSP() (PCPU_GET(cpuid) == 0) + #else /* !lint || defined(__GNUCLIKE_ASM) && defined(__GNUCLIKE___TYPEOF) */ #error "this file needs to be ported to your compiler" From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 11:06:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0CA41065670; Tue, 24 Jan 2012 11:06:22 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFA778FC14; Tue, 24 Jan 2012 11:06:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OB6M31072411; Tue, 24 Jan 2012 11:06:22 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OB6MlK072409; Tue, 24 Jan 2012 11:06:22 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201201241106.q0OB6MlK072409@svn.freebsd.org> From: Alexander Leidinger Date: Tue, 24 Jan 2012 11:06:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230500 - head/tools/kerneldoc/subsys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 11:06:22 -0000 Author: netchild Date: Tue Jan 24 11:06:22 2012 New Revision: 230500 URL: http://svn.freebsd.org/changeset/base/230500 Log: We are in FreeBSD 10 now: define __FreeBSD__ to 10. Modified: head/tools/kerneldoc/subsys/common-Doxyfile Modified: head/tools/kerneldoc/subsys/common-Doxyfile ============================================================================== --- head/tools/kerneldoc/subsys/common-Doxyfile Tue Jan 24 10:56:40 2012 (r230499) +++ head/tools/kerneldoc/subsys/common-Doxyfile Tue Jan 24 11:06:22 2012 (r230500) @@ -231,7 +231,7 @@ INCLUDE_PATH = $(DOXYGEN_SRC_I . INCLUDE_FILE_PATTERNS = *.h PREDEFINED = _KERNEL \ - __FreeBSD__=9 \ + __FreeBSD__=10 \ __${TARGET_ARCH}__=1 \ __${TARGET_ARCH}=1 EXPAND_AS_DEFINED = From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 11:10:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32B8E106566B; Tue, 24 Jan 2012 11:10:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 069F28FC0A; Tue, 24 Jan 2012 11:10:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OBAWxM072605; Tue, 24 Jan 2012 11:10:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OBAWTq072602; Tue, 24 Jan 2012 11:10:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201241110.q0OBAWTq072602@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Jan 2012 11:10:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230501 - in stable/9/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 11:10:33 -0000 Author: kib Date: Tue Jan 24 11:10:32 2012 New Revision: 230501 URL: http://svn.freebsd.org/changeset/base/230501 Log: MFC r230261: Add definitions related to XCR0. Modified: stable/9/sys/amd64/include/specialreg.h stable/9/sys/i386/include/specialreg.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/specialreg.h ============================================================================== --- stable/9/sys/amd64/include/specialreg.h Tue Jan 24 11:06:22 2012 (r230500) +++ stable/9/sys/amd64/include/specialreg.h Tue Jan 24 11:10:32 2012 (r230501) @@ -66,6 +66,7 @@ #define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ #define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ +#define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. @@ -76,6 +77,18 @@ #define EFER_NXE 0x000000800 /* PTE No-Execute bit enable (R/W) */ /* + * Intel Extended Features registers + */ +#define XCR0 0 /* XFEATURE_ENABLED_MASK register */ + +#define XFEATURE_ENABLED_X87 0x00000001 +#define XFEATURE_ENABLED_SSE 0x00000002 +#define XFEATURE_ENABLED_AVX 0x00000004 + +#define XFEATURE_AVX \ + (XFEATURE_ENABLED_X87 | XFEATURE_ENABLED_SSE | XFEATURE_ENABLED_AVX) + +/* * CPUID instruction features register */ #define CPUID_FPU 0x00000001 Modified: stable/9/sys/i386/include/specialreg.h ============================================================================== --- stable/9/sys/i386/include/specialreg.h Tue Jan 24 11:06:22 2012 (r230500) +++ stable/9/sys/i386/include/specialreg.h Tue Jan 24 11:10:32 2012 (r230501) @@ -66,6 +66,7 @@ #define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ #define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ +#define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 11:28:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BB261065677; Tue, 24 Jan 2012 11:28:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19CA58FC12; Tue, 24 Jan 2012 11:28:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OBSrd8073218; Tue, 24 Jan 2012 11:28:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OBSrvP073216; Tue, 24 Jan 2012 11:28:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201241128.q0OBSrvP073216@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Jan 2012 11:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230502 - stable/9/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 11:28:54 -0000 Author: kib Date: Tue Jan 24 11:28:53 2012 New Revision: 230502 URL: http://svn.freebsd.org/changeset/base/230502 Log: MFC r230262: Implement xsetbv(), xsave() and xrstor(). Modified: stable/9/sys/amd64/include/cpufunc.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/cpufunc.h ============================================================================== --- stable/9/sys/amd64/include/cpufunc.h Tue Jan 24 11:10:32 2012 (r230501) +++ stable/9/sys/amd64/include/cpufunc.h Tue Jan 24 11:28:53 2012 (r230502) @@ -669,6 +669,41 @@ intr_restore(register_t rflags) write_rflags(rflags); } +static __inline void +xsetbv(uint32_t reg, uint64_t val) +{ + uint32_t low, hi; + + low = val; + hi = val >> 32; + __asm __volatile(".byte 0x0f,0x01,0xd1" : : + "c" (reg), "a" (low), "d" (hi)); +} + +static __inline void +xsave(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + /* xsave (%rdi) */ + __asm __volatile(".byte 0x0f,0xae,0x27" : : + "a" (low), "d" (hi), "D" (addr) : "memory"); +} + +static __inline void +xrstor(char *addr, uint64_t mask) +{ + uint32_t low, hi; + + low = mask; + hi = mask >> 32; + /* xrstor (%rdi) */ + __asm __volatile(".byte 0x0f,0xae,0x2f" : : + "a" (low), "d" (hi), "D" (addr)); +} + #else /* !(__GNUCLIKE_ASM && __CC_SUPPORTS___INLINE) */ int breakpoint(void); @@ -733,6 +768,9 @@ u_int rgs(void); void wbinvd(void); void write_rflags(u_int rf); void wrmsr(u_int msr, uint64_t newval); +void xsetbv(uint32_t reg, uint64_t val); +void xsave(char *addr, uint64_t mask); +void xrstor(char *addr, uint64_t mask); #endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 11:42:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09E4A106566B; Tue, 24 Jan 2012 11:42:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1A7D8FC0A; Tue, 24 Jan 2012 11:42:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OBgkSb073691; Tue, 24 Jan 2012 11:42:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OBgkiT073689; Tue, 24 Jan 2012 11:42:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201241142.q0OBgkiT073689@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Jan 2012 11:42:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230503 - stable/9/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 11:42:47 -0000 Author: kib Date: Tue Jan 24 11:42:46 2012 New Revision: 230503 URL: http://svn.freebsd.org/changeset/base/230503 Log: MFC r230269: Modernize the fpusave structures definitions by using uint*_t types. Modified: stable/9/sys/amd64/include/fpu.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/fpu.h ============================================================================== --- stable/9/sys/amd64/include/fpu.h Tue Jan 24 11:28:53 2012 (r230502) +++ stable/9/sys/amd64/include/fpu.h Tue Jan 24 11:42:46 2012 (r230503) @@ -43,34 +43,39 @@ /* Contents of each x87 floating point accumulator */ struct fpacc87 { - u_char fp_bytes[10]; + uint8_t fp_bytes[10]; }; /* Contents of each SSE extended accumulator */ struct xmmacc { - u_char xmm_bytes[16]; + uint8_t xmm_bytes[16]; +}; + +/* Contents of the upper 16 bytes of each AVX extended accumulator */ +struct ymmacc { + uint8_t ymm_bytes[16]; }; struct envxmm { - u_int16_t en_cw; /* control word (16bits) */ - u_int16_t en_sw; /* status word (16bits) */ - u_int8_t en_tw; /* tag word (8bits) */ - u_int8_t en_zero; - u_int16_t en_opcode; /* opcode last executed (11 bits ) */ - u_int64_t en_rip; /* floating point instruction pointer */ - u_int64_t en_rdp; /* floating operand pointer */ - u_int32_t en_mxcsr; /* SSE sontorol/status register */ - u_int32_t en_mxcsr_mask; /* valid bits in mxcsr */ + uint16_t en_cw; /* control word (16bits) */ + uint16_t en_sw; /* status word (16bits) */ + uint8_t en_tw; /* tag word (8bits) */ + uint8_t en_zero; + uint16_t en_opcode; /* opcode last executed (11 bits ) */ + uint64_t en_rip; /* floating point instruction pointer */ + uint64_t en_rdp; /* floating operand pointer */ + uint32_t en_mxcsr; /* SSE sontorol/status register */ + uint32_t en_mxcsr_mask; /* valid bits in mxcsr */ }; struct savefpu { struct envxmm sv_env; struct { struct fpacc87 fp_acc; - u_char fp_pad[6]; /* padding */ + uint8_t fp_pad[6]; /* padding */ } sv_fp[8]; struct xmmacc sv_xmm[16]; - u_char sv_pad[96]; + uint8_t sv_pad[96]; } __aligned(16); #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 11:48:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AF3C01065677; Tue, 24 Jan 2012 11:48:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F078FC14; Tue, 24 Jan 2012 11:48:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OBm6UI073920; Tue, 24 Jan 2012 11:48:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OBm6qv073917; Tue, 24 Jan 2012 11:48:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201241148.q0OBm6qv073917@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 24 Jan 2012 11:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230504 - in stable/9/sys: amd64/include i386/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 11:48:06 -0000 Author: kib Date: Tue Jan 24 11:48:06 2012 New Revision: 230504 URL: http://svn.freebsd.org/changeset/base/230504 Log: MFC r230270: Add definitions for the FPU extended state header, legacy extended state and AVX state. Modified: stable/9/sys/amd64/include/fpu.h stable/9/sys/i386/include/npx.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/include/fpu.h ============================================================================== --- stable/9/sys/amd64/include/fpu.h Tue Jan 24 11:42:46 2012 (r230503) +++ stable/9/sys/amd64/include/fpu.h Tue Jan 24 11:48:06 2012 (r230504) @@ -78,6 +78,28 @@ struct savefpu { uint8_t sv_pad[96]; } __aligned(16); +struct xstate_hdr { + uint64_t xstate_bv; + uint8_t xstate_rsrv0[16]; + uint8_t xstate_rsrv[40]; +}; + +struct savefpu_xstate { + struct xstate_hdr sx_hd; + struct ymmacc sx_ymm[16]; +}; + +struct savefpu_ymm { + struct envxmm sv_env; + struct { + struct fpacc87 fp_acc; + int8_t fp_pad[6]; /* padding */ + } sv_fp[8]; + struct xmmacc sv_xmm[16]; + uint8_t sv_pad[96]; + struct savefpu_xstate sv_xstate; +} __aligned(64); + #ifdef _KERNEL struct fpu_kern_ctx { struct savefpu hwstate; Modified: stable/9/sys/i386/include/npx.h ============================================================================== --- stable/9/sys/i386/include/npx.h Tue Jan 24 11:42:46 2012 (r230503) +++ stable/9/sys/i386/include/npx.h Tue Jan 24 11:48:06 2012 (r230504) @@ -101,6 +101,11 @@ struct xmmacc { u_char xmm_bytes[16]; }; +/* Contents of the upper 16 bytes of each AVX extended accumulator */ +struct ymmacc { + uint8_t ymm_bytes[16]; +}; + struct savexmm { struct envxmm sv_env; struct { @@ -116,6 +121,28 @@ union savefpu { struct savexmm sv_xmm; }; +struct xstate_hdr { + uint64_t xstate_bv; + uint8_t xstate_rsrv0[16]; + uint8_t xstate_rsrv[40]; +}; + +struct savexmm_xstate { + struct xstate_hdr sx_hd; + struct ymmacc sx_ymm[16]; +}; + +struct savexmm_ymm { + struct envxmm sv_env; + struct { + struct fpacc87 fp_acc; + int8_t fp_pad[6]; /* padding */ + } sv_fp[8]; + struct xmmacc sv_xmm[16]; + uint8_t sv_pad[96]; + struct savexmm_xstate sv_xstate; +} __aligned(64); + /* * The hardware default control word for i387's and later coprocessors is * 0x37F, giving: From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 13:23:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94B1C106566B; Tue, 24 Jan 2012 13:23:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81BE88FC08; Tue, 24 Jan 2012 13:23:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0ODNqtR077048; Tue, 24 Jan 2012 13:23:52 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ODNqu4077045; Tue, 24 Jan 2012 13:23:52 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201201241323.q0ODNqu4077045@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 24 Jan 2012 13:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230505 - head/tools/regression/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 13:23:52 -0000 Author: trasz Date: Tue Jan 24 13:23:52 2012 New Revision: 230505 URL: http://svn.freebsd.org/changeset/base/230505 Log: Add some basic regression tests for mdconfig(8). Added: head/tools/regression/mdconfig/ head/tools/regression/mdconfig/00.t (contents, props changed) head/tools/regression/mdconfig/mdconfig.test (contents, props changed) head/tools/regression/mdconfig/run (contents, props changed) Added: head/tools/regression/mdconfig/00.t ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/mdconfig/00.t Tue Jan 24 13:23:52 2012 (r230505) @@ -0,0 +1,47 @@ +#!/bin/sh +# +# Copyright (c) 2012 Edward Tomasz Napierała +# 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$ +# + +# This is a wrapper script to run mdconfig.test. + +echo "1..1" + +if [ `whoami` != "root" ]; then + echo "not ok 1 - you need to be root to run this test." + exit 1 +fi + +TESTDIR=$(dirname $(realpath $0)) + +perl $TESTDIR/run $TESTDIR/mdconfig.test > /dev/null + +if [ $? -eq 0 ]; then + echo "ok 1" +else + echo "not ok 1" +fi Added: head/tools/regression/mdconfig/mdconfig.test ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/mdconfig/mdconfig.test Tue Jan 24 13:23:52 2012 (r230505) @@ -0,0 +1,192 @@ +# Copyright (c) 2012 Edward Tomasz Napierała +# 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$ +# + +# This is a test for mdconfig(8) functionality. Run it as root: +# +# /usr/src/tools/regression/mdconfig/run /usr/src/tools/regression/mdconfig/mdconfig.test +# +# WARNING: Creates files in unsafe way. + +$ whoami +> root +$ umask 022 +$ truncate -s 1gb xxx + +$ mdconfig -l + +$ mdconfig -af xxx +> md0 + +# This awk thing is to strip the file path. +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md0 vnode 1024M + +$ diskinfo -v /dev/md0 | expand +> /dev/md0 +> 512 # sectorsize +> 1073741824 # mediasize in bytes (1.0G) +> 2097152 # mediasize in sectors +> 0 # stripesize +> 0 # stripeoffset +> + +$ mdconfig -du 0 + +# Check different valid syntax variations: implicit -a. + +$ mdconfig xxx +> md0 + +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md0 vnode 1024M + +$ diskinfo -v /dev/md0 | expand +> /dev/md0 +> 512 # sectorsize +> 1073741824 # mediasize in bytes (1.0G) +> 2097152 # mediasize in sectors +> 0 # stripesize +> 0 # stripeoffset +> + +$ mdconfig -du 0 + +# Explicit -t vnode. + +$ mdconfig -a -t vnode -f xxx +> md0 + +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md0 vnode 1024M + +$ diskinfo -v /dev/md0 | expand +> /dev/md0 +> 512 # sectorsize +> 1073741824 # mediasize in bytes (1.0G) +> 2097152 # mediasize in sectors +> 0 # stripesize +> 0 # stripeoffset +> + +$ mdconfig -du 0 + +# Size for vnodes - smaller than the actual file. + +$ mdconfig -a -t vnode -f xxx -s 128m +> md0 + +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md0 vnode 128M + +$ diskinfo -v /dev/md0 | expand +> /dev/md0 +> 512 # sectorsize +> 134217728 # mediasize in bytes (128M) +> 262144 # mediasize in sectors +> 0 # stripesize +> 0 # stripeoffset +> + +$ mdconfig -du 0 + +# Size for vnodes - larger than the actual file. + +$ mdconfig -a -t vnode -f xxx -s 128g +> md0 + +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md0 vnode 128G + +$ diskinfo -v /dev/md0 | expand +> /dev/md0 +> 512 # sectorsize +> 137438953472 # mediasize in bytes (128G) +> 268435456 # mediasize in sectors +> 0 # stripesize +> 0 # stripeoffset +> + +$ mdconfig -du 0 + +# Sector size for vnodes. + +$ mdconfig -a -t vnode -f xxx -S 2048 +> md0 + +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md0 vnode 1024M + +$ diskinfo -v /dev/md0 | expand +> /dev/md0 +> 2048 # sectorsize +> 1073741824 # mediasize in bytes (1.0G) +> 524288 # mediasize in sectors +> 0 # stripesize +> 0 # stripeoffset +> + +$ mdconfig -du 0 + +# Malloc type. + +$ mdconfig -a -t malloc -s 1g +> md0 + +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md0 malloc 1024M + +$ diskinfo -v /dev/md0 | expand +> /dev/md0 +> 512 # sectorsize +> 1073741824 # mediasize in bytes (1.0G) +> 2097152 # mediasize in sectors +> 0 # stripesize +> 0 # stripeoffset +> + +$ mdconfig -du 0 + +# Swap type. + +$ mdconfig -a -t swap -s 1g +> md0 + +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md0 swap 1024M + +$ diskinfo -v /dev/md0 | expand +> /dev/md0 +> 512 # sectorsize +> 1073741824 # mediasize in bytes (1.0G) +> 2097152 # mediasize in sectors +> 0 # stripesize +> 0 # stripeoffset +> + +$ mdconfig -du 0 + +$ rm xxx Added: head/tools/regression/mdconfig/run ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/mdconfig/run Tue Jan 24 13:23:52 2012 (r230505) @@ -0,0 +1,329 @@ +#!/usr/bin/perl -w -U + +# Copyright (c) 2007, 2008 Andreas Gruenbacher. +# 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, +# without modification, immediately at the beginning of the file. +# 2. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# Alternatively, this software may be distributed under the terms of the +# GNU Public License ("GPL"). +# +# 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$ +# + +# +# Possible improvements: +# +# - distinguish stdout and stderr output +# - add environment variable like assignments +# - run up to a specific line +# - resume at a specific line +# + +use strict; +use FileHandle; +use Getopt::Std; +use POSIX qw(isatty setuid getcwd); +use vars qw($opt_l $opt_v); + +no warnings qw(taint); + +$opt_l = ~0; # a really huge number +getopts('l:v'); + +my ($OK, $FAILED) = ("ok", "failed"); +if (isatty(fileno(STDOUT))) { + $OK = "\033[32m" . $OK . "\033[m"; + $FAILED = "\033[31m\033[1m" . $FAILED . "\033[m"; +} + +sub exec_test($$); +sub process_test($$$$); + +my ($prog, $in, $out) = ([], [], []); +my $prog_line = 0; +my ($tests, $failed) = (0,0); +my $lineno; +my $width = ($ENV{COLUMNS} || 80) >> 1; + +for (;;) { + my $line = <>; $lineno++; + if (defined $line) { + # Substitute %VAR and %{VAR} with environment variables. + $line =~ s[%(\w+)][$ENV{$1}]eg; + $line =~ s[%{(\w+)}][$ENV{$1}]eg; + } + if (defined $line) { + if ($line =~ s/^\s*< ?//) { + push @$in, $line; + } elsif ($line =~ s/^\s*> ?//) { + push @$out, $line; + } else { + process_test($prog, $prog_line, $in, $out); + last if $prog_line >= $opt_l; + + $prog = []; + $prog_line = 0; + } + if ($line =~ s/^\s*\$ ?//) { + $prog = [ map { s/\\(.)/$1/g; $_ } split /(? @$result) ? @$out : @$result; + for (my $n=0; $n < $nmax; $n++) { + my $use_re; + if (defined $out->[$n] && $out->[$n] =~ /^~ /) { + $use_re = 1; + $out->[$n] =~ s/^~ //g; + } + + if (!defined($out->[$n]) || !defined($result->[$n]) || + (!$use_re && $result->[$n] ne $out->[$n]) || + ( $use_re && $result->[$n] !~ /^$out->[$n]/)) { + push @good, ($use_re ? '!~' : '!='); + } + else { + push @good, ($use_re ? '=~' : '=='); + } + } + my $good = !(grep /!/, @good); + $tests++; + $failed++ unless $good; + print $good ? $OK : $FAILED, "\n"; + if (!$good || $opt_v) { + for (my $n=0; $n < $nmax; $n++) { + my $l = defined($out->[$n]) ? $out->[$n] : "~"; + chomp $l; + my $r = defined($result->[$n]) ? $result->[$n] : "~"; + chomp $r; + print sprintf("%-" . ($width-3) . "s %s %s\n", + $r, $good[$n], $l); + } + } +} + + +sub su($) { + my ($user) = @_; + + $user ||= "root"; + + my ($login, $pass, $uid, $gid) = getpwnam($user) + or return [ "su: user $user does not exist\n" ]; + my @groups = (); + my $fh = new FileHandle("/etc/group") + or return [ "opening /etc/group: $!\n" ]; + while (<$fh>) { + chomp; + my ($group, $passwd, $gid, $users) = split /:/; + foreach my $u (split /,/, $users) { + push @groups, $gid + if ($user eq $u); + } + } + $fh->close; + + my $groups = join(" ", ($gid, $gid, @groups)); + #print STDERR "[[$groups]]\n"; + $! = 0; # reset errno + $> = 0; + $( = $gid; + $) = $groups; + if ($!) { + return [ "su: $!\n" ]; + } + if ($uid != 0) { + $> = $uid; + #$< = $uid; + if ($!) { + return [ "su: $prog->[1]: $!\n" ]; + } + } + #print STDERR "[($>,$<)($(,$))]"; + return []; +} + + +sub sg($) { + my ($group) = @_; + + my $gid = getgrnam($group) + or return [ "sg: group $group does not exist\n" ]; + my %groups = map { $_ eq $gid ? () : ($_ => 1) } (split /\s/, $)); + + #print STDERR "<<", join("/", keys %groups), ">>\n"; + my $groups = join(" ", ($gid, $gid, keys %groups)); + #print STDERR "[[$groups]]\n"; + $! = 0; # reset errno + if ($> != 0) { + my $uid = $>; + $> = 0; + $( = $gid; + $) = $groups; + $> = $uid; + } else { + $( = $gid; + $) = $groups; + } + if ($!) { + return [ "sg: $!\n" ]; + } + print STDERR "[($>,$<)($(,$))]"; + return []; +} + + +sub exec_test($$) { + my ($prog, $in) = @_; + local (*IN, *IN_DUP, *IN2, *OUT_DUP, *OUT, *OUT2); + my $needs_shell = (join('', @$prog) =~ /[][|<>"'`\$\*\?]/); + + if ($prog->[0] eq "umask") { + umask oct $prog->[1]; + return []; + } elsif ($prog->[0] eq "cd") { + if (!chdir $prog->[1]) { + return [ "chdir: $prog->[1]: $!\n" ]; + } + $ENV{PWD} = getcwd; + return []; + } elsif ($prog->[0] eq "su") { + return su($prog->[1]); + } elsif ($prog->[0] eq "sg") { + return sg($prog->[1]); + } elsif ($prog->[0] eq "export") { + my ($name, $value) = split /=/, $prog->[1]; + # FIXME: need to evaluate $value, so that things like this will work: + # export dir=$PWD/dir + $ENV{$name} = $value; + return []; + } elsif ($prog->[0] eq "unset") { + delete $ENV{$prog->[1]}; + return []; + } + + pipe *IN2, *OUT + or die "Can't create pipe for reading: $!"; + open *IN_DUP, "<&STDIN" + or *IN_DUP = undef; + open *STDIN, "<&IN2" + or die "Can't duplicate pipe for reading: $!"; + close *IN2; + + open *OUT_DUP, ">&STDOUT" + or die "Can't duplicate STDOUT: $!"; + pipe *IN, *OUT2 + or die "Can't create pipe for writing: $!"; + open *STDOUT, ">&OUT2" + or die "Can't duplicate pipe for writing: $!"; + close *OUT2; + + *STDOUT->autoflush(); + *OUT->autoflush(); + + $SIG{CHLD} = 'IGNORE'; + + if (fork()) { + # Server + if (*IN_DUP) { + open *STDIN, "<&IN_DUP" + or die "Can't duplicate STDIN: $!"; + close *IN_DUP + or die "Can't close STDIN duplicate: $!"; + } + open *STDOUT, ">&OUT_DUP" + or die "Can't duplicate STDOUT: $!"; + close *OUT_DUP + or die "Can't close STDOUT duplicate: $!"; + + foreach my $line (@$in) { + #print "> $line"; + print OUT $line; + } + close *OUT + or die "Can't close pipe for writing: $!"; + + my $result = []; + while () { + #print "< $_"; + if ($needs_shell) { + s#^/bin/sh: line \d+: ##; + } + push @$result, $_; + } + return $result; + } else { + # Client + $< = $>; + close IN + or die "Can't close read end for input pipe: $!"; + close OUT + or die "Can't close write end for output pipe: $!"; + close OUT_DUP + or die "Can't close STDOUT duplicate: $!"; + local *ERR_DUP; + open ERR_DUP, ">&STDERR" + or die "Can't duplicate STDERR: $!"; + open STDERR, ">&STDOUT" + or die "Can't join STDOUT and STDERR: $!"; + + if ($needs_shell) { + exec ('/bin/sh', '-c', join(" ", @$prog)); + } else { + exec @$prog; + } + print STDERR $prog->[0], ": $!\n"; + exit; + } +} + From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 13:57:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C7BF91065670; Tue, 24 Jan 2012 13:57:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B6EE48FC14; Tue, 24 Jan 2012 13:57:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0ODvUZE078116; Tue, 24 Jan 2012 13:57:30 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ODvUfa078114; Tue, 24 Jan 2012 13:57:30 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201241357.q0ODvUfa078114@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 24 Jan 2012 13:57:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230506 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 13:57:30 -0000 Author: bz Date: Tue Jan 24 13:57:30 2012 New Revision: 230506 URL: http://svn.freebsd.org/changeset/base/230506 Log: Plug a possible ifa_ref leak in case of premature return from in6_purgeaddr(). Reviewed by: rwatson MFC after: 3 days Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jan 24 13:23:52 2012 (r230505) +++ head/sys/netinet6/in6.c Tue Jan 24 13:57:30 2012 (r230506) @@ -1477,6 +1477,8 @@ in6_purgeaddr(struct ifaddr *ifa) } cleanup: + if (ifa0 != NULL) + ifa_free(ifa0); plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */ if ((ia->ia_flags & IFA_ROUTE) && plen == 128) { @@ -1501,8 +1503,6 @@ cleanup: return; ia->ia_flags &= ~IFA_ROUTE; } - if (ifa0 != NULL) - ifa_free(ifa0); in6_unlink_ifa(ia, ifp); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 14:17:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1205D106564A; Tue, 24 Jan 2012 14:17:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00A9B8FC08; Tue, 24 Jan 2012 14:17:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OEHD54078778; Tue, 24 Jan 2012 14:17:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OEHDNm078776; Tue, 24 Jan 2012 14:17:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201241417.q0OEHDNm078776@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Jan 2012 14:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230507 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 14:17:14 -0000 Author: mav Date: Tue Jan 24 14:17:13 2012 New Revision: 230507 URL: http://svn.freebsd.org/changeset/base/230507 Log: HDMI and DisplayPort support can coexist in HDA CODEC. Report "HDMI/DP" in PCM device name if both supported. MFC after: 2 months Sponsored by: iXsystems, Inc. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Tue Jan 24 13:57:30 2012 (r230506) +++ head/sys/dev/sound/pci/hda/hdaa.c Tue Jan 24 14:17:13 2012 (r230507) @@ -2793,12 +2793,11 @@ hdaa_audio_as_parse(struct hdaa_devinfo as[cnt].enable = 0; } if (HDA_PARAM_AUDIO_WIDGET_CAP_DIGITAL(w->param.widget_cap)) { + as[cnt].digital |= 0x1; + if (HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) + as[cnt].digital |= 0x2; if (HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap)) - as[cnt].digital = 3; - else if (HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) - as[cnt].digital = 2; - else - as[cnt].digital = 1; + as[cnt].digital |= 0x4; } if (as[cnt].location == -1) { as[cnt].location = @@ -6514,9 +6513,10 @@ hdaa_pcm_probe(device_t dev) snprintf(buf, sizeof(buf), "%s PCM (%s%s%s%s%s%s%s)", device_get_desc(device_get_parent(device_get_parent(dev))), loc1 >= 0 ? HDA_LOCS[loc1] : "", loc1 >= 0 ? " " : "", - (pdevinfo->digital == 3)?"DisplayPort": - ((pdevinfo->digital == 2)?"HDMI": - ((pdevinfo->digital)?"Digital":"Analog")), + (pdevinfo->digital == 0x7)?"HDMI/DP": + ((pdevinfo->digital == 0x5)?"DisplayPort": + ((pdevinfo->digital == 0x3)?"HDMI": + ((pdevinfo->digital)?"Digital":"Analog"))), chans1[0] ? " " : "", chans1, chans2[0] ? "/" : "", chans2); device_set_desc_copy(dev, buf); From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 14:27:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6CB9106566B; Tue, 24 Jan 2012 14:27:14 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 95C098FC1A; Tue, 24 Jan 2012 14:27:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OERE9a079208; Tue, 24 Jan 2012 14:27:14 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OERE7m079206; Tue, 24 Jan 2012 14:27:14 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201241427.q0OERE7m079206@svn.freebsd.org> From: Gleb Smirnoff Date: Tue, 24 Jan 2012 14:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230508 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 14:27:14 -0000 Author: glebius Date: Tue Jan 24 14:27:14 2012 New Revision: 230508 URL: http://svn.freebsd.org/changeset/base/230508 Log: Remove unused variable. Modified: head/sys/netinet/in_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Tue Jan 24 14:17:13 2012 (r230507) +++ head/sys/netinet/in_mcast.c Tue Jan 24 14:27:14 2012 (r230508) @@ -1178,11 +1178,8 @@ out_inm_release: int in_leavegroup(struct in_multi *inm, /*const*/ struct in_mfilter *imf) { - struct ifnet *ifp; int error; - ifp = inm->inm_ifp; - IN_MULTI_LOCK(); error = in_leavegroup_locked(inm, imf); IN_MULTI_UNLOCK(); From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 15:13:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 070F7106564A; Tue, 24 Jan 2012 15:13:56 +0000 (UTC) (envelope-from netchild@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA00B8FC08; Tue, 24 Jan 2012 15:13:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OFDtDe080663; Tue, 24 Jan 2012 15:13:55 GMT (envelope-from netchild@svn.freebsd.org) Received: (from netchild@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OFDtfM080661; Tue, 24 Jan 2012 15:13:55 GMT (envelope-from netchild@svn.freebsd.org) Message-Id: <201201241513.q0OFDtfM080661@svn.freebsd.org> From: Alexander Leidinger Date: Tue, 24 Jan 2012 15:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230509 - head/tools/kerneldoc/subsys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 15:13:56 -0000 Author: netchild Date: Tue Jan 24 15:13:55 2012 New Revision: 230509 URL: http://svn.freebsd.org/changeset/base/230509 Log: Just define __FreeBSD__ to 1 instead of doing what the compiler does. The kernel is supposed to DTRT based upon the __FreeBSD_version value, not the value of __FreeBSD__. Discussed with: bz Modified: head/tools/kerneldoc/subsys/common-Doxyfile Modified: head/tools/kerneldoc/subsys/common-Doxyfile ============================================================================== --- head/tools/kerneldoc/subsys/common-Doxyfile Tue Jan 24 14:27:14 2012 (r230508) +++ head/tools/kerneldoc/subsys/common-Doxyfile Tue Jan 24 15:13:55 2012 (r230509) @@ -230,8 +230,12 @@ SEARCH_INCLUDES = YES INCLUDE_PATH = $(DOXYGEN_SRC_INCLUDE_PATH) \ . INCLUDE_FILE_PATTERNS = *.h +# __FreeBSD__ is normally defined to the the major version number of +# FreeBSD. In the kernel source it is just checked for != 0, and +# __FreeBSD_version is used for version dependend code. +# To make live simple on major version bumps, just define __FreeBSD__ to 1. PREDEFINED = _KERNEL \ - __FreeBSD__=10 \ + __FreeBSD__=1 \ __${TARGET_ARCH}__=1 \ __${TARGET_ARCH}=1 EXPAND_AS_DEFINED = From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 15:15:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9E5D106566B; Tue, 24 Jan 2012 15:15:28 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id 6953E8FC0A; Tue, 24 Jan 2012 15:15:28 +0000 (UTC) Received: from jh (a91-153-115-208.elisa-laajakaista.fi [91.153.115.208]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 5EACB15165C; Tue, 24 Jan 2012 17:15:21 +0200 (EET) Date: Tue, 24 Jan 2012 17:15:20 +0200 From: Jaakko Heinonen To: Mikolaj Golub Message-ID: <20120124151520.GA67038@jh> References: <201201170125.q0H1PrlJ061058@svn.freebsd.org> <20120117171031.GA2316@a91-153-116-96.elisa-laajakaista.fi> <86obtvvr4v.fsf@kopusha.home.net> <20120122134218.GA2247@a91-153-116-96.elisa-laajakaista.fi> <86lioztzh5.fsf@kopusha.home.net> <20120123153457.GA2246@a91-153-116-96.elisa-laajakaista.fi> <86vco2yvrt.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86vco2yvrt.fsf@kopusha.home.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, Kevin Lo , svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230252 - head/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 15:15:28 -0000 On 2012-01-23, Mikolaj Golub wrote: > JH> Yes, the patch below does that. I suspect that flipping the MNT_RDONLY > JH> flag may be enough for tmpfs but I am not sure. > > I see two issues with this patch: > > 1) 'mount -u -o rw /mnt' does not upgrade to rw, although it returns success. Argh, this is another nmount(2) bug. The update mount code automatically sets the MNT_RDONLY flag but doesn't unset it. However the string option always gets updated causing string options and flags to get out of sync. Flags covered by MNT_UPDATEMASK are unset automatically. > I think when remounting ro you should call vflush(), something like below: Right. Thanks for looking at the patch! -- Jaakko From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 15:20:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48DC7106566C; Tue, 24 Jan 2012 15:20:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 382C28FC12; Tue, 24 Jan 2012 15:20:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OFKW02080891; Tue, 24 Jan 2012 15:20:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OFKW0x080889; Tue, 24 Jan 2012 15:20:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201201241520.q0OFKW0x080889@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 24 Jan 2012 15:20:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230510 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 15:20:32 -0000 Author: bz Date: Tue Jan 24 15:20:31 2012 New Revision: 230510 URL: http://svn.freebsd.org/changeset/base/230510 Log: Replace random ARIN direct assignment legacy IPs with proper RFC 5735 TEST-NET1 block for use in documentation and example code addresses. MFC after: 3 days Modified: head/sys/net/route.c Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Jan 24 15:13:55 2012 (r230509) +++ head/sys/net/route.c Tue Jan 24 15:20:31 2012 (r230510) @@ -1498,10 +1498,10 @@ rtinit1(struct ifaddr *ifa, int cmd, int #ifdef RADIX_MPATH /* * in case address alias finds the first address - * e.g. ifconfig bge0 192.103.54.246/24 - * e.g. ifconfig bge0 192.103.54.247/24 - * the address set in the route is 192.103.54.246 - * so we need to replace it with 192.103.54.247 + * e.g. ifconfig bge0 192.0.2.246/24 + * e.g. ifconfig bge0 192.0.2.247/24 + * the address set in the route is 192.0.2.246 + * so we need to replace it with 192.0.2.247 */ if (memcmp(rt->rt_ifa->ifa_addr, ifa->ifa_addr, ifa->ifa_addr->sa_len)) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 15:30:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49D8110656AC; Tue, 24 Jan 2012 15:30:19 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 25B348FC13; Tue, 24 Jan 2012 15:30:18 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 372F125D386D; Tue, 24 Jan 2012 15:30:17 +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 5F216BD9DE5; Tue, 24 Jan 2012 15:30:16 +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 Fg+DnWH4PPVb; Tue, 24 Jan 2012 15:30:15 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 42DBABD9DE3; Tue, 24 Jan 2012 15:30:15 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201201241513.q0OFDtfM080661@svn.freebsd.org> Date: Tue, 24 Jan 2012 15:30:14 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <85825935-7581-4CDB-8D4F-DA5CF935492C@FreeBSD.org> References: <201201241513.q0OFDtfM080661@svn.freebsd.org> To: Alexander Leidinger X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230509 - head/tools/kerneldoc/subsys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 15:30:19 -0000 On 24. Jan 2012, at 15:13 , Alexander Leidinger wrote: > Author: netchild > Date: Tue Jan 24 15:13:55 2012 > New Revision: 230509 > URL: http://svn.freebsd.org/changeset/base/230509 >=20 > Log: > Just define __FreeBSD__ to 1 instead of doing what the compiler does. > The kernel is supposed to DTRT based upon the __FreeBSD_version = value, > not the value of __FreeBSD__. >=20 > Discussed with: bz >=20 > Modified: > head/tools/kerneldoc/subsys/common-Doxyfile >=20 > Modified: head/tools/kerneldoc/subsys/common-Doxyfile > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/tools/kerneldoc/subsys/common-Doxyfile Tue Jan 24 = 14:27:14 2012 (r230508) > +++ head/tools/kerneldoc/subsys/common-Doxyfile Tue Jan 24 = 15:13:55 2012 (r230509) > @@ -230,8 +230,12 @@ SEARCH_INCLUDES =3D YES > INCLUDE_PATH =3D $(DOXYGEN_SRC_INCLUDE_PATH) \ > . > INCLUDE_FILE_PATTERNS =3D *.h > +# __FreeBSD__ is normally defined to the the major version number of > +# FreeBSD. In the kernel source it is just checked for !=3D 0, and That's not what it is and not what I said. It's checked to be defined. = Defining it to 0 or even nothing will still be perfectly ok. Try cpp on this: #define FOO #ifdef FOO #warning "It works" #endif #define BAR 0 #ifdef BAR #warning "It still works" #endif #define BAZ 42 #ifdef BAZ #warning "You guessed it. It still works" #endif #ifdef NOWAY #warning "You shall never see this" #endif > +# __FreeBSD_version is used for version dependend code. > +# To make live simple on major version bumps, just define __FreeBSD__ = to 1. > PREDEFINED =3D _KERNEL \ > - __FreeBSD__=3D10 \ > + __FreeBSD__=3D1 \ > __${TARGET_ARCH}__=3D1 \ > __${TARGET_ARCH}=3D1 > EXPAND_AS_DEFINED =3D=20 --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 15:34:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B79C21065673; Tue, 24 Jan 2012 15:34:43 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 788F38FC13; Tue, 24 Jan 2012 15:34:43 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q0OFYOsG049362; Tue, 24 Jan 2012 09:34:24 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q0OFYGJE056803 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 24 Jan 2012 09:34:17 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q0OFYGJE056803 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1327419257; bh=+Z88rYjFimCHLRDeWbNgBvqXk/BnCUUmiq+5Ky6CfTI=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=mIGvB9fbDiTkL62qowEAYAd7z4WeqS/f3zKlWc2CzVGVLHQ8Tg0oK8zCOXByyHH3e klJ7MlnWo0X8NEwzzjxEEUILKieeI8m33Dv4c3NTzfyoa2dtKw/QzWF8umZXopPgxz u4rECRc7mktKI3cvwU8X8Au6aCtPBaOVb+isuV4k= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Guy Helmer In-Reply-To: <4F078EC4.2090802@FreeBSD.org> Date: Tue, 24 Jan 2012 09:34:21 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <124C24A6-1E2A-4D30-9ED5-7F717C2E2A4D@palisadesystems.com> References: <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org> <4F078EC4.2090802@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Tue, 24 Jan 2012 09:34:17 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q0OFYGJE056803 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.628, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 15:34:43 -0000 On Jan 6, 2012, at 6:16 PM, Doug Barton wrote: > On 01/06/2012 08:18, Guy Helmer wrote: >> On Jan 5, 2012, at 8:58 PM, Doug Barton wrote: >>=20 >>> On 01/05/2012 14:48, Guy Helmer wrote: >>>> Allow daemon(8) to run pidfile_open() before relenquishing >>>> privileges so pid files can be written in /var/run when started >>>> as root. >>>=20 >>> I'm not sure how useful this is since when daemon is exiting it >>> won't be able to remove the pid file (unless I'm missing >>> something). >>>=20 >>> Isn't it better to pre-create the pid file with the proper >>> permissions for the unprivileged user? >>>=20 >>=20 >> Would it be OK for daemon to hang around and wait for the child >> process to exit, then remove the pid file? >=20 > Without having given it any kind of careful thought, that sounds Ok = ... > but I don't understand how daemon could remove a pid file written as > root after it's already dropped privileges. (IOW that's the same = problem > I was bringing up.) >=20 >> The only other alternative I see would be to create a subdirectory >> that is writable by the user so the child can create and delete the >> pid file. >=20 > That's functionally equivalent to pre-creating the pid file with the > right permissions, so it would be Ok. Various ports use each of these > approaches. I'm generally in favor of using the pid file only solution > since rc.d/cleanvar will clean all that stuff up at boot, and it's > preferable to not leave stale directories around for stuff that is no > longer running and/or installed. Having thought about it for a while, I plan to revert the change to = daemon.c that was suggested in the PR, and instead add this note to the = man page: Index: daemon.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- daemon.8 (revision 230510) +++ daemon.8 (working copy) @@ -59,6 +59,10 @@ using the .Xr pidfile 3 functionality. +If the +.Fl u +option is used, the directory to contain the pidfile must be writable +by the specified user. Note, that the file will be created shortly before the process is actually executed, and will remain after the process exits (although it will be removed if the execution fails). Guy -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 17:31:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0CB1E106566C; Tue, 24 Jan 2012 17:31:28 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F01448FC12; Tue, 24 Jan 2012 17:31:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OHVRAr085013; Tue, 24 Jan 2012 17:31:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OHVRKd085011; Tue, 24 Jan 2012 17:31:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201241731.q0OHVRKd085011@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Jan 2012 17:31:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230511 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 17:31:28 -0000 Author: mav Date: Tue Jan 24 17:31:27 2012 New Revision: 230511 URL: http://svn.freebsd.org/changeset/base/230511 Log: Enable High Bit Rate (HBR) Encoded Packet Type (EPT), if supported (HDMI and HBR bits set) and needed (AC3 format used with 8 channels). This should allow DTS-HD/TrueHD pass-through with rates above 6.144Mbps. MFC after: 2 months Sponsored by: iXsystems, Inc. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Tue Jan 24 15:20:31 2012 (r230510) +++ head/sys/dev/sound/pci/hda/hdaa.c Tue Jan 24 17:31:27 2012 (r230511) @@ -1506,6 +1506,21 @@ hdaa_audio_setup(struct hdaa_chan *ch) >> (k * 4)) & 0xf) << 4) | k)); } + /* + * Enable High Bit Rate (HBR) Encoded Packet Type + * (EPT), if supported and needed (8ch data). + */ + if (HDA_PARAM_PIN_CAP_HDMI(wp->wclass.pin.cap) && + HDA_PARAM_PIN_CAP_HBR(wp->wclass.pin.cap)) { + wp->wclass.pin.ctrl &= + ~HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK; + if ((ch->fmt & AFMT_AC3) && (cchn == 8)) + wp->wclass.pin.ctrl |= 0x03; + hda_command(ch->devinfo->dev, + HDA_CMD_SET_PIN_WIDGET_CTRL(0, nid, + wp->wclass.pin.ctrl)); + } + /* Stop audio infoframe transmission. */ hda_command(ch->devinfo->dev, HDA_CMD_SET_HDMI_DIP_INDEX(0, nid, 0x00)); From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 21:33:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACDB4106566C; Tue, 24 Jan 2012 21:33:34 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA638FC08; Tue, 24 Jan 2012 21:33:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OLXYXG093362; Tue, 24 Jan 2012 21:33:34 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OLXYTx093359; Tue, 24 Jan 2012 21:33:34 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201242133.q0OLXYTx093359@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 24 Jan 2012 21:33:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230512 - head/usr.bin/sockstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 21:33:34 -0000 Author: jilles Date: Tue Jan 24 21:33:34 2012 New Revision: 230512 URL: http://svn.freebsd.org/changeset/base/230512 Log: sockstat: Also show sockets not associated with a file descriptor. Sockets not associated with a file descriptor include TCP TIME_WAIT states and sockets created via the socket(9) API such as from rpc.lockd and the NFS client. PR: bin/164081 MFC after: 2 weeks No objection: des Modified: head/usr.bin/sockstat/sockstat.1 head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.1 ============================================================================== --- head/usr.bin/sockstat/sockstat.1 Tue Jan 24 17:31:27 2012 (r230511) +++ head/usr.bin/sockstat/sockstat.1 Tue Jan 24 21:33:34 2012 (r230512) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2009 +.Dd January 24, 2012 .Dt SOCKSTAT 1 .Os .Sh NAME @@ -137,19 +137,10 @@ The address the foreign end of the socke .Xr getpeername 2 ) . .El .Pp -Note that TCP sockets in the -.Dv AF_INET -or -.Dv AF_INET6 -domains that are not in one of the -.Dv LISTEN , SYN_SENT , -or -.Dv ESTABLISHED -states may not be shown by -.Nm ; -use -.Xr netstat 1 -to examine them instead. +If a socket is associated with more than one file descriptor, +it is shown multiple times. +If a socket is not associated with any file descriptor, +the first four columns have no meaning. .Sh SEE ALSO .Xr fstat 1 , .Xr netstat 1 , @@ -167,10 +158,3 @@ The .Nm command and this manual page were written by .An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . -.Sh BUGS -Unlike -.Xr netstat 1 , -.Nm -lists sockets by walking file descriptor tables and will not output -the ones owned by the kernel, e.g. NLM sockets created by -.Xr rpc.lockd 8 . Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Tue Jan 24 17:31:27 2012 (r230511) +++ head/usr.bin/sockstat/sockstat.c Tue Jan 24 21:33:34 2012 (r230512) @@ -86,6 +86,7 @@ static int *ports; struct sock { void *socket; void *pcb; + int shown; int vflag; int family; int proto; @@ -571,12 +572,67 @@ check_ports(struct sock *s) } static void +displaysock(struct sock *s, int pos) +{ + void *p; + int hash; + + while (pos < 29) + pos += xprintf(" "); + pos += xprintf("%s", s->protoname); + if (s->vflag & INP_IPV4) + pos += xprintf("4 "); + if (s->vflag & INP_IPV6) + pos += xprintf("6 "); + while (pos < 36) + pos += xprintf(" "); + switch (s->family) { + case AF_INET: + case AF_INET6: + pos += printaddr(s->family, &s->laddr); + if (s->family == AF_INET6 && pos >= 58) + pos += xprintf(" "); + while (pos < 58) + pos += xprintf(" "); + pos += printaddr(s->family, &s->faddr); + break; + case AF_UNIX: + /* server */ + if (s->laddr.ss_len > 0) { + pos += printaddr(s->family, &s->laddr); + break; + } + /* client */ + p = *(void **)&s->faddr; + if (p == NULL) { + pos += xprintf("(not connected)"); + break; + } + pos += xprintf("-> "); + for (hash = 0; hash < HASHSIZE; ++hash) { + for (s = sockhash[hash]; s != NULL; s = s->next) + if (s->pcb == p) + break; + if (s != NULL) + break; + } + if (s == NULL || s->laddr.ss_len == 0) + pos += xprintf("??"); + else + pos += printaddr(s->family, &s->laddr); + break; + default: + abort(); + } + xprintf("\n"); +} + +static void display(void) { struct passwd *pwd; struct xfile *xf; struct sock *s; - void *p; int hash, n, pos; printf("%-8s %-10s %-5s %-2s %-6s %-21s %-21s\n", @@ -594,6 +650,7 @@ display(void) continue; if (!check_ports(s)) continue; + s->shown = 1; pos = 0; if ((pwd = getpwuid(xf->xf_uid)) == NULL) pos += xprintf("%lu ", (u_long)xf->xf_uid); @@ -608,54 +665,19 @@ display(void) while (pos < 26) pos += xprintf(" "); pos += xprintf("%d ", xf->xf_fd); - while (pos < 29) - pos += xprintf(" "); - pos += xprintf("%s", s->protoname); - if (s->vflag & INP_IPV4) - pos += xprintf("4 "); - if (s->vflag & INP_IPV6) - pos += xprintf("6 "); - while (pos < 36) - pos += xprintf(" "); - switch (s->family) { - case AF_INET: - case AF_INET6: - pos += printaddr(s->family, &s->laddr); - if (s->family == AF_INET6 && pos >= 58) - pos += xprintf(" "); - while (pos < 58) - pos += xprintf(" "); - pos += printaddr(s->family, &s->faddr); - break; - case AF_UNIX: - /* server */ - if (s->laddr.ss_len > 0) { - pos += printaddr(s->family, &s->laddr); - break; - } - /* client */ - p = *(void **)&s->faddr; - if (p == NULL) { - pos += xprintf("(not connected)"); - break; - } - pos += xprintf("-> "); - for (hash = 0; hash < HASHSIZE; ++hash) { - for (s = sockhash[hash]; s != NULL; s = s->next) - if (s->pcb == p) - break; - if (s != NULL) - break; - } - if (s == NULL || s->laddr.ss_len == 0) - pos += xprintf("??"); - else - pos += printaddr(s->family, &s->laddr); - break; - default: - abort(); + displaysock(s, pos); + } + for (hash = 0; hash < HASHSIZE; hash++) { + for (s = sockhash[hash]; s != NULL; s = s->next) { + if (s->shown) + continue; + if (!check_ports(s)) + continue; + pos = 0; + pos += xprintf("%-8s %-10s %-5s %-2s ", + "?", "?", "?", "?"); + displaysock(s, pos); } - xprintf("\n"); } } From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 21:45:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 0145E106564A; Tue, 24 Jan 2012 21:45:32 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id D14D214DE50; Tue, 24 Jan 2012 21:45:31 +0000 (UTC) Message-ID: <4F1F267B.4080005@FreeBSD.org> Date: Tue, 24 Jan 2012 13:45:31 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120119 Thunderbird/9.0 MIME-Version: 1.0 To: Guy Helmer References: <201201052248.q05MmaZk059871@svn.freebsd.org> <4F066340.9010507@FreeBSD.org> <4F078EC4.2090802@FreeBSD.org> <124C24A6-1E2A-4D30-9ED5-7F717C2E2A4D@palisadesystems.com> In-Reply-To: <124C24A6-1E2A-4D30-9ED5-7F717C2E2A4D@palisadesystems.com> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r229667 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 21:45:32 -0000 On 01/24/2012 07:34, Guy Helmer wrote: > On Jan 6, 2012, at 6:16 PM, Doug Barton wrote: > >> On 01/06/2012 08:18, Guy Helmer wrote: >>> On Jan 5, 2012, at 8:58 PM, Doug Barton wrote: >>> >>>> On 01/05/2012 14:48, Guy Helmer wrote: >>>>> Allow daemon(8) to run pidfile_open() before relenquishing >>>>> privileges so pid files can be written in /var/run when started >>>>> as root. >>>> >>>> I'm not sure how useful this is since when daemon is exiting it >>>> won't be able to remove the pid file (unless I'm missing >>>> something). >>>> >>>> Isn't it better to pre-create the pid file with the proper >>>> permissions for the unprivileged user? >>>> >>> >>> Would it be OK for daemon to hang around and wait for the child >>> process to exit, then remove the pid file? >> >> Without having given it any kind of careful thought, that sounds Ok ... >> but I don't understand how daemon could remove a pid file written as >> root after it's already dropped privileges. (IOW that's the same problem >> I was bringing up.) >> >>> The only other alternative I see would be to create a subdirectory >>> that is writable by the user so the child can create and delete the >>> pid file. >> >> That's functionally equivalent to pre-creating the pid file with the >> right permissions, so it would be Ok. Various ports use each of these >> approaches. I'm generally in favor of using the pid file only solution >> since rc.d/cleanvar will clean all that stuff up at boot, and it's >> preferable to not leave stale directories around for stuff that is no >> longer running and/or installed. > > Having thought about it for a while, I plan to revert the change to daemon.c that was suggested in the PR, and instead add this note to the man page: I think that reverting it is a good idea. I would add something to the effect of what's below. I continue to maintain that pre-creating the file is preferable to using directories since we'd like to avoid leaving no-longer-relevant directories around if the thing is not in use any longer. Doug > Index: daemon.8 > =================================================================== > --- daemon.8 (revision 230510) > +++ daemon.8 (working copy) > @@ -59,6 +59,10 @@ > using the > .Xr pidfile 3 > functionality. > +If the > +.Fl u > +option is used the pidfile must be pre-created with the proper > +permissions, or the directory to contain the pidfile must be writable > +by the specified user. > Note, that the file will be created shortly before the process is > actually executed, and will remain after the process exits (although > it will be removed if the execution fails). > > Guy > > -------- > This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. > -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 22:40:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4618B106566B; Tue, 24 Jan 2012 22:40:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 358428FC08; Tue, 24 Jan 2012 22:40:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0OMeP9k095434; Tue, 24 Jan 2012 22:40:25 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0OMePCL095432; Tue, 24 Jan 2012 22:40:25 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201242240.q0OMePCL095432@svn.freebsd.org> From: Alexander Motin Date: Tue, 24 Jan 2012 22:40:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230513 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 22:40:25 -0000 Author: mav Date: Tue Jan 24 22:40:24 2012 New Revision: 230513 URL: http://svn.freebsd.org/changeset/base/230513 Log: In addition to r230511, allow 8 channel AC3 formats. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Tue Jan 24 21:33:34 2012 (r230512) +++ head/sys/dev/sound/pci/hda/hdaa.c Tue Jan 24 22:40:24 2012 (r230513) @@ -4979,6 +4979,10 @@ hdaa_pcmchannel_setup(struct hdaa_chan * } if (HDA_PARAM_SUPP_STREAM_FORMATS_AC3(fmtcap)) { ch->fmtlist[i++] = SND_FORMAT(AFMT_AC3, 2, 0); + if (channels >= 8) { + ch->fmtlist[i++] = SND_FORMAT(AFMT_AC3, 8, 0); + ch->fmtlist[i++] = SND_FORMAT(AFMT_AC3, 8, 1); + } } ch->fmtlist[i] = 0; i = 0; From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 22:49:47 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63023106566C; Tue, 24 Jan 2012 22:49:47 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id ECF1A8FC14; Tue, 24 Jan 2012 22:49:46 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q0OMhtY7094557; Tue, 24 Jan 2012 23:43:57 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <4F1F3585.8060802@FreeBSD.org> Date: Tue, 24 Jan 2012 23:49:41 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Eitan Adler References: <201201200138.q0K1cLZP016695@svn.freebsd.org> In-Reply-To: <201201200138.q0K1cLZP016695@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 22:49:47 -0000 Hi Eitan, On 20.01.12 02:38, Eitan Adler wrote: > Author: eadler > Date: Fri Jan 20 01:38:21 2012 > New Revision: 230353 > URL: http://svn.freebsd.org/changeset/base/230353 > > Log: > Fix warning when compiling with gcc46: > error: variable 'temp' set but not used > > Approved by: dim > Approved by: cperciva (mentor, blanket for pre-mentorship already-approved commits) > MFC after: 3 days I do not know which of the makefs commits it was: [andreast@neon] /export/home/andreast/> makefs -t cd9660 -o chrp-boot -o rockridge -o label=pseries -B4321 p.iso /data1/netboot/powerpc64/ Segmentation fault (core dumped) [neon:~] andreast% uname -ra FreeBSD neon.andreas.nets 10.0-CURRENT FreeBSD 10.0-CURRENT #11 r230469M: Mon Jan 23 02:53:05 CET 2012 andreast@neon.andreas.nets:/usr/obj/export/devel/fbsd/head/src/sys/NEON amd64 Reverting to 230352 lets me create an iso. I compile makefs with the base compiler. I'll do some more investigations tomorrow, late night here. if you have an idea, would be great. Thanks, Andreas From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 23:09:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 398D01065670; Tue, 24 Jan 2012 23:09:55 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25A4F8FC0A; Tue, 24 Jan 2012 23:09:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0ON9sn0096380; Tue, 24 Jan 2012 23:09:55 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ON9seA096371; Tue, 24 Jan 2012 23:09:54 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201201242309.q0ON9seA096371@svn.freebsd.org> From: Martin Matuska Date: Tue, 24 Jan 2012 23:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230514 - in head: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 23:09:55 -0000 Author: mm Date: Tue Jan 24 23:09:54 2012 New Revision: 230514 URL: http://svn.freebsd.org/changeset/base/230514 Log: Merge illumos revisions 13572, 13573, 13574: Rev. 13572: disk sync write perf regression when slog is used post oi_148 [1] Rev. 13573: crash during reguid causes stale config [2] allow and unallow missing from zpool history since removal of pyzfs [5] Rev. 13574: leaking a vdev when removing an l2cache device [3] memory leak when adding a file-based l2arc device [4] leak in ZFS from metaslab_group_create and zfs_ereport_checksum [6] References: https://www.illumos.org/issues/1909 [1] https://www.illumos.org/issues/1949 [2] https://www.illumos.org/issues/1951 [3] https://www.illumos.org/issues/1952 [4] https://www.illumos.org/issues/1953 [5] https://www.illumos.org/issues/1954 [6] Obtained from: illumos (issues #1909, #1949, #1951, #1952, #1953, #1954) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Jan 24 22:40:24 2012 (r230513) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Jan 24 23:09:54 2012 (r230514) @@ -4213,7 +4213,7 @@ tryagain: (void) strlcpy(zc.zc_name, zhp->zfs_name, ZFS_MAXNAMELEN); - if (zfs_ioctl(hdl, ZFS_IOC_GET_FSACL, &zc) != 0) { + if (ioctl(hdl->libzfs_fd, ZFS_IOC_GET_FSACL, &zc) != 0) { (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot get permissions on '%s'"), zc.zc_name); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Jan 24 22:40:24 2012 (r230513) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Tue Jan 24 23:09:54 2012 (r230514) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -36,7 +36,7 @@ * avoid having to load lots of space_maps in a given txg. There are, * however, some cases where we want to avoid "fast" ganging and instead * we want to do an exhaustive search of all metaslabs on this device. - * Currently we don't allow any gang or dump device related allocations + * Currently we don't allow any gang, zil, or dump device related allocations * to "fast" gang. */ #define CAN_FASTGANG(flags) \ Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 24 22:40:24 2012 (r230513) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Tue Jan 24 23:09:54 2012 (r230514) @@ -1073,8 +1073,10 @@ spa_unload(spa_t *spa) } spa->spa_spares.sav_count = 0; - for (i = 0; i < spa->spa_l2cache.sav_count; i++) + for (i = 0; i < spa->spa_l2cache.sav_count; i++) { + vdev_clear_stats(spa->spa_l2cache.sav_vdevs[i]); vdev_free(spa->spa_l2cache.sav_vdevs[i]); + } if (spa->spa_l2cache.sav_vdevs) { kmem_free(spa->spa_l2cache.sav_vdevs, spa->spa_l2cache.sav_count * sizeof (void *)); @@ -1302,11 +1304,13 @@ spa_load_l2cache(spa_t *spa) vd = oldvdevs[i]; if (vd != NULL) { + ASSERT(vd->vdev_isl2cache); + if (spa_l2cache_exists(vd->vdev_guid, &pool) && pool != 0ULL && l2arc_vdev_present(vd)) l2arc_remove_vdev(vd); - (void) vdev_close(vd); - spa_l2cache_remove(vd); + vdev_clear_stats(vd); + vdev_free(vd); } } @@ -1949,7 +1953,7 @@ spa_load_impl(spa_t *spa, uint64_t pool_ */ if (type != SPA_IMPORT_ASSEMBLE) { spa_config_enter(spa, SCL_ALL, FTAG, RW_WRITER); - error = vdev_validate(rvd); + error = vdev_validate(rvd, mosconfig); spa_config_exit(spa, SCL_ALL, FTAG); if (error != 0) @@ -2818,6 +2822,7 @@ spa_validate_aux_devs(spa_t *spa, nvlist if ((strcmp(config, ZPOOL_CONFIG_L2CACHE) == 0) && strcmp(vd->vdev_ops->vdev_op_type, VDEV_TYPE_DISK) != 0) { error = ENOTBLK; + vdev_free(vd); goto out; } #endif @@ -2927,10 +2932,6 @@ spa_l2cache_drop(spa_t *spa) if (spa_l2cache_exists(vd->vdev_guid, &pool) && pool != 0ULL && l2arc_vdev_present(vd)) l2arc_remove_vdev(vd); - if (vd->vdev_isl2cache) - spa_l2cache_remove(vd); - vdev_clear_stats(vd); - (void) vdev_close(vd); } } @@ -3929,7 +3930,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui pvd = oldvd->vdev_parent; if ((error = spa_config_parse(spa, &newrootvd, nvroot, NULL, 0, - VDEV_ALLOC_ADD)) != 0) + VDEV_ALLOC_ATTACH)) != 0) return (spa_vdev_exit(spa, NULL, txg, EINVAL)); if (newrootvd->vdev_children != 1) Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Jan 24 22:40:24 2012 (r230513) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Tue Jan 24 23:09:54 2012 (r230514) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _SYS_VDEV_H @@ -48,7 +49,7 @@ extern boolean_t zfs_nocacheflush; extern int vdev_open(vdev_t *); extern void vdev_open_children(vdev_t *); extern boolean_t vdev_uses_zvols(vdev_t *); -extern int vdev_validate(vdev_t *); +extern int vdev_validate(vdev_t *, boolean_t); extern void vdev_close(vdev_t *); extern int vdev_create(vdev_t *, uint64_t txg, boolean_t isreplace); extern void vdev_reopen(vdev_t *); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Jan 24 22:40:24 2012 (r230513) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Tue Jan 24 23:09:54 2012 (r230514) @@ -261,6 +261,7 @@ typedef struct vdev_label { #define VDEV_ALLOC_L2CACHE 3 #define VDEV_ALLOC_ROOTPOOL 4 #define VDEV_ALLOC_SPLIT 5 +#define VDEV_ALLOC_ATTACH 6 /* * Allocate or free a vdev Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Jan 24 22:40:24 2012 (r230513) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Tue Jan 24 23:09:54 2012 (r230514) @@ -499,7 +499,7 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl &vd->vdev_removing); } - if (parent && !parent->vdev_parent) { + if (parent && !parent->vdev_parent && alloctype != VDEV_ALLOC_ATTACH) { ASSERT(alloctype == VDEV_ALLOC_LOAD || alloctype == VDEV_ALLOC_ADD || alloctype == VDEV_ALLOC_SPLIT || @@ -675,6 +675,8 @@ vdev_top_transfer(vdev_t *svd, vdev_t *t svd->vdev_ms_shift = 0; svd->vdev_ms_count = 0; + if (tvd->vdev_mg) + ASSERT3P(tvd->vdev_mg, ==, svd->vdev_mg); tvd->vdev_mg = svd->vdev_mg; tvd->vdev_ms = svd->vdev_ms; @@ -1294,13 +1296,18 @@ vdev_open(vdev_t *vd) * contents. This needs to be done before vdev_load() so that we don't * inadvertently do repair I/Os to the wrong device. * + * If 'strict' is false ignore the spa guid check. This is necessary because + * if the machine crashed during a re-guid the new guid might have been written + * to all of the vdev labels, but not the cached config. The strict check + * will be performed when the pool is opened again using the mos config. + * * This function will only return failure if one of the vdevs indicates that it * has since been destroyed or exported. This is only possible if * /etc/zfs/zpool.cache was readonly at the time. Otherwise, the vdev state * will be updated but the function will return 0. */ int -vdev_validate(vdev_t *vd) +vdev_validate(vdev_t *vd, boolean_t strict) { spa_t *spa = vd->vdev_spa; nvlist_t *label; @@ -1308,7 +1315,7 @@ vdev_validate(vdev_t *vd) uint64_t state; for (int c = 0; c < vd->vdev_children; c++) - if (vdev_validate(vd->vdev_child[c]) != 0) + if (vdev_validate(vd->vdev_child[c], strict) != 0) return (EBADF); /* @@ -1338,8 +1345,9 @@ vdev_validate(vdev_t *vd) return (0); } - if (nvlist_lookup_uint64(label, ZPOOL_CONFIG_POOL_GUID, - &guid) != 0 || guid != spa_guid(spa)) { + if (strict && (nvlist_lookup_uint64(label, + ZPOOL_CONFIG_POOL_GUID, &guid) != 0 || + guid != spa_guid(spa))) { vdev_set_state(vd, B_FALSE, VDEV_STATE_CANT_OPEN, VDEV_AUX_CORRUPT_DATA); nvlist_free(label); @@ -1501,7 +1509,7 @@ vdev_reopen(vdev_t *vd) !l2arc_vdev_present(vd)) l2arc_add_vdev(spa, vd); } else { - (void) vdev_validate(vd); + (void) vdev_validate(vd, B_TRUE); } /* Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Jan 24 22:40:24 2012 (r230513) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c Tue Jan 24 23:09:54 2012 (r230514) @@ -23,6 +23,10 @@ * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ + #include #include #include @@ -709,6 +713,10 @@ zfs_ereport_start_checksum(spa_t *spa, v if (report->zcr_ereport == NULL) { report->zcr_free(report->zcr_cbdata, report->zcr_cbinfo); + if (report->zcr_ckinfo != NULL) { + kmem_free(report->zcr_ckinfo, + sizeof (*report->zcr_ckinfo)); + } kmem_free(report, sizeof (*report)); return; } Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Jan 24 22:40:24 2012 (r230513) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Jan 24 23:09:54 2012 (r230514) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #include @@ -2235,13 +2235,22 @@ zio_alloc_zil(spa_t *spa, uint64_t txg, ASSERT(txg > spa_syncing_txg(spa)); - if (use_slog) + /* + * ZIL blocks are always contiguous (i.e. not gang blocks) so we + * set the METASLAB_GANG_AVOID flag so that they don't "fast gang" + * when allocating them. + */ + if (use_slog) { error = metaslab_alloc(spa, spa_log_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } - if (error) + if (error) { error = metaslab_alloc(spa, spa_normal_class(spa), size, - new_bp, 1, txg, old_bp, METASLAB_HINTBP_AVOID); + new_bp, 1, txg, old_bp, + METASLAB_HINTBP_AVOID | METASLAB_GANG_AVOID); + } if (error == 0) { BP_SET_LSIZE(new_bp, size); From owner-svn-src-all@FreeBSD.ORG Tue Jan 24 23:43:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFF8F1065673; Tue, 24 Jan 2012 23:43:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF3618FC14; Tue, 24 Jan 2012 23:43:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0ONhDmF097422; Tue, 24 Jan 2012 23:43:13 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0ONhDOU097420; Tue, 24 Jan 2012 23:43:13 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201201242343.q0ONhDOU097420@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 24 Jan 2012 23:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230515 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Jan 2012 23:43:13 -0000 Author: pjd Date: Tue Jan 24 23:43:13 2012 New Revision: 230515 URL: http://svn.freebsd.org/changeset/base/230515 Log: - Fix documentation to note that /etc/hast.conf is the default configuration file for hastd(8) and hastctl(8) and not hast.conf. - In copyright statement correct that this file is documentation, not software. - Bump date. MFC after: 3 days Modified: head/sbin/hastd/hast.conf.5 Modified: head/sbin/hastd/hast.conf.5 ============================================================================== --- head/sbin/hastd/hast.conf.5 Tue Jan 24 23:09:54 2012 (r230514) +++ head/sbin/hastd/hast.conf.5 Tue Jan 24 23:43:13 2012 (r230515) @@ -1,8 +1,8 @@ .\" Copyright (c) 2010 The FreeBSD Foundation -.\" Copyright (c) 2010-2011 Pawel Jakub Dawidek +.\" Copyright (c) 2010-2012 Pawel Jakub Dawidek .\" All rights reserved. .\" -.\" This software was developed by Pawel Jakub Dawidek under sponsorship from +.\" This documentation was written by Pawel Jakub Dawidek under sponsorship from .\" the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2011 +.Dd January 25, 2012 .Dt HAST.CONF 5 .Os .Sh NAME @@ -389,7 +389,9 @@ statement. .Bl -tag -width ".Pa /var/run/hastctl" -compact .It Pa /etc/hast.conf The default -.Nm +.Xr hastctl 8 +and +.Xr hastd 8 configuration file. .It Pa /var/run/hastctl Control socket used by the From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 00:14:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAE6B106566C; Wed, 25 Jan 2012 00:14:12 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 799BD8FC08; Wed, 25 Jan 2012 00:14:11 +0000 (UTC) Received: by lagv3 with SMTP id v3so2462352lag.13 for ; Tue, 24 Jan 2012 16:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:x-gm-message-state :content-type:content-transfer-encoding; bh=5ISmeigl7EVxdyRWdVQGbaoRNGbXkqB/YZSu+juRARE=; b=Ra9KKcCGLyvW6KuotD8M/WdGHVVA5NIK2K1PU5oKtk2qnoufHKGlISeJcIJgn46IUd dPlv1IZtgKQ1EbUFc8QLZdQ/D9URos4iMy/sODKo6vfSln9wNLV7u3g4XeFa7e15HdnK kUmhAyChTAC6EyrVSRrqHeyS5btQrsVqVroHI= Received: by 10.152.111.229 with SMTP id il5mr5887471lab.19.1327450450149; Tue, 24 Jan 2012 16:14:10 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.196 with HTTP; Tue, 24 Jan 2012 16:13:39 -0800 (PST) In-Reply-To: <4F1F3585.8060802@FreeBSD.org> References: <201201200138.q0K1cLZP016695@svn.freebsd.org> <4F1F3585.8060802@FreeBSD.org> From: Eitan Adler Date: Tue, 24 Jan 2012 19:13:39 -0500 X-Google-Sender-Auth: cxlvHYBoj1179VfBfO3CjgJm9YM Message-ID: To: Andreas Tobler X-Gm-Message-State: ALoCoQl8QYcgLH3pGiJ1vvEf6p/6QpR6AdSdXXsMDKQrCM79Nk0ifgAA6IlUJqv83XjmvV96ZWeS Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 00:14:12 -0000 On Tue, Jan 24, 2012 at 5:49 PM, Andreas Tobler wrot= e: > Hi Eitan, > I do not know which of the makefs commits it was: > > [andreast@neon] /export/home/andreast/> =C2=A0makefs -t cd9660 -o chrp-bo= ot -o > rockridge -o label=3Dpseries -B4321 p.iso /data1/netboot/powerpc64/ > Segmentation fault (core dumped) > > [neon:~] andreast% uname -ra > FreeBSD neon.andreas.nets 10.0-CURRENT FreeBSD 10.0-CURRENT #11 r230469M: > Mon Jan 23 02:53:05 CET 2012 > andreast@neon.andreas.nets:/usr/obj/export/devel/fbsd/head/src/sys/NEON > =C2=A0amd64 Thanks for the report! > Reverting to 230352 lets me create an iso. This is very strange - the change I made should have been idempotent at low levels of optimization and a no-op at higher levels of optimization. > I compile makefs with the base compiler. > > I'll do some more investigations tomorrow, late night here. I will not have access to my dev box for about 1 week so I won't be able to act on any information gathered for a bit. That said if my commit *did* break something I want to know :) > if you have an idea, would be great. If you can't investigate by the time I have access to my computer again I will take a look. Sorry for any trouble you had. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 00:22:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73FAA1065670; Wed, 25 Jan 2012 00:22:54 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 489638FC0C; Wed, 25 Jan 2012 00:22:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P0Msg6098763; Wed, 25 Jan 2012 00:22:54 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P0MsEY098760; Wed, 25 Jan 2012 00:22:54 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201250022.q0P0MsEY098760@svn.freebsd.org> From: Rick Macklem Date: Wed, 25 Jan 2012 00:22:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230516 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 00:22:54 -0000 Author: rmacklem Date: Wed Jan 25 00:22:53 2012 New Revision: 230516 URL: http://svn.freebsd.org/changeset/base/230516 Log: If a mount -u is done to either NFS client that switches it from TCP to UDP and the rsize/wsize/readdirsize is greater than NFS_MAXDGRAMDATA, it is possible for a thread doing an I/O RPC to get stuck repeatedly doing retries. This happens because the RPC will use a resize/wsize/readdirsize that won't work for UDP and, as such, it will keep failing indefinitely. This patch returns an error for this case, to avoid the problem. A discussion on freebsd-fs@ seemed to indicate that returning an error was preferable to silently ignoring the "udp"/"mntudp" option. This problem was discovered while investigating a problem reported by pjd@ via email. MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Tue Jan 24 23:43:13 2012 (r230515) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Wed Jan 25 00:22:53 2012 (r230516) @@ -989,6 +989,23 @@ nfs_mount(struct mount *mp) error = EIO; goto out; } + + /* + * Cannot switch to UDP if current rsize/wsize/readdirsize is + * too large, since there may be an I/O RPC in progress that + * will get retried after the switch to the UDP socket. These + * retries will fail over and over and over again. + */ + if (args.sotype == SOCK_DGRAM && + (nmp->nm_rsize > NFS_MAXDGRAMDATA || + nmp->nm_wsize > NFS_MAXDGRAMDATA || + nmp->nm_readdirsize > NFS_MAXDGRAMDATA)) { + vfs_mount_error(mp, + "old rsize/wsize/readdirsize greater than UDP max"); + error = EINVAL; + goto out; + } + /* * When doing an update, we can't change version, * security, switch lockd strategies or change cookie Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Tue Jan 24 23:43:13 2012 (r230515) +++ head/sys/nfsclient/nfs_vfsops.c Wed Jan 25 00:22:53 2012 (r230516) @@ -1106,6 +1106,23 @@ nfs_mount(struct mount *mp) error = EIO; goto out; } + + /* + * Cannot switch to UDP if current rsize/wsize/readdirsize is + * too large, since there may be an I/O RPC in progress that + * will get retried after the switch to the UDP socket. These + * retries will fail over and over and over again. + */ + if (args.sotype == SOCK_DGRAM && + (nmp->nm_rsize > NFS_MAXDGRAMDATA || + nmp->nm_wsize > NFS_MAXDGRAMDATA || + nmp->nm_readdirsize > NFS_MAXDGRAMDATA)) { + vfs_mount_error(mp, + "old rsize/wsize/readdirsize greater than UDP max"); + error = EINVAL; + goto out; + } + /* * When doing an update, we can't change from or to * v3, switch lockd strategies or change cookie translation From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 00:40:58 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2DBC1065670; Wed, 25 Jan 2012 00:40:57 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id B2F5A8FC15; Wed, 25 Jan 2012 00:40:56 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P0ehAE047925; Wed, 25 Jan 2012 09:40:53 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P0ef6d001310; Wed, 25 Jan 2012 09:40:43 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 25 Jan 2012 09:40:01 +0900 (JST) Message-Id: <20120125.094001.163024621361318219.hrs@allbsd.org> To: andreast@FreeBSD.org From: Hiroki Sato In-Reply-To: <4F1F3585.8060802@FreeBSD.org> References: <201201200138.q0K1cLZP016695@svn.freebsd.org> <4F1F3585.8060802@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jan_25_09_40_01_2012_599)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Wed, 25 Jan 2012 09:40:53 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, eadler@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 00:40:58 -0000 ----Security_Multipart(Wed_Jan_25_09_40_01_2012_599)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Andreas Tobler wrote in <4F1F3585.8060802@FreeBSD.org>: an> Hi Eitan, an> an> On 20.01.12 02:38, Eitan Adler wrote: an> > Author: eadler an> > Date: Fri Jan 20 01:38:21 2012 an> > New Revision: 230353 an> > URL: http://svn.freebsd.org/changeset/base/230353 an> > an> > Log: an> > Fix warning when compiling with gcc46: an> > error: variable 'temp' set but not used an> > an> > Approved by: dim an> > Approved by: cperciva (mentor, blanket for pre-mentorship an> > already-approved commits) an> > MFC after: 3 days an> an> I do not know which of the makefs commits it was: an> an> [andreast@neon] /export/home/andreast/> makefs -t cd9660 -o chrp-boot an> -o rockridge -o label=pseries -B4321 p.iso /data1/netboot/powerpc64/ an> Segmentation fault (core dumped) an> an> [neon:~] andreast% uname -ra an> FreeBSD neon.andreas.nets 10.0-CURRENT FreeBSD 10.0-CURRENT #11 an> r230469M: Mon Jan 23 02:53:05 CET 2012 an> andreast@neon.andreas.nets:/usr/obj/export/devel/fbsd/head/src/sys/NEON an> amd64 an> an> Reverting to 230352 lets me create an iso. an> an> I compile makefs with the base compiler. an> an> I'll do some more investigations tomorrow, late night here. I got the same symptom and am investigating it. Can you rebuild the binary with a debug option like this: % cd /usr/src/usr.sbin/makefs % make clean % make DEBUG_FLAGS=-g % make DEBUG_FLAGS=-g install and then send me the output of the following command? % printf "run -t cd9660 -o chrp-boot -o rockridge -o label=pseries -B4321 p.iso /data1/netboot/powerpc64/\nbt\nf 1\n f 2\n" | gdb -x /dev/stdin -batch /usr/sbin/makefs In my environment both the old and the new version could reproduce it. I am not sure if mine is the same as yours at this moment, though. -- Hiroki ----Security_Multipart(Wed_Jan_25_09_40_01_2012_599)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8fT2EACgkQTyzT2CeTzy03OgCfSxm5aklIDdXkIQPm/LHxWLID 7PoAoNtCFQCe+a5ZuomrMnkDCzM2JVw/ =gl9c -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jan_25_09_40_01_2012_599)---- From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 01:45:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38D0F106566B; Wed, 25 Jan 2012 01:45:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26C428FC0C; Wed, 25 Jan 2012 01:45:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P1jKCe001408; Wed, 25 Jan 2012 01:45:20 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P1jJC7001406; Wed, 25 Jan 2012 01:45:19 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201250145.q0P1jJC7001406@svn.freebsd.org> From: Rick Macklem Date: Wed, 25 Jan 2012 01:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230518 - stable/9/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 01:45:20 -0000 Author: rmacklem Date: Wed Jan 25 01:45:19 2012 New Revision: 230518 URL: http://svn.freebsd.org/changeset/base/230518 Log: MFC: r229956 jwd@ reported via email that the "CacheSize" field reported by "nfsstat -e -s" would go negative after using the "-z" option to zero out the stats. This patch fixes that by not zeroing out the srvcache_size field for "-z", since it is the size of the cache and not a counter Modified: stable/9/sys/fs/nfs/nfs_commonport.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonport.c Wed Jan 25 01:38:25 2012 (r230517) +++ stable/9/sys/fs/nfs/nfs_commonport.c Wed Jan 25 01:45:19 2012 (r230518) @@ -483,7 +483,6 @@ nfssvc_call(struct thread *p, struct nfs newnfsstats.srvcache_nonidemdonehits = 0; newnfsstats.srvcache_misses = 0; newnfsstats.srvcache_tcppeak = 0; - newnfsstats.srvcache_size = 0; newnfsstats.srvclients = 0; newnfsstats.srvopenowners = 0; newnfsstats.srvopens = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 01:54:18 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D01111065672; Wed, 25 Jan 2012 01:54:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 6C9AA8FC14; Wed, 25 Jan 2012 01:54:18 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0P1sEKR014423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 25 Jan 2012 12:54:15 +1100 Date: Wed, 25 Jan 2012 12:54:14 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem In-Reply-To: <201201250022.q0P0MsEY098760@svn.freebsd.org> Message-ID: <20120125121210.A1045@besplex.bde.org> References: <201201250022.q0P0MsEY098760@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230516 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 01:54:18 -0000 On Wed, 25 Jan 2012, Rick Macklem wrote: > Log: > If a mount -u is done to either NFS client that switches it > from TCP to UDP and the rsize/wsize/readdirsize is greater > than NFS_MAXDGRAMDATA, it is possible for a thread doing an > I/O RPC to get stuck repeatedly doing retries. This happens > because the RPC will use a resize/wsize/readdirsize that won't > work for UDP and, as such, it will keep failing indefinitely. > This patch returns an error for this case, to avoid the problem. > A discussion on freebsd-fs@ seemed to indicate that returning > an error was preferable to silently ignoring the "udp"/"mntudp" > option. Could it wait for the old i/o to complete (and not start any new i/o?). This is little different from having to wait when changing from rw to ro. The latter is not easy, and at least the old nfs client seems to not even dream of it. ffs has always called a flushfiles() function, but until relatively recently had lots of bugs in this area. It now uses complicated suspension of i/o to prevent starting new i/o. It is still the only file system in FreeBSD that uses MNTK_SUSPEND* or vfs_write_suspend(). (geom journal also uses vfs_write_suspend(), but I think it only works with ffs. vfs_write_suspend() uses MNT_SUSPEND in its call to VFS_SYNC(), but ffs_sync() is the only sync function that references MNT_SUSPEND.) I wonder how zfs handles this. > This problem was discovered while investigating a problem reported > by pjd@ via email. This problem has annoyed me for years. I now know a workaround :-). It doesn't help that, at least without nmount(), you can't see any of the udp/tcp, rsize or wsize parameters. The behaviour of mount -u should probably be to not change anything that is not an explicit parameter, but this is not traditional (mount -u traditionally means mount -u -o rw...) and is impossible for at least mount() to determine the current parameters, so it was passed a complete set of defaults. So for mount -u, you have to tell it all the current parameters that are not the default unless you want them changed back to the default, and it is just as impossible for you as for mount() to tell what the current parameters are. You have to remember what you set them to. When you forgot what they were or mistype type, you sometimes switch tcp back to udp when you meant to keep tcp, and see the bug. The rsize and wsize parameters give the additional problem that when switching between udp and tcp, the defaults for the size parameters change, so you normally don't want to keep the old parameters; but when testing which combination works best, you need to control the new parameters; in particular, it is useful to know what the defaults are; but the defaults are of course only documented in the source code, and the source code that sets the defaults is very large. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 02:15:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DE44106566B; Wed, 25 Jan 2012 02:15:41 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2266A8FC08; Wed, 25 Jan 2012 02:15:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P2FeCm002454; Wed, 25 Jan 2012 02:15:40 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P2Fe1V002452; Wed, 25 Jan 2012 02:15:40 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201201250215.q0P2Fe1V002452@svn.freebsd.org> From: Ed Maste Date: Wed, 25 Jan 2012 02:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230520 - head/usr.sbin/tzsetup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 02:15:41 -0000 Author: emaste Date: Wed Jan 25 02:15:40 2012 New Revision: 230520 URL: http://svn.freebsd.org/changeset/base/230520 Log: Clean up reinstall option and remove duplicate code - Move the reinstall logic to be before menus are initialised (menus are not needed when reinstalling a zonefile). - Remove unnecessary re-initialization of path_db. - Update variable name and error message because we now use the zone name relative to /usr/share/zoneinfo, not the full path. pr: bin/164041 Submitted by: Devin Teske MFC after: 1 week Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Wed Jan 25 01:54:28 2012 (r230519) +++ head/usr.sbin/tzsetup/tzsetup.c Wed Jan 25 02:15:40 2012 (r230520) @@ -951,32 +951,16 @@ main(int argc, char **argv) /* Override the user-supplied umask. */ (void)umask(S_IWGRP | S_IWOTH); - read_iso3166_table(); - read_zones(); - sort_countries(); - make_menus(); - if (reinstall == 1) { FILE *f; - char zonefile[MAXPATHLEN]; - char path_db[MAXPATHLEN]; - - zonefile[0] = '\0'; - path_db[0] = '\0'; - if (chrootenv != NULL) { - sprintf(zonefile, "%s/", chrootenv); - sprintf(path_db, "%s/", chrootenv); - } - strcat(zonefile, _PATH_ZONEINFO); - strcat(zonefile, "/"); - strcat(path_db, _PATH_DB); + char zoneinfo[MAXPATHLEN]; if ((f = fopen(path_db, "r")) != NULL) { - if (fgets(zonefile, sizeof(zonefile), f) != NULL) { - zonefile[sizeof(zonefile) - 1] = 0; - if (strlen(zonefile) > 0) { - zonefile[strlen(zonefile) - 1] = 0; - rv = install_zoneinfo(zonefile); + if (fgets(zoneinfo, sizeof(zoneinfo), f) != NULL) { + zoneinfo[sizeof(zoneinfo) - 1] = 0; + if (strlen(zoneinfo) > 0) { + zoneinfo[strlen(zoneinfo) - 1] = 0; + rv = install_zoneinfo(zoneinfo); exit(rv & ~DITEM_LEAVE_MENU); } errx(1, "Error reading %s.\n", path_db); @@ -984,7 +968,7 @@ main(int argc, char **argv) fclose(f); errx(1, "Unable to determine earlier installed zoneinfo " - "file. Check %s", path_db); + "name. Check %s", path_db); } errx(1, "Cannot open %s for reading. Does it exist?", path_db); } @@ -1004,6 +988,11 @@ main(int argc, char **argv) /* FALLTHROUGH */ } + read_iso3166_table(); + read_zones(); + sort_countries(); + make_menus(); + init_dialog(stdin, stdout); if (skiputc == 0) { DIALOG_VARS save_vars; From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 02:22:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E2FE106566B; Wed, 25 Jan 2012 02:22:17 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C2CC8FC0A; Wed, 25 Jan 2012 02:22:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P2MGlp002700; Wed, 25 Jan 2012 02:22:16 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P2MGq4002698; Wed, 25 Jan 2012 02:22:16 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201250222.q0P2MGq4002698@svn.freebsd.org> From: Rick Macklem Date: Wed, 25 Jan 2012 02:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230521 - stable/8/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 02:22:17 -0000 Author: rmacklem Date: Wed Jan 25 02:22:16 2012 New Revision: 230521 URL: http://svn.freebsd.org/changeset/base/230521 Log: MFC: r229956 jwd@ reported via email that the "CacheSize" field reported by "nfsstat -e -s" would go negative after using the "-z" option to zero out the stats. This patch fixes that by not zeroing out the srvcache_size field for "-z", since it is the size of the cache and not a counter Modified: stable/8/sys/fs/nfs/nfs_commonport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonport.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonport.c Wed Jan 25 02:15:40 2012 (r230520) +++ stable/8/sys/fs/nfs/nfs_commonport.c Wed Jan 25 02:22:16 2012 (r230521) @@ -485,7 +485,6 @@ nfssvc_call(struct thread *p, struct nfs newnfsstats.srvcache_nonidemdonehits = 0; newnfsstats.srvcache_misses = 0; newnfsstats.srvcache_tcppeak = 0; - newnfsstats.srvcache_size = 0; newnfsstats.srvclients = 0; newnfsstats.srvopenowners = 0; newnfsstats.srvopens = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 03:02:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F614106566B; Wed, 25 Jan 2012 03:02:33 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id A00148FC17; Wed, 25 Jan 2012 03:02:32 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EABFwH0+DaFvO/2dsb2JhbABChQmqNIFyAQEEASMEUhsOCgICDRkCWQaID6Z9kTyBL4dbAQYGCQUBAQIBCQIYCoJNBgIFAQUKAQMJCgEGAgJdFAaCH4EWBIg/jF6SbA X-IronPort-AV: E=Sophos;i="4.71,565,1320642000"; d="scan'208";a="153577287" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 24 Jan 2012 22:02:31 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 8E36DB3FC1; Tue, 24 Jan 2012 22:02:31 -0500 (EST) Date: Tue, 24 Jan 2012 22:02:31 -0500 (EST) From: Rick Macklem To: Bruce Evans Message-ID: <2145461054.81036.1327460551572.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20120125121210.A1045@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230516 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 03:02:33 -0000 Bruce Evans wrote: > On Wed, 25 Jan 2012, Rick Macklem wrote: > > > Log: > > If a mount -u is done to either NFS client that switches it > > from TCP to UDP and the rsize/wsize/readdirsize is greater > > than NFS_MAXDGRAMDATA, it is possible for a thread doing an > > I/O RPC to get stuck repeatedly doing retries. This happens > > because the RPC will use a resize/wsize/readdirsize that won't > > work for UDP and, as such, it will keep failing indefinitely. > > This patch returns an error for this case, to avoid the problem. > > A discussion on freebsd-fs@ seemed to indicate that returning > > an error was preferable to silently ignoring the "udp"/"mntudp" > > option. > > Could it wait for the old i/o to complete (and not start any new > i/o?). This is little different from having to wait when changing > from rw to ro. The latter is not easy, and at least the old nfs > client seems to not even dream of it. ffs has always called a > flushfiles() function, but until relatively recently had lots of > bugs in this area. It now uses complicated suspension of i/o > to prevent starting new i/o. It is still the only file system in > FreeBSD that uses MNTK_SUSPEND* or vfs_write_suspend(). > (geom journal also uses vfs_write_suspend(), but I think > it only works with ffs. vfs_write_suspend() uses MNT_SUSPEND > in its call to VFS_SYNC(), but ffs_sync() is the only sync > function that references MNT_SUSPEND.) > I wonder how zfs handles this. > As you said above "not easy ... uses complicated suspension of i/o". I have not tried to code this, but I think it would be non-trivial. The code would need to block new I/O before RPCs are issued and wait for all in-progress I/Os to complete. At this time, the kernel RPC handles the in-progress RPCs and NFS doesn't "know" what is outstanding. Of course, code could be added to keep track of in-progress I/O RPCs, but that would have to be written, as well. One tricky case would be if a forced dismount was invoked while the above is happening. (Forced dismount is hard to get right and easy to break, from my experience with it.) I didn't feel that the above work was justified, since I didn't see a need to switch from TCP -> UDP for a mount. If others feel that returning an error isn't sufficient and the above work is justified, I can revert the patch and try and find time to do the above. > > This problem was discovered while investigating a problem reported > > by pjd@ via email. > > This problem has annoyed me for years. I now know a workaround :-). > It doesn't help that, at least without nmount(), you can't see any > of the udp/tcp, rsize or wsize parameters. The behaviour of mount -u > should probably be to not change anything that is not an explicit > parameter, but this is not traditional (mount -u > traditionally means mount -u -o rw...) and is impossible for at least > mount() to determine the current parameters, so it was passed a > complete set of defaults. So for mount -u, you have to tell it all > the current parameters that are not the default unless you want them > changed back to the default, and it is just as impossible for you as > for mount() to tell what the current parameters are. You have to > remember what you set them to. When you forgot what they were or > mistype type, you sometimes switch tcp back to udp when you meant to > keep tcp, and see the bug. The rsize and wsize parameters give the > additional problem that when switching between udp and tcp, the > defaults > for the size parameters change, so you normally don't want to keep the > old parameters; but when testing which combination works best, you > need to control the new parameters; in particular, it is useful to > know what the defaults are; but the defaults are of course only > documented in the source code, and the source code that sets the > defaults is very large. > Although I haven't coded it yet, I am planning on adding a "-m" option to nfsstat (similar to what Linux has), that would dump out the NFS mount options actually being used. This becomes more important for NFSv4.n, since the newer protocol is negotiating more things. rick From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 03:37:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BAD6106564A; Wed, 25 Jan 2012 03:37:40 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F17FC8FC0A; Wed, 25 Jan 2012 03:37:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P3bdgr005257; Wed, 25 Jan 2012 03:37:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P3bdZ6005252; Wed, 25 Jan 2012 03:37:39 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201201250337.q0P3bdZ6005252@svn.freebsd.org> From: Nathan Whitehorn Date: Wed, 25 Jan 2012 03:37:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230522 - in head: sys/boot/powerpc/boot1.chrp sys/geom/part sys/sys usr.sbin/bsdinstall/partedit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 03:37:40 -0000 Author: nwhitehorn Date: Wed Jan 25 03:37:39 2012 New Revision: 230522 URL: http://svn.freebsd.org/changeset/base/230522 Log: Experimental support for booting CHRP-type PowerPC systems from hard disks. Modified: head/sys/boot/powerpc/boot1.chrp/Makefile head/sys/geom/part/g_part_mbr.c head/sys/sys/diskmbr.h head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Modified: head/sys/boot/powerpc/boot1.chrp/Makefile ============================================================================== --- head/sys/boot/powerpc/boot1.chrp/Makefile Wed Jan 25 02:22:16 2012 (r230521) +++ head/sys/boot/powerpc/boot1.chrp/Makefile Wed Jan 25 03:37:39 2012 (r230522) @@ -10,7 +10,6 @@ INSTALLFLAGS= -b FILES= boot1.hfs SRCS= boot1.c ashldi3.c -INTERNALPROG= NO_MAN= CFLAGS= -ffreestanding -msoft-float -Os \ Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Wed Jan 25 02:22:16 2012 (r230521) +++ head/sys/geom/part/g_part_mbr.c Wed Jan 25 03:37:39 2012 (r230522) @@ -123,6 +123,7 @@ static struct g_part_mbr_alias { { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, + { DOSPTYP_PPCBOOT, G_PART_ALIAS_FREEBSD_BOOT }, }; static int Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Wed Jan 25 02:22:16 2012 (r230521) +++ head/sys/sys/diskmbr.h Wed Jan 25 03:37:39 2012 (r230522) @@ -48,6 +48,7 @@ #define DOSPTYP_NTFS 0x07 /* NTFS partition */ #define DOSPTYP_FAT32 0x0b /* FAT32 partition */ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ +#define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ #define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ Modified: head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Wed Jan 25 02:22:16 2012 (r230521) +++ head/usr.sbin/bsdinstall/partedit/partedit_powerpc.c Wed Jan 25 03:37:39 2012 (r230522) @@ -67,7 +67,7 @@ is_scheme_bootable(const char *part_type size_t bootpart_size(const char *part_type) { - if (strcmp(part_type, "APM") == 0) + if (strcmp(part_type, "APM") == 0 || strcmp(part_type, "MBR") == 0) return (800*1024); return (0); } @@ -81,6 +81,8 @@ const char * partcode_path(const char *part_type) { if (strcmp(part_type, "APM") == 0) return ("/boot/boot1.hfs"); + if (strcmp(part_type, "MBR") == 0) + return ("/boot/boot1.elf"); return (NULL); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 04:28:10 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91F08106566B; Wed, 25 Jan 2012 04:28:10 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 26E4F8FC17; Wed, 25 Jan 2012 04:28:09 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0P4S7vp019291 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 25 Jan 2012 15:28:08 +1100 Date: Wed, 25 Jan 2012 15:28:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem In-Reply-To: <2145461054.81036.1327460551572.JavaMail.root@erie.cs.uoguelph.ca> Message-ID: <20120125152150.M1522@besplex.bde.org> References: <2145461054.81036.1327460551572.JavaMail.root@erie.cs.uoguelph.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r230516 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 04:28:10 -0000 On Tue, 24 Jan 2012, Rick Macklem wrote: > Bruce Evans wrote: >> On Wed, 25 Jan 2012, Rick Macklem wrote: >> >>> Log: >>> If a mount -u is done to either NFS client that switches it >>> from TCP to UDP and the rsize/wsize/readdirsize is greater >>> than NFS_MAXDGRAMDATA, it is possible for a thread doing an >>> I/O RPC to get stuck repeatedly doing retries. This happens >>> ... >> Could it wait for the old i/o to complete (and not start any new >> i/o?). This is little different from having to wait when changing >> from rw to ro. The latter is not easy, and at least the old nfs >> client seems to not even dream of it. ffs has always called a >> ... > As you said above "not easy ... uses complicated suspension of i/o". > I have not tried to code this, but I think it would be non-trivial. > The code would need to block new I/O before RPCs are issued and wait > for all in-progress I/Os to complete. At this time, the kernel RPC > handles the in-progress RPCs and NFS doesn't "know" what is > outstanding. Of course, code could be added to keep track of in-progress > I/O RPCs, but that would have to be written, as well. Hmm, this means that even when the i/o sizes are small, the mode switch from tcp to udp may be unsafe since there may still be i/o's with higher sizes outstanding. So to switch from tcp to udp, the user should first reduce the sizes, when wait a while before switching to udp. And what happens with retries after changing sizes up or down? Does it retry with the old sizes? Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 04:45:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 623E0106564A; Wed, 25 Jan 2012 04:45:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D73E8FC13; Wed, 25 Jan 2012 04:45:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P4jU4j007475; Wed, 25 Jan 2012 04:45:30 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P4jU5p007473; Wed, 25 Jan 2012 04:45:30 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201201250445.q0P4jU5p007473@svn.freebsd.org> From: Warner Losh Date: Wed, 25 Jan 2012 04:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230525 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 04:45:30 -0000 Author: imp Date: Wed Jan 25 04:45:29 2012 New Revision: 230525 URL: http://svn.freebsd.org/changeset/base/230525 Log: Some minor additions to the list of supported devices... Modified: head/share/man/man4/ed.4 Modified: head/share/man/man4/ed.4 ============================================================================== --- head/share/man/man4/ed.4 Wed Jan 25 03:57:43 2012 (r230524) +++ head/share/man/man4/ed.4 Wed Jan 25 04:45:29 2012 (r230525) @@ -139,7 +139,7 @@ Allied Telesis SIC-98, SIC-98NOTE (110pi .It Allied Telesis SIU-98-D (flags 0x610000) (PC-98) .It -AmbiCom 10BaseT card +AmbiCom 10BaseT card (8002, 8002T, 8010 and 8610) .It Bay Networks NETGEAR FA410TXC Fast Ethernet .It @@ -147,11 +147,15 @@ Belkin F5D5020 PC Card Fast Ethernet .It Billionton LM5LT-10B Ethernet/Modem PC Card .It +Billionton LNT-10TB, LNT-10TN Ethernet PC Card +.It Bromax iPort 10/100 Ethernet PC Card .It Bromax iPort 10 Ethernet PC Card .It -Buffalo LPC2-CLT, LPC3-CLT, LPC3-CLX, LPC4-TX PC Card +Buffalo LPC2-CLT, LPC3-CLT, LPC3-CLX, LPC4-TX, LPC-CTX PC Card +.It +Buffalo LPC-CF-CLT CF Card .It CNet BC40 adapter .It From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 04:48:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6CDA106566B; Wed, 25 Jan 2012 04:48:27 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D22C68FC13; Wed, 25 Jan 2012 04:48:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P4mRQ0007598; Wed, 25 Jan 2012 04:48:27 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P4mRG8007596; Wed, 25 Jan 2012 04:48:27 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201201250448.q0P4mRG8007596@svn.freebsd.org> From: Warner Losh Date: Wed, 25 Jan 2012 04:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230526 - head/sys/dev/fxp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 04:48:28 -0000 Author: imp Date: Wed Jan 25 04:48:27 2012 New Revision: 230526 URL: http://svn.freebsd.org/changeset/base/230526 Log: Minor indenting divot... Modified: head/sys/dev/fxp/if_fxp.c Modified: head/sys/dev/fxp/if_fxp.c ============================================================================== --- head/sys/dev/fxp/if_fxp.c Wed Jan 25 04:45:29 2012 (r230525) +++ head/sys/dev/fxp/if_fxp.c Wed Jan 25 04:48:27 2012 (r230526) @@ -2555,7 +2555,7 @@ fxp_ifmedia_upd(struct ifnet *ifp) { struct fxp_softc *sc = ifp->if_softc; struct mii_data *mii; - struct mii_softc *miisc; + struct mii_softc *miisc; mii = device_get_softc(sc->miibus); FXP_LOCK(sc); From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 05:35:52 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2BAA106564A; Wed, 25 Jan 2012 05:35:51 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 3539F8FC12; Wed, 25 Jan 2012 05:35:50 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q0P5TxAY092399; Wed, 25 Jan 2012 06:30:00 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <4F1F94B3.6020803@FreeBSD.org> Date: Wed, 25 Jan 2012 06:35:47 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Hiroki Sato References: <201201200138.q0K1cLZP016695@svn.freebsd.org> <4F1F3585.8060802@FreeBSD.org> <20120125.094001.163024621361318219.hrs@allbsd.org> In-Reply-To: <20120125.094001.163024621361318219.hrs@allbsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, eadler@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 05:35:52 -0000 On 25.01.12 01:40, Hiroki Sato wrote: > Andreas Tobler wrote > in<4F1F3585.8060802@FreeBSD.org>: > > an> Hi Eitan, > an> > an> On 20.01.12 02:38, Eitan Adler wrote: > an> > Author: eadler > an> > Date: Fri Jan 20 01:38:21 2012 > an> > New Revision: 230353 > an> > URL: http://svn.freebsd.org/changeset/base/230353 > an> > > an> > Log: > an> > Fix warning when compiling with gcc46: > an> > error: variable 'temp' set but not used > an> > > an> > Approved by: dim > an> > Approved by: cperciva (mentor, blanket for pre-mentorship > an> > already-approved commits) > an> > MFC after: 3 days > an> > an> I do not know which of the makefs commits it was: > an> > an> [andreast@neon] /export/home/andreast/> makefs -t cd9660 -o chrp-boot > an> -o rockridge -o label=pseries -B4321 p.iso /data1/netboot/powerpc64/ > an> Segmentation fault (core dumped) > an> > an> [neon:~] andreast% uname -ra > an> FreeBSD neon.andreas.nets 10.0-CURRENT FreeBSD 10.0-CURRENT #11 > an> r230469M: Mon Jan 23 02:53:05 CET 2012 > an> andreast@neon.andreas.nets:/usr/obj/export/devel/fbsd/head/src/sys/NEON > an> amd64 > an> > an> Reverting to 230352 lets me create an iso. > an> > an> I compile makefs with the base compiler. > an> > an> I'll do some more investigations tomorrow, late night here. > > I got the same symptom and am investigating it. Can you rebuild the > binary with a debug option like this: > > % cd /usr/src/usr.sbin/makefs > % make clean > % make DEBUG_FLAGS=-g > % make DEBUG_FLAGS=-g install > > and then send me the output of the following command? > > % printf "run -t cd9660 -o chrp-boot -o rockridge -o label=pseries -B4321 p.iso /data1/netboot/powerpc64/\nbt\nf 1\n f 2\n" | gdb -x /dev/stdin -batch /usr/sbin/makefs > > In my environment both the old and the new version could reproduce > it. I am not sure if mine is the same as yours at this moment, > though. It is actually r230354, this is the commit which shows the failure. And I reverted back to 230353 and onfirmed that it 'works'. I additionally built with -O0 -g, see below. If you need more details, I'll be out the next 15h but later on I can continue. Thank you very much! Andreas Here the output from the binary built with "-g": ------ [andreast@tcx58] /export/home/andreast/> printf "run -t cd9660 -o chrp-boot -o rockridge -o label=pseries -B4321 p.iso /export/netboot/powerpc64/\nbt\nf 1\n f 2\n" | gdb -x /dev/stdin -batch /usr/sbin/makefs Program received signal SIGSEGV, Segmentation fault. 0x0000000800b781d6 in memcpy () from /lib/libc.so.7 #0 0x0000000800b781d6 in memcpy () from /lib/libc.so.7 #1 0x00000000004045f8 in cd9660_rename_filename (iter=0x0, num=36, delete_chars=2) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1120 #2 0x00000000004044bb in cd9660_handle_collisions (colliding=0x801ba9ec0, past=35) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1042 #3 0x0000000000404f13 in cd9660_convert_structure (root=0x8013929c0, parent_node=0x801ba9ec0, level=5, numDirectories=0x7fffffffd864, error=0x7fffffffd860) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1462 #4 0x0000000000404e42 in cd9660_convert_structure (root=0x801378e70, parent_node=0x801b894c0, level=4, numDirectories=0x7fffffffd864, error=0x7fffffffd860) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1419 #5 0x0000000000404e42 in cd9660_convert_structure (root=0x80123fa60, parent_node=0x8016f2280, level=3, numDirectories=0x7fffffffd864, error=0x7fffffffd860) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1419 #6 0x0000000000404e42 in cd9660_convert_structure (root=0x80110cec0, parent_node=0x801552100, level=2, numDirectories=0x7fffffffd864, error=0x7fffffffd860) ---Type to continue, or q to quit--- at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1419 #7 0x0000000000404e42 in cd9660_convert_structure (root=0x80104c0b0, parent_node=0x801007140, level=1, numDirectories=0x7fffffffd864, error=0x7fffffffd860) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1419 #8 0x00000000004036f1 in cd9660_makefs (image=0x7fffffffdd45 "p.iso", dir=0x7fffffffdd4b "/export/netboot/powerpc64/", root=0x80104c060, fsopts=0x7fffffffd920) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:505 #9 0x000000000040bb58 in main (argc=2, argv=0x7fffffffda90) at /export/devel/fbsd/src/usr.sbin/makefs/makefs.c:291 #1 0x00000000004045f8 in cd9660_rename_filename (iter=0x0, num=36, delete_chars=2) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1120 1120 memcpy(tmp, (iter->o_name), numbts); #2 0x00000000004044bb in cd9660_handle_collisions (colliding=0x801ba9ec0, past=35) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1042 1042 iter = cd9660_rename_filename(iter, skip, delete_chars); ------ And here the output from a bt full with a binary built with "-g -O0": ------ [andreast@tcx58] /export/home/andreast/> printf "run -t cd9660 -o chrp-boot -o rockridge -o label=pseries -B4321 p.iso /export/netboot/powerpc64/\nbt full\nf 1\n f 2\n" | gdb -x /dev/stdin -batch /usr/sbin/makefs Program received signal SIGSEGV, Segmentation fault. 0x0000000800b781d6 in memcpy () from /lib/libc.so.7 #0 0x0000000800b781d6 in memcpy () from /lib/libc.so.7 No symbol table info available. #1 0x00000000004045f8 in cd9660_rename_filename (iter=0x0, num=36, delete_chars=2) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1120 i = 35 numbts = 27 digit = 4 digits = 2 temp = 0 powers = 10 count = 31 naming = 0x93 maxlength = 31 tmp = 0x80104b040 "ZULU.;1" #2 0x00000000004044bb in cd9660_handle_collisions (colliding=0x801ba9ec0, past=35) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1042 iter = (cd9660node *) 0x801bab140 next = (cd9660node *) 0x0 prev = (cd9660node *) 0x0 skip = 36 ---Type to continue, or q to quit--- delete_chars = 2 temp_past = 0 temp_skip = 0 flag = 1 end_of_range = (cd9660node *) 0x801bad6c0 #3 0x0000000000404f13 in cd9660_convert_structure (root=0x8013929c0, parent_node=0x801ba9ec0, level=5, numDirectories=0x7fffffffd864, error=0x7fffffffd860) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1462 iterator = (fsnode *) 0x0 this_node = (cd9660node *) 0x801badbc0 working_level = 8 add = 1 flag = 1 counter = 35 __func__ = "cd9660_convert_structure" #4 0x0000000000404e42 in cd9660_convert_structure (root=0x801378e70, parent_node=0x801b894c0, level=4, numDirectories=0x7fffffffd864, error=0x7fffffffd860) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1419 iterator = (fsnode *) 0x801392920 this_node = (cd9660node *) 0x801ba9ec0 working_level = 5 ---Type to continue, or q to quit--- add = 1 flag = 0 counter = 0 __func__ = "cd9660_convert_structure" #5 0x0000000000404e42 in cd9660_convert_structure (root=0x80123fa60, parent_node=0x8016f2280, level=3, numDirectories=0x7fffffffd864, error=0x7fffffffd860) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1419 iterator = (fsnode *) 0x801378dd0 this_node = (cd9660node *) 0x801b894c0 working_level = 4 add = 1 flag = 0 counter = 0 __func__ = "cd9660_convert_structure" #6 0x0000000000404e42 in cd9660_convert_structure (root=0x80110cec0, parent_node=0x801552100, level=2, numDirectories=0x7fffffffd864, error=0x7fffffffd860) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1419 iterator = (fsnode *) 0x80123f9c0 this_node = (cd9660node *) 0x8016f2280 working_level = 3 add = 1 ---Type to continue, or q to quit--- flag = 0 counter = 0 __func__ = "cd9660_convert_structure" #7 0x0000000000404e42 in cd9660_convert_structure (root=0x80104c0b0, parent_node=0x801007140, level=1, numDirectories=0x7fffffffd864, error=0x7fffffffd860) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1419 iterator = (fsnode *) 0x80110ce20 this_node = (cd9660node *) 0x801552100 working_level = 2 add = 1 flag = 0 counter = 0 __func__ = "cd9660_convert_structure" #8 0x00000000004036f1 in cd9660_makefs (image=0x7fffffffdd45 "p.iso", dir=0x7fffffffdd4b "/export/netboot/powerpc64/", root=0x80104c060, fsopts=0x7fffffffd920) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:505 startoffset = 518 numDirectories = 886 pathTableSectors = 140737488345752 firstAvailableSector = 45 totalSpace = 140737488346437 ---Type to continue, or q to quit--- error = 0 real_root = (cd9660node *) 0x801007140 __func__ = "cd9660_makefs" #9 0x000000000040bb58 in main (argc=2, argv=0x7fffffffda90) at /export/devel/fbsd/src/usr.sbin/makefs/makefs.c:291 sb = {st_dev = 112, st_ino = 2652161, st_mode = 16877, st_nlink = 17, st_uid = 0, st_gid = 0, st_rdev = 10608649, st_atim = {tv_sec = 1327469459, tv_nsec = 0}, st_mtim = {tv_sec = 1327223440, tv_nsec = 0}, st_ctim = { tv_sec = 1327223440, tv_nsec = 0}, st_size = 512, st_blocks = 8, st_blksize = 32768, st_flags = 0, st_gen = 2653886287, st_lspare = 0, st_birthtim = {tv_sec = 1324800403, tv_nsec = 0}} start = {tv_sec = 1327469680, tv_usec = 454035} fstype = (fstype_t *) 0x627c28 fsoptions = {size = 0, inodes = 0, curinode = 0, fd = -1, superblock = 0x0, onlyspec = 0, minsize = 0, maxsize = 0, freefiles = 0, freefilepc = 0, freeblocks = 0, freeblockpc = 0, needswap = 1, sectorsize = -1, fs_specific = 0x0} root = (fsnode *) 0x80104c060 ch = -1 len = 4203022 subtree = 0x7fffffffdd4b "/export/netboot/powerpc64/" specfile = 0x0 #1 0x00000000004045f8 in cd9660_rename_filename (iter=0x0, num=36, ---Type to continue, or q to quit--- delete_chars=2) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1120 1120 memcpy(tmp, (iter->o_name), numbts); #2 0x00000000004044bb in cd9660_handle_collisions (colliding=0x801ba9ec0, past=35) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1042 1042 iter = cd9660_rename_filename(iter, skip, delete_chars); ----- From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 05:50:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57074106564A; Wed, 25 Jan 2012 05:50:31 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 8B0DE8FC16; Wed, 25 Jan 2012 05:50:30 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so7594675obc.13 for ; Tue, 24 Jan 2012 21:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=laIxtdDmlkznzJWwRSSDh+9wdhM3kF6F4xV5IX7fEjE=; b=cGKGDxmHuAGcyhmYGpQE7i3fDColjrI1H3hMNK0HY8tC9zmOgCl6v0SGFzeQEFDo1O 7PxqeYJmx3a/dRnPKWGXHgCpuzdBOIMAD1lwTbTWXwJQfYYuP1J+Ylq2IvQzVk7OZckj 6kWPGjtzHrnvd9JlU29t2VGRzpTzQyAYDFio0= MIME-Version: 1.0 Received: by 10.182.150.66 with SMTP id ug2mr14491079obb.68.1327470630173; Tue, 24 Jan 2012 21:50:30 -0800 (PST) Received: by 10.182.46.163 with HTTP; Tue, 24 Jan 2012 21:50:30 -0800 (PST) In-Reply-To: <4F1F94B3.6020803@FreeBSD.org> References: <201201200138.q0K1cLZP016695@svn.freebsd.org> <4F1F3585.8060802@FreeBSD.org> <20120125.094001.163024621361318219.hrs@allbsd.org> <4F1F94B3.6020803@FreeBSD.org> Date: Tue, 24 Jan 2012 21:50:30 -0800 Message-ID: From: Garrett Cooper To: Andreas Tobler Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, eadler@freebsd.org, svn-src-all@freebsd.org, Hiroki Sato , src-committers@freebsd.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 05:50:31 -0000 On Tue, Jan 24, 2012 at 9:35 PM, Andreas Tobler wrote: > ... > It is actually r230354, this is the commit which shows the failure. > And I reverted back to 230353 and onfirmed that it 'works'. > > I additionally built with -O0 -g, see below. > > If you need more details, I'll be out the next 15h but later on I can > continue. > > Thank you very much! > Andreas > > Here the output from the binary built with "-g": > ------ > [andreast@tcx58] /export/home/andreast/> printf "run -t cd9660 -o chrp-boot > -o rockridge -o label=pseries -B4321 p.iso /export/netboot/powerpc64/\nbt\nf > 1\n f 2\n" | gdb -x /dev/stdin -batch /usr/sbin/makefs ... > delete_chars); 1. What does 'list' say for that frame (the line numbers are misleading)? 2. What compiler are you using to compile the binary? Thanks! -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 05:55:18 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C1F21065670; Wed, 25 Jan 2012 05:55:18 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 84E308FC14; Wed, 25 Jan 2012 05:55:17 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q0P5nP3M021873; Wed, 25 Jan 2012 06:49:26 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <4F1F9941.5040608@FreeBSD.org> Date: Wed, 25 Jan 2012 06:55:13 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Garrett Cooper References: <201201200138.q0K1cLZP016695@svn.freebsd.org> <4F1F3585.8060802@FreeBSD.org> <20120125.094001.163024621361318219.hrs@allbsd.org> <4F1F94B3.6020803@FreeBSD.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Hiroki Sato , eadler@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 05:55:18 -0000 On 25.01.12 06:50, Garrett Cooper wrote: > On Tue, Jan 24, 2012 at 9:35 PM, Andreas Tobler wrote: >> > > ... > >> It is actually r230354, this is the commit which shows the failure. >> And I reverted back to 230353 and onfirmed that it 'works'. >> >> I additionally built with -O0 -g, see below. >> >> If you need more details, I'll be out the next 15h but later on I can >> continue. >> >> Thank you very much! >> Andreas >> >> Here the output from the binary built with "-g": >> ------ >> [andreast@tcx58] /export/home/andreast/> printf "run -t cd9660 -o chrp-boot >> -o rockridge -o label=pseries -B4321 p.iso /export/netboot/powerpc64/\nbt\nf >> 1\n f 2\n" | gdb -x /dev/stdin -batch /usr/sbin/makefs > > ... > >> delete_chars); > > 1. What does 'list' say for that frame (the line numbers are misleading)? > 2. What compiler are you using to compile the binary? 1.) Starting program: /usr/sbin/makefs -t cd9660 -o chrp-boot -o rockridge -o label=pseries -B4321 p.iso /export/netboot/powerpc64 Program received signal SIGSEGV, Segmentation fault. 0x0000000800b781d6 in memcpy () from /lib/libc.so.7 (gdb) l 85 struct stat sb; 86 struct timeval start; 87 fstype_t *fstype; 88 fsinfo_t fsoptions; 89 fsnode *root; 90 int ch, len; 91 char *subtree; 92 char *specfile; 93 94 setprogname(argv[0]); (gdb) up #1 0x00000000004045f8 in cd9660_rename_filename (iter=0x0, num=36, delete_chars=2) at /export/devel/fbsd/src/usr.sbin/makefs/cd9660.c:1120 1120 memcpy(tmp, (iter->o_name), numbts); (gdb) l 1115 } 1116 } 1117 */ 1118 1119 /* (copying just the filename before the '.' */ 1120 memcpy(tmp, (iter->o_name), numbts); 1121 1122 /* adding the appropriate number following the name */ 1123 temp = i; 1124 while (digits > 0) { 2.) gcc -v Using built-in specs. Target: amd64-undermydesk-freebsd Configured with: FreeBSD/amd64 system compiler Thread model: posix gcc version 4.2.1 20070831 patched [FreeBSD] Thanks! Andreas From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 06:03:50 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57830106566B; Wed, 25 Jan 2012 06:03:50 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 05A388FC0C; Wed, 25 Jan 2012 06:03:47 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P63Y37025050; Wed, 25 Jan 2012 15:03:44 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P63W05003860; Wed, 25 Jan 2012 15:03:34 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 25 Jan 2012 15:03:29 +0900 (JST) Message-Id: <20120125.150329.660504706968105072.hrs@allbsd.org> To: andreast@FreeBSD.org From: Hiroki Sato In-Reply-To: <4F1F94B3.6020803@FreeBSD.org> References: <4F1F3585.8060802@FreeBSD.org> <20120125.094001.163024621361318219.hrs@allbsd.org> <4F1F94B3.6020803@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jan_25_15_03_29_2012_624)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Wed, 25 Jan 2012 15:03:44 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, eadler@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 06:03:50 -0000 ----Security_Multipart(Wed_Jan_25_15_03_29_2012_624)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Andreas Tobler wrote in <4F1F94B3.6020803@FreeBSD.org>: an> On 25.01.12 01:40, Hiroki Sato wrote: an> > Andreas Tobler wrote an> > in<4F1F3585.8060802@FreeBSD.org>: an> > an> > an> Hi Eitan, an> > an> an> > an> On 20.01.12 02:38, Eitan Adler wrote: an> > an> > Author: eadler an> > an> > Date: Fri Jan 20 01:38:21 2012 an> > an> > New Revision: 230353 an> > an> > URL: http://svn.freebsd.org/changeset/base/230353 an> > an> > an> > an> > Log: an> > an> > Fix warning when compiling with gcc46: an> > an> > error: variable 'temp' set but not used an> > an> > an> > an> > Approved by: dim an> > an> > Approved by: cperciva (mentor, blanket for pre-mentorship an> > an> > already-approved commits) an> > an> > MFC after: 3 days an> > an> an> > an> I do not know which of the makefs commits it was: an> > an> an> > an> [andreast@neon] /export/home/andreast/> makefs -t cd9660 -o an> > chrp-boot an> > an> -o rockridge -o label=pseries -B4321 p.iso an> > /data1/netboot/powerpc64/ an> > an> Segmentation fault (core dumped) an> > an> an> > an> [neon:~] andreast% uname -ra an> > an> FreeBSD neon.andreas.nets 10.0-CURRENT FreeBSD 10.0-CURRENT #11 an> > an> r230469M: Mon Jan 23 02:53:05 CET 2012 an> > an> an> > andreast@neon.andreas.nets:/usr/obj/export/devel/fbsd/head/src/sys/NEON an> > an> amd64 an> > an> an> > an> Reverting to 230352 lets me create an iso. an> > an> an> > an> I compile makefs with the base compiler. an> > an> an> > an> I'll do some more investigations tomorrow, late night here. an> > an> > I got the same symptom and am investigating it. Can you rebuild the an> > binary with a debug option like this: an> > an> > % cd /usr/src/usr.sbin/makefs an> > % make clean an> > % make DEBUG_FLAGS=-g an> > % make DEBUG_FLAGS=-g install an> > an> > and then send me the output of the following command? an> > an> > % printf "run -t cd9660 -o chrp-boot -o rockridge -o label=pseries an> > % -B4321 p.iso /data1/netboot/powerpc64/\nbt\nf 1\n f 2\n" | gdb -x an> > % /dev/stdin -batch /usr/sbin/makefs an> > an> > In my environment both the old and the new version could reproduce an> > it. I am not sure if mine is the same as yours at this moment, an> > though. an> an> It is actually r230354, this is the commit which shows the failure. an> And I reverted back to 230353 and onfirmed that it 'works'. Thank you! I will investigating it. Actually my test data set can make SIGSEGV in both of the versions for some reason. I have to narrow down the cause, anyway. I guess your /data1/netboot/powerpc64/ is quite large, but can I receive the tarball of it in some way? It would be helpful. -- Hiroki ----Security_Multipart(Wed_Jan_25_15_03_29_2012_624)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8fmzEACgkQTyzT2CeTzy2EoACeKUBrvKbebgrJu4h9za6Qor5g 0FEAoLHDTtleYHQkrS+f+l6tWgl7xoJb =wbJD -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jan_25_15_03_29_2012_624)---- From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 06:10:31 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBA6B106564A; Wed, 25 Jan 2012 06:10:30 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from smtp.fgznet.ch (mail.fgznet.ch [81.92.96.47]) by mx1.freebsd.org (Postfix) with ESMTP id 8C9D38FC0C; Wed, 25 Jan 2012 06:10:29 +0000 (UTC) Received: from deuterium.andreas.nets (dhclient-91-190-14-19.flashcable.ch [91.190.14.19]) by smtp.fgznet.ch (8.13.8/8.13.8/Submit_SMTPAUTH) with ESMTP id q0P64bZ1045363; Wed, 25 Jan 2012 07:04:39 +0100 (CET) (envelope-from andreast@FreeBSD.org) Message-ID: <4F1F9CD1.9070304@FreeBSD.org> Date: Wed, 25 Jan 2012 07:10:25 +0100 From: Andreas Tobler User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: Hiroki Sato References: <4F1F3585.8060802@FreeBSD.org> <20120125.094001.163024621361318219.hrs@allbsd.org> <4F1F94B3.6020803@FreeBSD.org> <20120125.150329.660504706968105072.hrs@allbsd.org> In-Reply-To: <20120125.150329.660504706968105072.hrs@allbsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.64 on 81.92.96.47 Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, eadler@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 06:10:31 -0000 On 25.01.12 07:03, Hiroki Sato wrote: > Andreas Tobler wrote > in<4F1F94B3.6020803@FreeBSD.org>: > > an> On 25.01.12 01:40, Hiroki Sato wrote: > an> > Andreas Tobler wrote > an> > in<4F1F3585.8060802@FreeBSD.org>: > an> > > an> > an> Hi Eitan, > an> > an> > an> > an> On 20.01.12 02:38, Eitan Adler wrote: > an> > an> > Author: eadler > an> > an> > Date: Fri Jan 20 01:38:21 2012 > an> > an> > New Revision: 230353 > an> > an> > URL: http://svn.freebsd.org/changeset/base/230353 > an> > an> > > an> > an> > Log: > an> > an> > Fix warning when compiling with gcc46: > an> > an> > error: variable 'temp' set but not used > an> > an> > > an> > an> > Approved by: dim > an> > an> > Approved by: cperciva (mentor, blanket for pre-mentorship > an> > an> > already-approved commits) > an> > an> > MFC after: 3 days > an> > an> > an> > an> I do not know which of the makefs commits it was: > an> > an> > an> > an> [andreast@neon] /export/home/andreast/> makefs -t cd9660 -o > an> > chrp-boot > an> > an> -o rockridge -o label=pseries -B4321 p.iso > an> > /data1/netboot/powerpc64/ > an> > an> Segmentation fault (core dumped) > an> > an> > an> > an> [neon:~] andreast% uname -ra > an> > an> FreeBSD neon.andreas.nets 10.0-CURRENT FreeBSD 10.0-CURRENT #11 > an> > an> r230469M: Mon Jan 23 02:53:05 CET 2012 > an> > an> > an> > andreast@neon.andreas.nets:/usr/obj/export/devel/fbsd/head/src/sys/NEON > an> > an> amd64 > an> > an> > an> > an> Reverting to 230352 lets me create an iso. > an> > an> > an> > an> I compile makefs with the base compiler. > an> > an> > an> > an> I'll do some more investigations tomorrow, late night here. > an> > > an> > I got the same symptom and am investigating it. Can you rebuild the > an> > binary with a debug option like this: > an> > > an> > % cd /usr/src/usr.sbin/makefs > an> > % make clean > an> > % make DEBUG_FLAGS=-g > an> > % make DEBUG_FLAGS=-g install > an> > > an> > and then send me the output of the following command? > an> > > an> > % printf "run -t cd9660 -o chrp-boot -o rockridge -o label=pseries > an> > % -B4321 p.iso /data1/netboot/powerpc64/\nbt\nf 1\n f 2\n" | gdb -x > an> > % /dev/stdin -batch /usr/sbin/makefs > an> > > an> > In my environment both the old and the new version could reproduce > an> > it. I am not sure if mine is the same as yours at this moment, > an> > though. > an> > an> It is actually r230354, this is the commit which shows the failure. > an> And I reverted back to 230353 and onfirmed that it 'works'. > > Thank you! I will investigating it. Actually my test data set can > make SIGSEGV in both of the versions for some reason. I have to > narrow down the cause, anyway. > > I guess your /data1/netboot/powerpc64/ is quite large, but can I > receive the tarball of it in some way? It would be helpful. It is a powerpc64 crossbuild installation, built on amd64. It is around 650MB unzipped, 230MB zipped. I can upload it to freefall later this evening. Thanks, Andreas From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 06:12:57 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4E14106564A; Wed, 25 Jan 2012 06:12:57 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5A39B8FC0C; Wed, 25 Jan 2012 06:12:56 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P6Ci1U027403; Wed, 25 Jan 2012 15:12:54 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P6Cf5a004173; Wed, 25 Jan 2012 15:12:41 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 25 Jan 2012 15:12:36 +0900 (JST) Message-Id: <20120125.151236.688056751317619770.hrs@allbsd.org> To: andreast@FreeBSD.org From: Hiroki Sato In-Reply-To: <4F1F9CD1.9070304@FreeBSD.org> References: <4F1F94B3.6020803@FreeBSD.org> <20120125.150329.660504706968105072.hrs@allbsd.org> <4F1F9CD1.9070304@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jan_25_15_12_36_2012_639)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Wed, 25 Jan 2012 15:12:54 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, eadler@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 06:12:57 -0000 ----Security_Multipart(Wed_Jan_25_15_12_36_2012_639)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Andreas Tobler wrote in <4F1F9CD1.9070304@FreeBSD.org>: an> It is a powerpc64 crossbuild installation, built on amd64. It is an> around 650MB unzipped, 230MB zipped. I can upload it to freefall later an> this evening. Thanks! -- Hiroki ----Security_Multipart(Wed_Jan_25_15_12_36_2012_639)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8fnVQACgkQTyzT2CeTzy3viACeJT4SknM18KZ5ke8VVdo+aYxj Rj4An2I7Vuf3hUwyT9yvwmK4NoCQag89 =dICO -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jan_25_15_12_36_2012_639)---- From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 07:12:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0CDD1065673; Wed, 25 Jan 2012 07:12:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ABDA78FC13; Wed, 25 Jan 2012 07:12:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P7CjXi012028; Wed, 25 Jan 2012 07:12:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P7CjTE012026; Wed, 25 Jan 2012 07:12:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201250712.q0P7CjTE012026@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 25 Jan 2012 07:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230527 - stable/9/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 07:12:45 -0000 Author: kib Date: Wed Jan 25 07:12:45 2012 New Revision: 230527 URL: http://svn.freebsd.org/changeset/base/230527 Log: MFC r230459: Fix typo. Modified: stable/9/sys/sys/elf_common.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/sys/elf_common.h ============================================================================== --- stable/9/sys/sys/elf_common.h Wed Jan 25 04:48:27 2012 (r230526) +++ stable/9/sys/sys/elf_common.h Wed Jan 25 07:12:45 2012 (r230527) @@ -384,7 +384,7 @@ typedef struct { #define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of initialization functions. */ #define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of - terminationfunctions. */ + termination functions. */ #define DT_RUNPATH 29 /* String table offset of a null-terminated library search path string. */ #define DT_FLAGS 30 /* Object specific flag values. */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 07:14:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76850106564A; Wed, 25 Jan 2012 07:14:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 612FD8FC12; Wed, 25 Jan 2012 07:14:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P7EOvv012129; Wed, 25 Jan 2012 07:14:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P7EOIq012127; Wed, 25 Jan 2012 07:14:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201250714.q0P7EOIq012127@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 25 Jan 2012 07:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230528 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 07:14:24 -0000 Author: kib Date: Wed Jan 25 07:14:23 2012 New Revision: 230528 URL: http://svn.freebsd.org/changeset/base/230528 Log: MFC r230459: Fix typo. Modified: stable/8/sys/sys/elf_common.h Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/sys/elf_common.h ============================================================================== --- stable/8/sys/sys/elf_common.h Wed Jan 25 07:12:45 2012 (r230527) +++ stable/8/sys/sys/elf_common.h Wed Jan 25 07:14:23 2012 (r230528) @@ -382,7 +382,7 @@ typedef struct { #define DT_INIT_ARRAYSZ 27 /* Size in bytes of the array of initialization functions. */ #define DT_FINI_ARRAYSZ 28 /* Size in bytes of the array of - terminationfunctions. */ + termination functions. */ #define DT_RUNPATH 29 /* String table offset of a null-terminated library search path string. */ #define DT_FLAGS 30 /* Object specific flag values. */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 07:45:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E9CE8106564A; Wed, 25 Jan 2012 07:45:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA5338FC0A; Wed, 25 Jan 2012 07:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P7jFEr013096; Wed, 25 Jan 2012 07:45:15 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P7jFYG013094; Wed, 25 Jan 2012 07:45:15 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201201250745.q0P7jFYG013094@svn.freebsd.org> From: Hiroki Sato Date: Wed, 25 Jan 2012 07:45:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230529 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 07:45:16 -0000 Author: hrs Date: Wed Jan 25 07:45:15 2012 New Revision: 230529 URL: http://svn.freebsd.org/changeset/base/230529 Log: Fix a SIGSEGV problem in directory entry renaming. Modified: head/usr.sbin/makefs/cd9660.c Modified: head/usr.sbin/makefs/cd9660.c ============================================================================== --- head/usr.sbin/makefs/cd9660.c Wed Jan 25 07:14:23 2012 (r230528) +++ head/usr.sbin/makefs/cd9660.c Wed Jan 25 07:45:15 2012 (r230529) @@ -1086,6 +1086,8 @@ cd9660_rename_filename(cd9660node *iter, */ while (count < maxlength) { + if (*naming == ';') + break; naming++; count++; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 08:42:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27B9E106564A; Wed, 25 Jan 2012 08:42:20 +0000 (UTC) (envelope-from charnier@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECA728FC13; Wed, 25 Jan 2012 08:42:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P8gJIx014922; Wed, 25 Jan 2012 08:42:19 GMT (envelope-from charnier@svn.freebsd.org) Received: (from charnier@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P8gJaD014915; Wed, 25 Jan 2012 08:42:19 GMT (envelope-from charnier@svn.freebsd.org) Message-Id: <201201250842.q0P8gJaD014915@svn.freebsd.org> From: Philippe Charnier Date: Wed, 25 Jan 2012 08:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230530 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 08:42:20 -0000 Author: charnier Date: Wed Jan 25 08:42:19 2012 New Revision: 230530 URL: http://svn.freebsd.org/changeset/base/230530 Log: Add prototypes, ANSIfy functions definitions to reduce WARNS=6 output. Modified: head/bin/sh/arith_yacc.c head/bin/sh/arith_yylex.c head/bin/sh/exec.c head/bin/sh/histedit.c head/bin/sh/jobs.c Modified: head/bin/sh/arith_yacc.c ============================================================================== --- head/bin/sh/arith_yacc.c Wed Jan 25 07:45:15 2012 (r230529) +++ head/bin/sh/arith_yacc.c Wed Jan 25 08:42:19 2012 (r230530) @@ -84,6 +84,8 @@ static const char prec[ARITH_BINOP_MAX - #define ARITH_MAX_PREC 8 +int letcmd(int, char **); + static __dead2 void yyerror(const char *s) { error("arithmetic expression: %s: \"%s\"", s, arith_startbuf); @@ -377,4 +379,3 @@ letcmd(int argc, char **argv) out1fmt(ARITH_FORMAT_STR "\n", i); return !i; } - Modified: head/bin/sh/arith_yylex.c ============================================================================== --- head/bin/sh/arith_yylex.c Wed Jan 25 07:45:15 2012 (r230529) +++ head/bin/sh/arith_yylex.c Wed Jan 25 08:42:19 2012 (r230530) @@ -53,7 +53,7 @@ __FBSDID("$FreeBSD$"); extern const char *arith_buf; int -yylex() +yylex(void) { int value; const char *buf = arith_buf; Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Wed Jan 25 07:45:15 2012 (r230529) +++ head/bin/sh/exec.c Wed Jan 25 08:42:19 2012 (r230530) @@ -493,7 +493,7 @@ hashcd(void) */ void -changepath(const char *newval) +changepath(const char *newval __unused) { clearcmdentry(); } Modified: head/bin/sh/histedit.c ============================================================================== --- head/bin/sh/histedit.c Wed Jan 25 07:45:15 2012 (r230529) +++ head/bin/sh/histedit.c Wed Jan 25 08:42:19 2012 (r230530) @@ -160,8 +160,7 @@ bad: void -sethistsize(hs) - const char *hs; +sethistsize(const char *hs) { int histsize; HistEvent he; Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Wed Jan 25 07:45:15 2012 (r230529) +++ head/bin/sh/jobs.c Wed Jan 25 08:42:19 2012 (r230530) @@ -92,6 +92,7 @@ static void restartjob(struct job *); #endif static void freejob(struct job *); static struct job *getjob(char *); +pid_t getjobpgrp(char *); static pid_t dowait(int, struct job *); static pid_t waitproc(int, int *); static void checkzombies(void); From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 08:53:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC944106564A; Wed, 25 Jan 2012 08:53:42 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7C358FC12; Wed, 25 Jan 2012 08:53:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P8rgMv015321; Wed, 25 Jan 2012 08:53:42 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P8rgEA015319; Wed, 25 Jan 2012 08:53:42 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201250853.q0P8rgEA015319@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 25 Jan 2012 08:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230531 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 08:53:43 -0000 Author: pluknet Date: Wed Jan 25 08:53:42 2012 New Revision: 230531 URL: http://svn.freebsd.org/changeset/base/230531 Log: Remove unused variable. The actual ia6->ia6_lifetime access is hidden in IFA6_IS_INVALID/IFA6_IS_DEPRECATED macros since a long time ago (see netinet6/nd6.c, r1.104 of KAME for the reference). MFC after: 3 days Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Wed Jan 25 08:42:19 2012 (r230530) +++ head/sys/netinet6/nd6.c Wed Jan 25 08:53:42 2012 (r230531) @@ -575,7 +575,6 @@ nd6_timer(void *arg) struct nd_defrouter *dr, *ndr; struct nd_prefix *pr, *npr; struct in6_ifaddr *ia6, *nia6; - struct in6_addrlifetime *lt6; callout_reset(&V_nd6_timer_ch, V_nd6_prune * hz, nd6_timer, curvnet); @@ -598,7 +597,6 @@ nd6_timer(void *arg) addrloop: TAILQ_FOREACH_SAFE(ia6, &V_in6_ifaddrhead, ia_link, nia6) { /* check address lifetime */ - lt6 = &ia6->ia6_lifetime; if (IFA6_IS_INVALID(ia6)) { int regen = 0; From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 09:27:38 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 978D3106566B; Wed, 25 Jan 2012 09:27:38 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id E9FC88FC0C; Wed, 25 Jan 2012 09:27:37 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P9RJnI074403; Wed, 25 Jan 2012 18:27:30 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0P9RGWc005549; Wed, 25 Jan 2012 18:27:16 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Wed, 25 Jan 2012 18:27:04 +0900 (JST) Message-Id: <20120125.182704.1133145640979478339.hrs@allbsd.org> To: andreast@FreeBSD.org From: Hiroki Sato In-Reply-To: <20120125.151236.688056751317619770.hrs@allbsd.org> References: <20120125.150329.660504706968105072.hrs@allbsd.org> <4F1F9CD1.9070304@FreeBSD.org> <20120125.151236.688056751317619770.hrs@allbsd.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Wed_Jan_25_18_27_04_2012_186)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Wed, 25 Jan 2012 18:27:31 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, eadler@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 09:27:38 -0000 ----Security_Multipart(Wed_Jan_25_18_27_04_2012_186)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hiroki Sato wrote in <20120125.151236.688056751317619770.hrs@allbsd.org>: hr> Andreas Tobler wrote hr> in <4F1F9CD1.9070304@FreeBSD.org>: hr> hr> an> It is a powerpc64 crossbuild installation, built on amd64. It is hr> an> around 650MB unzipped, 230MB zipped. I can upload it to freefall later hr> an> this evening. hr> hr> Thanks! After this I could reproduce the problem in a smaller data set and identify the cause. I committed a fix in r230529. Please try it. -- Hiroki ----Security_Multipart(Wed_Jan_25_18_27_04_2012_186)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8fyugACgkQTyzT2CeTzy0QRwCeMn4U3aMOBITDZJsXwLmDOw/U tCsAoK5ZIiauGqxJXKkFK2mE6HHx4/k2 =Q8eR -----END PGP SIGNATURE----- ----Security_Multipart(Wed_Jan_25_18_27_04_2012_186)---- From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 09:57:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5636106566B; Wed, 25 Jan 2012 09:57:34 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8FD508FC08; Wed, 25 Jan 2012 09:57:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0P9vYhU017259; Wed, 25 Jan 2012 09:57:34 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0P9vYq2017256; Wed, 25 Jan 2012 09:57:34 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201250957.q0P9vYq2017256@svn.freebsd.org> From: Alexander Motin Date: Wed, 25 Jan 2012 09:57:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230532 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 09:57:34 -0000 Author: mav Date: Wed Jan 25 09:57:34 2012 New Revision: 230532 URL: http://svn.freebsd.org/changeset/base/230532 Log: Fix word order in hdaa_subvendor_id() to match PCI (where it comes from), broken at r230130. This should fix applying system-specific patches. Modified: head/sys/dev/sound/pci/hda/hdaa.h head/sys/dev/sound/pci/hda/hdaa_patches.c Modified: head/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.h Wed Jan 25 08:53:42 2012 (r230531) +++ head/sys/dev/sound/pci/hda/hdaa.h Wed Jan 25 09:57:34 2012 (r230532) @@ -259,8 +259,8 @@ struct hdaa_chan { hda_get_device_id(devinfo->dev)) #define hdaa_subvendor_id(devinfo) \ - (((uint32_t)hda_get_subvendor_id(devinfo->dev) << 16) + \ - hda_get_subdevice_id(devinfo->dev)) + (((uint32_t)hda_get_subdevice_id(devinfo->dev) << 16) + \ + hda_get_subvendor_id(devinfo->dev)) struct hdaa_widget *hdaa_widget_get(struct hdaa_devinfo *, nid_t); uint32_t hdaa_widget_pin_patch(uint32_t config, const char *str); Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Jan 25 08:53:42 2012 (r230531) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Jan 25 09:57:34 2012 (r230532) @@ -620,9 +620,9 @@ hdaa_patch_direct(struct hdaa_devinfo *d hda_command(dev, HDA_CMD_12BIT(0, devinfo->nid, 0x7e7, 0)); if (id == HDA_CODEC_ALC269) { - if (subid == 0x104316e3 || subid == 0x1043831a || - subid == 0x1043834a || subid == 0x10438398 || - subid == 0x104383ce) { + if (subid == 0x16e31043 || subid == 0x831a1043 || + subid == 0x834a1043 || subid == 0x83981043 || + subid == 0x83ce1043) { /* * The ditital mics on some Asus laptops produce * differential signals instead of expected stereo. From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 10:11:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 242581065729; Wed, 25 Jan 2012 10:11:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6393D8FC1A; Wed, 25 Jan 2012 10:11:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PABsnH017788; Wed, 25 Jan 2012 10:11:54 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PABsSx017787; Wed, 25 Jan 2012 10:11:54 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201201251011.q0PABsSx017787@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 25 Jan 2012 10:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230533 - in head/tools/regression: mdconfig sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 10:11:55 -0000 Author: trasz Date: Wed Jan 25 10:11:54 2012 New Revision: 230533 URL: http://svn.freebsd.org/changeset/base/230533 Log: Move mdconfig(8) tests under regression/sbin/, where they belong. Submitted by: jh@ Added: head/tools/regression/sbin/mdconfig/ - copied from r230532, head/tools/regression/mdconfig/ Deleted: head/tools/regression/mdconfig/ From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 11:03:09 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DEA1106566B; Wed, 25 Jan 2012 11:03:09 +0000 (UTC) (envelope-from andreast@fgznet.ch) Received: from mx1.flashcable.ch (mx1.flashcable.ch [81.92.96.30]) by mx1.freebsd.org (Postfix) with ESMTP id AE2F88FC12; Wed, 25 Jan 2012 11:03:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx1.flashcable.ch (8.13.8/8.13.8/Submit_local) with ESMTP id q0PAWcNm083869; Wed, 25 Jan 2012 11:32:38 +0100 (CET) (envelope-from andreast@fgznet.ch) Received: from phpmailer (borderline21.nexus-ag.com [212.203.104.226]) by localhost with HTTPS (UebiMiau); Wed, 25 Jan 2012 11:32:38 +0100 Date: Wed, 25 Jan 2012 11:32:38 +0100 To: HirokiSato , andreast@FreeBSD.org From: Andreas Tobler Message-ID: <973588bbbbad0f6249c55be570f288d8@212.203.104.226> X-Priority: 3 X-Mailer: PHPMailer [version 1.73] MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="iso-8859-1" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, eadler@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Andreas Tobler List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 11:03:09 -0000 --------- Original Message -------- From: Hiroki Sato To: andreast@FreeBSD.org Cc: eadler@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs Date: 25/01/12 10:21 > Hiroki Sato <hrs@FreeBSD.org> wrote > in <20120125.151236.688056751317619770.hrs@allbsd.org>: > > hr> Andreas Tobler <andreast@FreeBSD.org> wrote > hr> in <4F1F9CD1.9070304@FreeBSD.org>: > hr> > hr> an> It is a powerpc64 crossbuild installation, built on amd64. It is > hr> an> around 650MB unzipped, 230MB zipped. I can upload it to freefall later > hr> an> this evening. > hr> > hr> Thanks! > > After this I could reproduce the problem in a smaller data set and > identify the cause. I committed a fix in r230529. Please try it. I can confirm, it works with this rev. Thank you very much! Andreas From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 11:15:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 813F61065675; Wed, 25 Jan 2012 11:15:52 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 615C88FC1A; Wed, 25 Jan 2012 11:15:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PBFq4a022468; Wed, 25 Jan 2012 11:15:52 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PBFqMo022466; Wed, 25 Jan 2012 11:15:52 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201201251115.q0PBFqMo022466@svn.freebsd.org> From: Andre Oppermann Date: Wed, 25 Jan 2012 11:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230534 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 11:15:52 -0000 Author: andre Date: Wed Jan 25 11:15:52 2012 New Revision: 230534 URL: http://svn.freebsd.org/changeset/base/230534 Log: MFC r226113 and r228016: Prevent TCP sessions from stalling indefinitely in reassembly when reaching the zone limit of reassembly queue entries. Reviewed by: lstewart Modified: stable/8/sys/netinet/tcp_reass.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/tcp_reass.c ============================================================================== --- stable/8/sys/netinet/tcp_reass.c Wed Jan 25 10:11:54 2012 (r230533) +++ stable/8/sys/netinet/tcp_reass.c Wed Jan 25 11:15:52 2012 (r230534) @@ -174,7 +174,9 @@ tcp_reass(struct tcpcb *tp, struct tcphd struct tseg_qent *nq; struct tseg_qent *te = NULL; struct socket *so = tp->t_inpcb->inp_socket; + char *s = NULL; int flags; + struct tseg_qent tqs; INP_WLOCK_ASSERT(tp->t_inpcb); @@ -212,19 +214,45 @@ tcp_reass(struct tcpcb *tp, struct tcphd TCPSTAT_INC(tcps_rcvmemdrop); m_freem(m); *tlenp = 0; + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: queue limit reached, " + "segment dropped\n", s, __func__); + free(s, M_TCPLOG); + } return (0); } /* * Allocate a new queue entry. If we can't, or hit the zone limit * just drop the pkt. + * + * Use a temporary structure on the stack for the missing segment + * when the zone is exhausted. Otherwise we may get stuck. */ te = uma_zalloc(V_tcp_reass_zone, M_NOWAIT); if (te == NULL) { - TCPSTAT_INC(tcps_rcvmemdrop); - m_freem(m); - *tlenp = 0; - return (0); + if (th->th_seq != tp->rcv_nxt) { + TCPSTAT_INC(tcps_rcvmemdrop); + m_freem(m); + *tlenp = 0; + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, + NULL))) { + log(LOG_DEBUG, "%s; %s: global zone limit " + "reached, segment dropped\n", s, __func__); + free(s, M_TCPLOG); + } + return (0); + } else { + bzero(&tqs, sizeof(struct tseg_qent)); + te = &tqs; + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, + NULL))) { + log(LOG_DEBUG, + "%s; %s: global zone limit reached, using " + "stack for missing segment\n", s, __func__); + free(s, M_TCPLOG); + } + } } tp->t_segqlen++; @@ -301,6 +329,8 @@ tcp_reass(struct tcpcb *tp, struct tcphd if (p == NULL) { LIST_INSERT_HEAD(&tp->t_segq, te, tqe_q); } else { + KASSERT(te != &tqs, ("%s: temporary stack based entry not " + "first element in queue", __func__)); LIST_INSERT_AFTER(p, te, tqe_q); } @@ -324,7 +354,8 @@ present: m_freem(q->tqe_m); else sbappendstream_locked(&so->so_rcv, q->tqe_m); - uma_zfree(V_tcp_reass_zone, q); + if (q != &tqs) + uma_zfree(V_tcp_reass_zone, q); tp->t_segqlen--; q = nq; } while (q && q->tqe_th->th_seq == tp->rcv_nxt); From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 11:16:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C64F106566B; Wed, 25 Jan 2012 11:16:32 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 173678FC0C; Wed, 25 Jan 2012 11:16:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PBGVeE022529; Wed, 25 Jan 2012 11:16:31 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PBGVXG022527; Wed, 25 Jan 2012 11:16:31 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201201251116.q0PBGVXG022527@svn.freebsd.org> From: Andre Oppermann Date: Wed, 25 Jan 2012 11:16:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230535 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 11:16:32 -0000 Author: andre Date: Wed Jan 25 11:16:31 2012 New Revision: 230535 URL: http://svn.freebsd.org/changeset/base/230535 Log: MFC r226113 and r228016: Prevent TCP sessions from stalling indefinitely in reassembly when reaching the zone limit of reassembly queue entries. Reviewed by: lstewart Modified: stable/7/sys/netinet/tcp_reass.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_reass.c ============================================================================== --- stable/7/sys/netinet/tcp_reass.c Wed Jan 25 11:15:52 2012 (r230534) +++ stable/7/sys/netinet/tcp_reass.c Wed Jan 25 11:16:31 2012 (r230535) @@ -160,7 +160,9 @@ tcp_reass(struct tcpcb *tp, struct tcphd struct tseg_qent *nq; struct tseg_qent *te = NULL; struct socket *so = tp->t_inpcb->inp_socket; + char *s = NULL; int flags; + struct tseg_qent tqs; INP_WLOCK_ASSERT(tp->t_inpcb); @@ -199,19 +201,45 @@ tcp_reass(struct tcpcb *tp, struct tcphd tcpstat.tcps_rcvmemdrop++; m_freem(m); *tlenp = 0; + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: queue limit reached, " + "segment dropped\n", s, __func__); + free(s, M_TCPLOG); + } return (0); } /* * Allocate a new queue entry. If we can't, or hit the zone limit * just drop the pkt. + * + * Use a temporary structure on the stack for the missing segment + * when the zone is exhausted. Otherwise we may get stuck. */ te = uma_zalloc(tcp_reass_zone, M_NOWAIT); if (te == NULL) { - tcpstat.tcps_rcvmemdrop++; - m_freem(m); - *tlenp = 0; - return (0); + if (th->th_seq != tp->rcv_nxt) { + tcpstat.tcps_rcvmemdrop++; + m_freem(m); + *tlenp = 0; + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, + NULL))) { + log(LOG_DEBUG, "%s; %s: global zone limit " + "reached, segment dropped\n", s, __func__); + free(s, M_TCPLOG); + } + return (0); + } else { + bzero(&tqs, sizeof(struct tseg_qent)); + te = &tqs; + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, + NULL))) { + log(LOG_DEBUG, + "%s; %s: global zone limit reached, using " + "stack for missing segment\n", s, __func__); + free(s, M_TCPLOG); + } + } } tp->t_segqlen++; @@ -287,6 +315,8 @@ tcp_reass(struct tcpcb *tp, struct tcphd if (p == NULL) { LIST_INSERT_HEAD(&tp->t_segq, te, tqe_q); } else { + KASSERT(te != &tqs, ("%s: temporary stack based entry not " + "first element in queue", __func__)); LIST_INSERT_AFTER(p, te, tqe_q); } @@ -310,7 +340,8 @@ present: m_freem(q->tqe_m); else sbappendstream_locked(&so->so_rcv, q->tqe_m); - uma_zfree(tcp_reass_zone, q); + if (q != &tqs) + uma_zfree(tcp_reass_zone, q); tp->t_segqlen--; q = nq; } while (q && q->tqe_th->th_seq == tp->rcv_nxt); From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 11:28:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3E8D1065670; Wed, 25 Jan 2012 11:28:18 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E9AD8FC17; Wed, 25 Jan 2012 11:28:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PBSIDr022915; Wed, 25 Jan 2012 11:28:18 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PBSI3K022913; Wed, 25 Jan 2012 11:28:18 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201201251128.q0PBSI3K022913@svn.freebsd.org> From: Edward Tomasz Napierala Date: Wed, 25 Jan 2012 11:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230536 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 11:28:18 -0000 Author: trasz Date: Wed Jan 25 11:28:18 2012 New Revision: 230536 URL: http://svn.freebsd.org/changeset/base/230536 Log: Fix comment. Modified: head/sys/sys/mdioctl.h Modified: head/sys/sys/mdioctl.h ============================================================================== --- head/sys/sys/mdioctl.h Wed Jan 25 11:16:31 2012 (r230535) +++ head/sys/sys/mdioctl.h Wed Jan 25 11:28:18 2012 (r230536) @@ -86,6 +86,6 @@ struct md_ioctl { #define MD_READONLY 0x08 /* Readonly mode */ #define MD_COMPRESS 0x10 /* Compression mode */ #define MD_FORCE 0x20 /* Don't try to prevent foot-shooting */ -#define MD_ASYNC 0x40 /* Don't try to prevent foot-shooting */ +#define MD_ASYNC 0x40 /* Asynchronous mode */ #endif /* _SYS_MDIOCTL_H_*/ From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 11:45:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 891781065754; Wed, 25 Jan 2012 11:45:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 749DD8FC1B; Wed, 25 Jan 2012 11:45:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PBjoIH023474; Wed, 25 Jan 2012 11:45:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PBjoIv023472; Wed, 25 Jan 2012 11:45:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201251145.q0PBjoIv023472@svn.freebsd.org> From: Alexander Motin Date: Wed, 25 Jan 2012 11:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230537 - head/sys/dev/sound/pcm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 11:45:50 -0000 Author: mav Date: Wed Jan 25 11:45:50 2012 New Revision: 230537 URL: http://svn.freebsd.org/changeset/base/230537 Log: Allow PASSTHROUGH (AC3) to have more then 2 channels. 8 channels can be used to get more then 6.144Mbps bandwidth. Modified: head/sys/dev/sound/pcm/channel.c Modified: head/sys/dev/sound/pcm/channel.c ============================================================================== --- head/sys/dev/sound/pcm/channel.c Wed Jan 25 11:28:18 2012 (r230536) +++ head/sys/dev/sound/pcm/channel.c Wed Jan 25 11:45:50 2012 (r230537) @@ -2000,9 +2000,10 @@ chn_setformat(struct pcm_channel *c, uin int ret; /* XXX force stereo */ - if (format & AFMT_PASSTHROUGH) + if ((format & AFMT_PASSTHROUGH) && AFMT_CHANNEL(format) < 2) { format = SND_FORMAT(format, AFMT_PASSTHROUGH_CHANNEL, AFMT_PASSTHROUGH_EXTCHANNEL); + } oldformat = c->format; oldspeed = c->speed; From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 12:43:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED03B106564A; Wed, 25 Jan 2012 12:43:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D70638FC12; Wed, 25 Jan 2012 12:43:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PChRQ8025307; Wed, 25 Jan 2012 12:43:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PChR9p025305; Wed, 25 Jan 2012 12:43:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201251243.q0PChR9p025305@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 25 Jan 2012 12:43:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230538 - head/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 12:43:28 -0000 Author: kib Date: Wed Jan 25 12:43:27 2012 New Revision: 230538 URL: http://svn.freebsd.org/changeset/base/230538 Log: Order newly added functions alphabetically. Requested by: bde MFC after: 3 days Modified: head/sys/amd64/include/cpufunc.h Modified: head/sys/amd64/include/cpufunc.h ============================================================================== --- head/sys/amd64/include/cpufunc.h Wed Jan 25 11:45:50 2012 (r230537) +++ head/sys/amd64/include/cpufunc.h Wed Jan 25 12:43:27 2012 (r230538) @@ -670,17 +670,6 @@ intr_restore(register_t rflags) } static __inline void -xsetbv(uint32_t reg, uint64_t val) -{ - uint32_t low, hi; - - low = val; - hi = val >> 32; - __asm __volatile(".byte 0x0f,0x01,0xd1" : : - "c" (reg), "a" (low), "d" (hi)); -} - -static __inline void xsave(char *addr, uint64_t mask) { uint32_t low, hi; @@ -693,6 +682,17 @@ xsave(char *addr, uint64_t mask) } static __inline void +xsetbv(uint32_t reg, uint64_t val) +{ + uint32_t low, hi; + + low = val; + hi = val >> 32; + __asm __volatile(".byte 0x0f,0x01,0xd1" : : + "c" (reg), "a" (low), "d" (hi)); +} + +static __inline void xrstor(char *addr, uint64_t mask) { uint32_t low, hi; @@ -768,8 +768,8 @@ u_int rgs(void); void wbinvd(void); void write_rflags(u_int rf); void wrmsr(u_int msr, uint64_t newval); -void xsetbv(uint32_t reg, uint64_t val); void xsave(char *addr, uint64_t mask); +void xsetbv(uint32_t reg, uint64_t val); void xrstor(char *addr, uint64_t mask); #endif /* __GNUCLIKE_ASM && __CC_SUPPORTS___INLINE */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 12:57:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2A52106566C; Wed, 25 Jan 2012 12:57:54 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5FAFE8FC14; Wed, 25 Jan 2012 12:57:53 +0000 (UTC) Received: by lagv3 with SMTP id v3so2879039lag.13 for ; Wed, 25 Jan 2012 04:57:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:x-gm-message-state :content-type:content-transfer-encoding; bh=/Qt1y8SfKOLklS6G9yJD7j+cEYdarTYB1mKcvgXtlaU=; b=nnmBy7HOMvvzfzr34XeyUa6nRvtgXa6m2NHWyOcb/och7StJI8PGgaXDunYlzRjt7H qQWyFyYKtB4IjH+hO2d+BKFWOiuCKQHbCWu40Ww0NcsdABKBr4Eq4q4RqPReKMdCj3M4 MDfxVGyYvfqOrbG4KCXno0hfBgq86Zwnn0gag= Received: by 10.112.82.226 with SMTP id l2mr4368144lby.102.1327496272163; Wed, 25 Jan 2012 04:57:52 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.25.196 with HTTP; Wed, 25 Jan 2012 04:57:21 -0800 (PST) In-Reply-To: <973588bbbbad0f6249c55be570f288d8@212.203.104.226> References: <973588bbbbad0f6249c55be570f288d8@212.203.104.226> From: Eitan Adler Date: Wed, 25 Jan 2012 07:57:21 -0500 X-Google-Sender-Auth: yGMIWrV5hDg6q3uA8P5G0DZy9f8 Message-ID: To: Andreas Tobler X-Gm-Message-State: ALoCoQlBq4KGXg1ZU7cCK7MSmW6rgZhyIcGtdFAfjJJA9zw9W/iqrYdzBMgLp28SkMkFM798jjAB Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, HirokiSato , src-committers@freebsd.org, andreast@freebsd.org Subject: Re: svn commit: r230353 - head/usr.sbin/makefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 12:57:54 -0000 On Wed, Jan 25, 2012 at 5:32 AM, Andreas Tobler wrote: > --------- Original Message -------- > From: Hiroki Sato > To: andreast@FreeBSD.org > Cc: eadler@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.o= rg, > svn-src-head@FreeBSD.org > Subject: Re: svn commit: r230353 - head/usr.sbin/makefs > Date: 25/01/12 10:21 > >> Hiroki Sato <hrs@FreeBSD.org> wrote >> =C2=A0 in <20120125.151236.688056751317619770.hrs@allbsd.org>: >> >> hr> Andreas Tobler <andreast@FreeBSD.org> wrote >> hr> =C2=A0 in <4F1F9CD1.9070304@FreeBSD.org>: >> hr> >> hr> an> It is a powerpc64 crossbuild installation, built on amd64. > It is >> hr> an> around 650MB unzipped, 230MB zipped. I can upload it to > freefall later >> hr> an> this evening. >> hr> >> hr> =C2=A0Thanks! >> >> =C2=A0After this I could reproduce the problem in a smaller data set and >> =C2=A0identify the cause. =C2=A0I committed a fix in r230529. =C2=A0Plea= se try it. Thanks! --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 13:47:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 047EE106566C; Wed, 25 Jan 2012 13:47:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C854F8FC0C; Wed, 25 Jan 2012 13:47:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PDltOk027284; Wed, 25 Jan 2012 13:47:55 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PDlteX027281; Wed, 25 Jan 2012 13:47:55 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201251347.q0PDlteX027281@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 25 Jan 2012 13:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230539 - in stable/9: . release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 13:47:56 -0000 Author: glebius Date: Wed Jan 25 13:47:55 2012 New Revision: 230539 URL: http://svn.freebsd.org/changeset/base/230539 Log: Merge r230127 from head/: Restore functionality to pack several kernels into release. All kernels specified by KERNCONF are built and packed into release. The first one is packed into kernel.txz, all others to kernel.CONFIG.txz. The first one is installed on bootables in /boot. Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/release/Makefile Directory Properties: stable/9/ (props changed) stable/9/release/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Wed Jan 25 12:43:27 2012 (r230538) +++ stable/9/Makefile.inc1 Wed Jan 25 13:47:55 2012 (r230539) @@ -885,10 +885,21 @@ distributekernel distributekernel.debug: ${CROSSENV} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \ DESTDIR=${DESTDIR}/${DISTDIR}/kernel \ ${.TARGET:S/distributekernel/install/} +.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} + cd ${KRNLOBJDIR}/${_kernel}; \ + ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ + KERNEL=${INSTKERNNAME}.${_kernel} \ + DESTDIR=${DESTDIR}/${DISTDIR}/kernel.${_kernel} \ + ${.TARGET:S/distributekernel/install/} +.endfor packagekernel: - ${_+_}cd ${DESTDIR}/${DISTDIR}/kernel; \ + cd ${DESTDIR}/${DISTDIR}/kernel; \ tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz . +.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//} + cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \ + tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz . +.endfor # # doxygen Modified: stable/9/release/Makefile ============================================================================== --- stable/9/release/Makefile Wed Jan 25 12:43:27 2012 (r230538) +++ stable/9/release/Makefile Wed Jan 25 13:47:55 2012 (r230539) @@ -75,7 +75,7 @@ base.txz: kernel.txz: -mkdir ${DISTDIR} cd ${WORLDDIR} && ${IMAKE} distributekernel packagekernel DISTDIR=${DISTDIR} - mv ${DISTDIR}/kernel.txz ${.OBJDIR} + mv ${DISTDIR}/kernel*.txz ${.OBJDIR} src.txz: -mkdir -p ${DISTDIR}/usr From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 13:56:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2834106564A; Wed, 25 Jan 2012 13:56:40 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 921B78FC0A; Wed, 25 Jan 2012 13:56:40 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 4A15446B06; Wed, 25 Jan 2012 08:56:40 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D06BEB95E; Wed, 25 Jan 2012 08:56:39 -0500 (EST) From: John Baldwin To: Ivan Voras Date: Wed, 25 Jan 2012 08:50:54 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201112112102.pBBL21kB068967@svn.freebsd.org> <4F1DE4FF.3080606@FreeBSD.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201201250850.54443.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 25 Jan 2012 08:56:39 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Florian Smeets , src-committers@freebsd.org, Andriy Gapon Subject: Re: svn commit: r228424 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 13:56:40 -0000 On Tuesday, January 24, 2012 5:08:39 am Ivan Voras wrote: > On 23 January 2012 23:53, Florian Smeets wrote: > > > which creates a database work set of ~1.5GB. Max throughput was achieved > > at 20 Clients. > > > At 40 threads the results varied between 43000 - 76500 across reboots. > > Attilio suspects that this can be caused by the kernel memory layout > > changing under the woods creating cache effects difficult to control, > > therefor the scaling factor was reduced to 10 (~150MB work set) and the > > numbers got deterministic across reboot. > > Or possibly NUMA? Though 40 processes and 1.5 GB seem too low for NUMA > effects to be so noticable... It can be noticable for at least some workloads. It may reduce some of the noise in this case. > Was the round-robin allocator talked about in here: > http://lists.freebsd.org/pipermail/freebsd-hackers/2011-October/036525.html > ever actually committed? I seem to remember some other thread which > said it wasn't yet but can't find it now, and I also cannot find the > commit. It is not. > AFAIK the current state of NUMA is still described in > http://svn.freebsd.org/changeset/base/210550 Yes. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 14:02:40 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D6DD31065673; Wed, 25 Jan 2012 14:02:40 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 447ED8FC25; Wed, 25 Jan 2012 14:02:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0PE2ciY074932; Wed, 25 Jan 2012 18:02:38 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0PE2cRI074931; Wed, 25 Jan 2012 18:02:38 +0400 (MSK) (envelope-from ache) Date: Wed, 25 Jan 2012 18:02:37 +0400 From: Andrey Chernov To: Mark Murray , David Schultz Message-ID: <20120125140237.GA74896@vniz.net> Mail-Followup-To: Andrey Chernov , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> <20120120055823.GA28177@vniz.net> <20120120215649.GA40016@vniz.net> <20120122185545.GA11874@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 14:02:40 -0000 On Sun, Jan 22, 2012 at 09:43:02PM +0000, Mark Murray wrote: > > Thanx for review! I'll send final version to this thread a bit > > later when I'll find more free time. Final, unless something else noticed. --- sys/libkern.h.bak 2012-01-16 07:15:12.000000000 +0400 +++ sys/libkern.h 2012-01-25 17:31:49.000000000 +0400 @@ -72,6 +72,7 @@ static __inline quad_t qabs(quad_t a) { /* Prototypes for non-quad routines. */ struct malloc_type; +extern int arc4rand_iniseed_state; uint32_t arc4random(void); void arc4rand(void *ptr, u_int len, int reseed); int bcmp(const void *, const void *, size_t); --- dev/random/randomdev_soft.c.bak 2011-03-02 01:42:19.000000000 +0300 +++ dev/random/randomdev_soft.c 2012-01-25 17:28:19.000000000 +0400 @@ -366,6 +366,8 @@ random_yarrow_unblock(void) selwakeuppri(&random_systat.rsel, PUSER); wakeup(&random_systat); } + if (arc4rand_iniseed_state == 0) + arc4rand_iniseed_state = 1; } static int --- libkern/arc4random.c.bak 2008-08-08 01:51:09.000000000 +0400 +++ libkern/arc4random.c 2012-01-25 17:30:30.000000000 +0400 @@ -24,6 +24,8 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 #define ARC4_RESEED_SECONDS 300 #define ARC4_KEYBYTES (256 / 8) +int arc4rand_iniseed_state = 0; + static u_int8_t arc4_i, arc4_j; static int arc4_numruns = 0; static u_int8_t arc4_sbox[256]; @@ -74,6 +76,8 @@ arc4_randomstir (void) /* Reset for next reseed cycle. */ arc4_t_reseed = tv_now.tv_sec + ARC4_RESEED_SECONDS; arc4_numruns = 0; + if (arc4rand_iniseed_state == 1) + arc4rand_iniseed_state = -1; /* * Throw away the first N words of output, as suggested in the @@ -130,7 +134,7 @@ arc4rand(void *ptr, u_int len, int resee struct timeval tv; getmicrouptime(&tv); - if (reseed || + if (reseed || arc4rand_iniseed_state == 1 || (arc4_numruns > ARC4_RESEED_BYTES) || (tv.tv_sec > arc4_t_reseed)) arc4_randomstir(); -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 14:50:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00FD71065679; Wed, 25 Jan 2012 14:50:13 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3A7F8FC12; Wed, 25 Jan 2012 14:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PEoCZs029246; Wed, 25 Jan 2012 14:50:12 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PEoCe8029243; Wed, 25 Jan 2012 14:50:12 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201251450.q0PEoCe8029243@svn.freebsd.org> From: Guy Helmer Date: Wed, 25 Jan 2012 14:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230541 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 14:50:13 -0000 Author: ghelmer Date: Wed Jan 25 14:50:12 2012 New Revision: 230541 URL: http://svn.freebsd.org/changeset/base/230541 Log: Revert 229667: After some discussion of this change, it seems it is better to leave the pidfile open where it was. Add a note to the man page describing pidfile strategies to use if the daemon is to be run as a user other than root. Modified: head/usr.sbin/daemon/daemon.8 head/usr.sbin/daemon/daemon.c Modified: head/usr.sbin/daemon/daemon.8 ============================================================================== --- head/usr.sbin/daemon/daemon.8 Wed Jan 25 14:38:00 2012 (r230540) +++ head/usr.sbin/daemon/daemon.8 Wed Jan 25 14:50:12 2012 (r230541) @@ -59,6 +59,10 @@ Write the ID of the created process into using the .Xr pidfile 3 functionality. +If the +.Fl u +option is used, the directory to contain the pidfile must be writable +by the specified user. Note, that the file will be created shortly before the process is actually executed, and will remain after the process exits (although it will be removed if the execution fails). Modified: head/usr.sbin/daemon/daemon.c ============================================================================== --- head/usr.sbin/daemon/daemon.c Wed Jan 25 14:38:00 2012 (r230540) +++ head/usr.sbin/daemon/daemon.c Wed Jan 25 14:50:12 2012 (r230541) @@ -79,6 +79,9 @@ main(int argc, char *argv[]) if (argc == 0) usage(); + if (user != NULL) + restrict_process(user); + /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently @@ -94,9 +97,6 @@ main(int argc, char *argv[]) } } - if (user != NULL) - restrict_process(user); - if (daemon(nochdir, noclose) == -1) err(1, NULL); From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 15:30:57 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 08CF51065670; Wed, 25 Jan 2012 15:30:57 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail09.syd.optusnet.com.au (mail09.syd.optusnet.com.au [211.29.132.190]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4F58FC1C; Wed, 25 Jan 2012 15:30:56 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail09.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0PFUk19014011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Jan 2012 02:30:54 +1100 Date: Thu, 26 Jan 2012 02:30:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov In-Reply-To: <201201251243.q0PChR9p025305@svn.freebsd.org> Message-ID: <20120126021130.Y2383@besplex.bde.org> References: <201201251243.q0PChR9p025305@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230538 - head/sys/amd64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 15:30:57 -0000 On Wed, 25 Jan 2012, Konstantin Belousov wrote: > Log: > Order newly added functions alphabetically. > > Requested by: bde > MFC after: 3 days Thanks, but xrstor is still after xs*, and now I wonder why these functions are here at all instead of with the other fpu access macros in fpu.c. Is xsetbv() more general than fpu? Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 17:58:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1896A106564A; Wed, 25 Jan 2012 17:58:48 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07C498FC0A; Wed, 25 Jan 2012 17:58:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PHwl3r036655; Wed, 25 Jan 2012 17:58:47 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PHwlsO036653; Wed, 25 Jan 2012 17:58:47 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201251758.q0PHwlsO036653@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 25 Jan 2012 17:58:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230544 - head/sys/cam X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 17:58:48 -0000 Author: ken Date: Wed Jan 25 17:58:47 2012 New Revision: 230544 URL: http://svn.freebsd.org/changeset/base/230544 Log: Fix a bug introduced in r230000. We were eliminating all LUNs on a target in response to CAM_DEV_NOT_THERE, instead of just the LUN in question. This will now just eliminate the specified LUN in response to CAM_DEV_NOT_THERE. Reported by: Richard Todd MFC after: 3 days Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Wed Jan 25 16:00:00 2012 (r230543) +++ head/sys/cam/cam_periph.c Wed Jan 25 17:58:47 2012 (r230544) @@ -1864,13 +1864,26 @@ cam_periph_error(union ccb *ccb, cam_fla case CAM_DEV_NOT_THERE: { struct cam_path *newpath; + lun_id_t lun_id; error = ENXIO; + + /* + * For a selection timeout, we consider all of the LUNs on + * the target to be gone. If the status is CAM_DEV_NOT_THERE, + * then we only get rid of the device(s) specified by the + * path in the original CCB. + */ + if (status == CAM_DEV_NOT_THERE) + lun_id = xpt_path_lun_id(ccb->ccb_h.path); + else + lun_id = CAM_LUN_WILDCARD; + /* Should we do more if we can't create the path?? */ if (xpt_create_path(&newpath, periph, xpt_path_path_id(ccb->ccb_h.path), xpt_path_target_id(ccb->ccb_h.path), - CAM_LUN_WILDCARD) != CAM_REQ_CMP) + lun_id) != CAM_REQ_CMP) break; /* From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 18:36:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E8451065687; Wed, 25 Jan 2012 18:36:01 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D5D28FC1C; Wed, 25 Jan 2012 18:36:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PIa1qV037894; Wed, 25 Jan 2012 18:36:01 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PIa1sl037892; Wed, 25 Jan 2012 18:36:01 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201251836.q0PIa1sl037892@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 25 Jan 2012 18:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230545 - head/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 18:36:01 -0000 Author: pluknet Date: Wed Jan 25 18:36:01 2012 New Revision: 230545 URL: http://svn.freebsd.org/changeset/base/230545 Log: Clarify and improve the boot menu with some small changes: - Enter instead of ENTER - Remove colons - Line up option values - Use dots to provide a line to visually connect the menu selections with their values - Replace Enabled/Disabled with off/On (bigger inital cap for "On" is a visual indicator) - Remove confusing "Boot" from selections that don't boot. - With loader_color=1 in /boot/loader.conf, use reverse video to highlight enabled options PR: misc/160818 Submitted by: Warren Block Reviewed by: Devin Teske , current@ MFC after: 1 week Modified: head/sys/boot/forth/menu.rc Modified: head/sys/boot/forth/menu.rc ============================================================================== --- head/sys/boot/forth/menu.rc Wed Jan 25 17:58:47 2012 (r230544) +++ head/sys/boot/forth/menu.rc Wed Jan 25 18:36:01 2012 (r230545) @@ -18,9 +18,9 @@ menu-init \ initialize the menu area \ Initialize main menu constructs (see `menu.4th') \ NOTE: To use the `ansi' variants, add `loader_color=1' to loader.conf(5) -set menu_caption[1]="Boot [ENTER]" +set menu_caption[1]="Boot [Enter]" set menu_command[1]="boot" -set ansi_caption[1]="Boot [ENTER]" +set ansi_caption[1]="Boot [Enter]" set menu_keycode[1]="98" set menu_caption[2]="[Esc]ape to loader prompt" @@ -38,34 +38,34 @@ set menu_reboot \ set menu_options=4 -set menu_caption[4]="[A]CPI Support: Disabled" -set toggled_text[4]="[A]CPI Support: Enabled" +set menu_caption[4]="[A]CPI Support off" +set toggled_text[4]="[A]CPI Support On" set menu_command[4]="toggle_acpi" set menu_keycode[4]="97" set menu_acpi=4 -set ansi_caption[4]="ACPI Support: Disabled" -set toggled_ansi[4]="ACPI Support: Enabled" +set ansi_caption[4]="ACPI Support Off" +set toggled_ansi[4]="ACPI Support On" -set menu_caption[5]="Boot Safe [M]ode: NO" -set toggled_text[5]="Boot Safe [M]ode: YES" +set menu_caption[5]="Safe [M]ode... off" +set toggled_text[5]="Safe [M]ode... On" set menu_command[5]="toggle_safemode" set menu_keycode[5]="109" -set ansi_caption[5]="Boot Safe Mode: NO" -set toggled_ansi[5]="Boot Safe Mode: YES" +set ansi_caption[5]="Safe Mode... Off" +set toggled_ansi[5]="Safe Mode... On" -set menu_caption[6]="Boot [S]ingle User: NO" -set toggled_text[6]="Boot [S]ingle User: YES" +set menu_caption[6]="[S]ingle User. off" +set toggled_text[6]="[S]ingle User. On" set menu_command[6]="toggle_singleuser" set menu_keycode[6]="115" -set ansi_caption[6]="Boot Single User: NO" -set toggled_ansi[6]="Boot Single User: YES" +set ansi_caption[6]="Single User. Off" +set toggled_ansi[6]="Single User. On" -set menu_caption[7]="Boot [V]erbose: NO" -set toggled_text[7]="Boot [V]erbose: YES" +set menu_caption[7]="[V]erbose..... off" +set toggled_text[7]="[V]erbose..... On" set menu_command[7]="toggle_verbose" set menu_keycode[7]="118" -set ansi_caption[7]="Boot Verbose: NO" -set toggled_ansi[7]="Boot Verbose: YES" +set ansi_caption[7]="Verbose..... Off" +set toggled_ansi[7]="Verbose..... On" \ Enable automatic booting (add ``autoboot_delay=N'' to loader.conf(5) to \ customize the timeout; default is 10-seconds) From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 18:49:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D27E106566C; Wed, 25 Jan 2012 18:49:12 +0000 (UTC) (envelope-from stefanf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0C3AF8FC12; Wed, 25 Jan 2012 18:49:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PInBcK038315; Wed, 25 Jan 2012 18:49:11 GMT (envelope-from stefanf@svn.freebsd.org) Received: (from stefanf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PInB2p038313; Wed, 25 Jan 2012 18:49:11 GMT (envelope-from stefanf@svn.freebsd.org) Message-Id: <201201251849.q0PInB2p038313@svn.freebsd.org> From: Stefan Farfeleder Date: Wed, 25 Jan 2012 18:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230546 - head/usr.bin/bc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 18:49:12 -0000 Author: stefanf Date: Wed Jan 25 18:49:11 2012 New Revision: 230546 URL: http://svn.freebsd.org/changeset/base/230546 Log: Remove extra sentence, a leftover from r202845. Modified: head/usr.bin/bc/bc.1 Modified: head/usr.bin/bc/bc.1 ============================================================================== --- head/usr.bin/bc/bc.1 Wed Jan 25 18:36:01 2012 (r230545) +++ head/usr.bin/bc/bc.1 Wed Jan 25 18:49:11 2012 (r230546) @@ -82,8 +82,6 @@ Prints usage information. Allow specification of an arbitrary precision math library. The definitions in the library are available to command line expressions. -Synonym for -.Fl l . .It Fl v , Fl Fl version Prints version information. .El From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 19:20:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29C381065678 for ; Wed, 25 Jan 2012 19:20:09 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [IPv6:2a01:348:0:15:5d59:5c20:0:2]) by mx1.freebsd.org (Postfix) with ESMTP id 38DAB8FC17 for ; Wed, 25 Jan 2012 19:20:08 +0000 (UTC) Received: from uucp by gromit.grondar.org with local-rmail (Exim 4.76 (FreeBSD)) (envelope-from ) id 1Rq8O7-0000P8-4f for svn-src-all@freebsd.org; Wed, 25 Jan 2012 19:20:07 +0000 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Rq8Kn-000Ms9-KE; Wed, 25 Jan 2012 19:16:41 +0000 To: Andrey Chernov In-reply-to: <20120125140237.GA74896@vniz.net> References: <201201162018.q0GKIADK050161@svn.freebsd.org> <20120118061943.GA80874@vniz.net> <20120120055823.GA28177@vniz.net> <20120120215649.GA40016@vniz.net> <20120122185545.GA11874@vniz.net> <20120125140237.GA74896@vniz.net> From: Mark Murray Date: Wed, 25 Jan 2012 19:16:41 +0000 Message-Id: Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 19:20:09 -0000 Andrey Chernov writes: > On Sun, Jan 22, 2012 at 09:43:02PM +0000, Mark Murray wrote: > > > Thanx for review! I'll send final version to this thread a bit > > > later when I'll find more free time. > > Final, unless something else noticed. Cool. NOTE: I am only eyeballing this, not testing it. > --- sys/libkern.h.bak 2012-01-16 07:15:12.000000000 +0400 > +++ sys/libkern.h 2012-01-25 17:31:49.000000000 +0400 > @@ -72,6 +72,7 @@ static __inline quad_t qabs(quad_t a) { > > /* Prototypes for non-quad routines. */ > struct malloc_type; > +extern int arc4rand_iniseed_state; > uint32_t arc4random(void); > void arc4rand(void *ptr, u_int len, int reseed); > int bcmp(const void *, const void *, size_t); Fine. > --- dev/random/randomdev_soft.c.bak 2011-03-02 01:42:19.000000000 +0300 > +++ dev/random/randomdev_soft.c 2012-01-25 17:28:19.000000000 +0400 > @@ -366,6 +366,8 @@ random_yarrow_unblock(void) > selwakeuppri(&random_systat.rsel, PUSER); > wakeup(&random_systat); > } > + if (arc4rand_iniseed_state == 0) > + arc4rand_iniseed_state = 1; > } > > static int I thought you were going to do this as a function? It would be slightly neater to do it that way. > --- libkern/arc4random.c.bak 2008-08-08 01:51:09.000000000 +0400 > +++ libkern/arc4random.c 2012-01-25 17:30:30.000000000 +0400 > @@ -24,6 +24,8 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 > #define ARC4_RESEED_SECONDS 300 > #define ARC4_KEYBYTES (256 / 8) > > +int arc4rand_iniseed_state = 0; > + > static u_int8_t arc4_i, arc4_j; > static int arc4_numruns = 0; > static u_int8_t arc4_sbox[256]; > @@ -74,6 +76,8 @@ arc4_randomstir (void) > /* Reset for next reseed cycle. */ > arc4_t_reseed = tv_now.tv_sec + ARC4_RESEED_SECONDS; > arc4_numruns = 0; > + if (arc4rand_iniseed_state == 1) > + arc4rand_iniseed_state = -1; > > /* > * Throw away the first N words of output, as suggested in the > @@ -130,7 +134,7 @@ arc4rand(void *ptr, u_int len, int resee > struct timeval tv; > > getmicrouptime(&tv); > - if (reseed || > + if (reseed || arc4rand_iniseed_state == 1 || > (arc4_numruns > ARC4_RESEED_BYTES) || > (tv.tv_sec > arc4_t_reseed)) > arc4_randomstir(); Looks good! Are you sure this needs no locking or volatile variables? M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 20:05:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D7CD1065675; Wed, 25 Jan 2012 20:05:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A9628FC13; Wed, 25 Jan 2012 20:05:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PK5xkx043298; Wed, 25 Jan 2012 20:05:59 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PK5xNP043290; Wed, 25 Jan 2012 20:05:59 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201201252005.q0PK5xNP043290@svn.freebsd.org> From: John Baldwin Date: Wed, 25 Jan 2012 20:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230547 - in head: sbin/mount_nfs sys/fs/nfsclient sys/nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 20:05:59 -0000 Author: jhb Date: Wed Jan 25 20:05:58 2012 New Revision: 230547 URL: http://svn.freebsd.org/changeset/base/230547 Log: Add a timeout on positive name cache entries in the NFS client. That is, we will only trust a positive name cache entry for a specified amount of time before falling back to a LOOKUP RPC, even if the ctime for the file handle matches the cached copy in the name cache entry. The timeout is configured via a new 'nametimeo' mount option and defaults to 60 seconds. It may be set to zero to disable positive name caching entirely. Reviewed by: rmacklem MFC after: 1 week Modified: head/sbin/mount_nfs/mount_nfs.8 head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nfsclient/nfsmount.h head/sys/nfsclient/nfs_vfsops.c head/sys/nfsclient/nfs_vnops.c head/sys/nfsclient/nfsmount.h Modified: head/sbin/mount_nfs/mount_nfs.8 ============================================================================== --- head/sbin/mount_nfs/mount_nfs.8 Wed Jan 25 18:49:11 2012 (r230546) +++ head/sbin/mount_nfs/mount_nfs.8 Wed Jan 25 20:05:58 2012 (r230547) @@ -157,6 +157,10 @@ Force the mount protocol to use UDP tran (Necessary for some old .Bx servers.) +.It Cm nametimeo Ns = Ns Aq Ar value +Override the default of NFS_DEFAULT_NAMETIMEO for the timeout (in seconds) +for positive name cache entries. +If this is set to 0 it disables positive name caching for the mount point. .It Cm negnametimeo Ns = Ns Aq Ar value Override the default of NFS_DEFAULT_NEGNAMETIMEO for the timeout (in seconds) for negative name cache entries. If this is set to 0 it disables negative Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Wed Jan 25 18:49:11 2012 (r230546) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Wed Jan 25 20:05:58 2012 (r230547) @@ -104,7 +104,7 @@ static void nfs_decode_args(struct mount static int mountnfs(struct nfs_args *, struct mount *, struct sockaddr *, char *, u_char *, int, u_char *, int, u_char *, int, struct vnode **, struct ucred *, - struct thread *, int); + struct thread *, int, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, struct sockaddr_storage *, int *, off_t *, struct timeval *); @@ -520,7 +520,8 @@ nfs_mountdiskless(char *path, dirlen = 0; nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); if ((error = mountnfs(args, mp, nam, path, NULL, 0, dirpath, dirlen, - NULL, 0, vpp, td->td_ucred, td, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { + NULL, 0, vpp, td->td_ucred, td, NFS_DEFAULT_NAMETIMEO, + NFS_DEFAULT_NEGNAMETIMEO)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -715,7 +716,7 @@ static const char *nfs_opts[] = { "from" "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "resvport", "readahead", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", "principal", "nfsv4", "gssname", "allgssname", "dirpath", - "negnametimeo", "nocto", "wcommitsize", + "nametimeo", "negnametimeo", "nocto", "wcommitsize", NULL }; /* @@ -760,6 +761,7 @@ nfs_mount(struct mount *mp) char hst[MNAMELEN]; u_char nfh[NFSX_FHMAX], krbname[100], dirpath[100], srvkrbname[100]; char *opt, *name, *secname; + int nametimeo = NFS_DEFAULT_NAMETIMEO; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; int dirlen, has_nfs_args_opt, krbnamelen, srvkrbnamelen; size_t hstlen; @@ -968,6 +970,14 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_TIMEO; } + if (vfs_getopt(mp->mnt_optnew, "nametimeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &nametimeo); + if (ret != 1 || nametimeo < 0) { + vfs_mount_error(mp, "illegal nametimeo: %s", opt); + error = EINVAL; + goto out; + } + } if (vfs_getopt(mp->mnt_optnew, "negnametimeo", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &negnametimeo); @@ -1126,7 +1136,7 @@ nfs_mount(struct mount *mp) args.fh = nfh; error = mountnfs(&args, mp, nam, hst, krbname, krbnamelen, dirpath, dirlen, srvkrbname, srvkrbnamelen, &vp, td->td_ucred, td, - negnametimeo); + nametimeo, negnametimeo); out: if (!error) { MNT_ILOCK(mp); @@ -1170,7 +1180,7 @@ static int mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, char *hst, u_char *krbname, int krbnamelen, u_char *dirpath, int dirlen, u_char *srvkrbname, int srvkrbnamelen, struct vnode **vpp, - struct ucred *cred, struct thread *td, int negnametimeo) + struct ucred *cred, struct thread *td, int nametimeo, int negnametimeo) { struct nfsmount *nmp; struct nfsnode *np; @@ -1237,13 +1247,14 @@ mountnfs(struct nfs_args *argp, struct m } vfs_getnewfsid(mp); nmp->nm_mountp = mp; - mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK); + mtx_init(&nmp->nm_mtx, "NFSmount lock", NULL, MTX_DEF | MTX_DUPOK); /* - * Since nfs_decode_args() might optionally set them, these need to - * set to defaults before the call, so that the optional settings - * aren't overwritten. + * Since nfs_decode_args() might optionally set them, these + * need to be set to defaults before the call, so that the + * optional settings aren't overwritten. */ + nmp->nm_nametimeo = nametimeo; nmp->nm_negnametimeo = negnametimeo; nmp->nm_timeo = NFS_TIMEO; nmp->nm_retry = NFS_RETRANS; Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Jan 25 18:49:11 2012 (r230546) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Jan 25 20:05:58 2012 (r230547) @@ -1063,7 +1063,8 @@ nfs_lookup(struct vop_lookup_args *ap) * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback - * to doing a lookup RPC. + * to doing a lookup RPC. We also only trust cache + * entries for less than nm_nametimeo seconds. * * To better handle stale file handles and attributes, * clear the attribute cache of this node if it is a @@ -1085,7 +1086,8 @@ nfs_lookup(struct vop_lookup_args *ap) mtx_unlock(&newnp->n_mtx); } if (nfscl_nodeleg(newvp, 0) == 0 || - (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && + ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && + VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && timespeccmp(&vattr.va_ctime, &nctime, ==))) { NFSINCRGLOBAL(newnfsstats.lookupcache_hits); if (cnp->cn_nameiop != LOOKUP && Modified: head/sys/fs/nfsclient/nfsmount.h ============================================================================== --- head/sys/fs/nfsclient/nfsmount.h Wed Jan 25 18:49:11 2012 (r230546) +++ head/sys/fs/nfsclient/nfsmount.h Wed Jan 25 20:05:58 2012 (r230547) @@ -66,6 +66,7 @@ struct nfsmount { u_int64_t nm_maxfilesize; /* maximum file size */ int nm_tprintf_initial_delay; /* initial delay */ int nm_tprintf_delay; /* interval for messages */ + int nm_nametimeo; /* timeout for +ve entries (sec) */ int nm_negnametimeo; /* timeout for -ve entries (sec) */ /* Newnfs additions */ @@ -106,6 +107,10 @@ struct nfsmount { */ #define VFSTONFS(mp) ((struct nfsmount *)((mp)->mnt_data)) +#ifndef NFS_DEFAULT_NAMETIMEO +#define NFS_DEFAULT_NAMETIMEO 60 +#endif + #ifndef NFS_DEFAULT_NEGNAMETIMEO #define NFS_DEFAULT_NEGNAMETIMEO 60 #endif Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Wed Jan 25 18:49:11 2012 (r230546) +++ head/sys/nfsclient/nfs_vfsops.c Wed Jan 25 20:05:58 2012 (r230547) @@ -117,7 +117,7 @@ static void nfs_decode_args(struct mount struct nfs_args *argp, const char *hostname); static int mountnfs(struct nfs_args *, struct mount *, struct sockaddr *, char *, struct vnode **, - struct ucred *cred, int); + struct ucred *cred, int, int); static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *, struct sockaddr_storage *, int *, off_t *, struct timeval *); @@ -559,8 +559,8 @@ nfs_mountdiskless(char *path, int error; nam = sodupsockaddr((struct sockaddr *)sin, M_WAITOK); - if ((error = mountnfs(args, mp, nam, path, vpp, - td->td_ucred, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { + if ((error = mountnfs(args, mp, nam, path, vpp, td->td_ucred, + NFS_DEFAULT_NAMETIMEO, NFS_DEFAULT_NEGNAMETIMEO)) != 0) { printf("nfs_mountroot: mount %s on /: %d\n", path, error); return (error); } @@ -788,6 +788,7 @@ static const char *nfs_opts[] = { "from" "wsize", "rsize", "retrans", "acregmin", "acregmax", "acdirmin", "acdirmax", "deadthresh", "hostname", "timeout", "addr", "fh", "nfsv3", "sec", "maxgroups", "principal", "negnametimeo", "nocto", "wcommitsize", + "nametimeo", NULL }; /* @@ -836,6 +837,7 @@ nfs_mount(struct mount *mp) size_t len; u_char nfh[NFSX_V3FHMAX]; char *opt; + int nametimeo = NFS_DEFAULT_NAMETIMEO; int negnametimeo = NFS_DEFAULT_NEGNAMETIMEO; has_nfs_args_opt = 0; @@ -1058,6 +1060,14 @@ nfs_mount(struct mount *mp) } args.flags |= NFSMNT_MAXGRPS; } + if (vfs_getopt(mp->mnt_optnew, "nametimeo", (void **)&opt, NULL) == 0) { + ret = sscanf(opt, "%d", &nametimeo); + if (ret != 1 || nametimeo < 0) { + vfs_mount_error(mp, "illegal nametimeo: %s", opt); + error = EINVAL; + goto out; + } + } if (vfs_getopt(mp->mnt_optnew, "negnametimeo", (void **)&opt, NULL) == 0) { ret = sscanf(opt, "%d", &negnametimeo); @@ -1182,7 +1192,7 @@ nfs_mount(struct mount *mp) goto out; } error = mountnfs(&args, mp, nam, args.hostname, &vp, - curthread->td_ucred, negnametimeo); + curthread->td_ucred, nametimeo, negnametimeo); out: if (!error) { MNT_ILOCK(mp); @@ -1224,7 +1234,8 @@ nfs_cmount(struct mntarg *ma, void *data */ static int mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, - char *hst, struct vnode **vpp, struct ucred *cred, int negnametimeo) + char *hst, struct vnode **vpp, struct ucred *cred, int nametimeo, + int negnametimeo) { struct nfsmount *nmp; struct nfsnode *np; @@ -1274,6 +1285,7 @@ mountnfs(struct nfs_args *argp, struct m nmp->nm_numgrps = NFS_MAXGRPS; nmp->nm_readahead = NFS_DEFRAHEAD; nmp->nm_deadthresh = NFS_MAXDEADTHRESH; + nmp->nm_nametimeo = nametimeo; nmp->nm_negnametimeo = negnametimeo; nmp->nm_tprintf_delay = nfs_tprintf_delay; if (nmp->nm_tprintf_delay < 0) Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Wed Jan 25 18:49:11 2012 (r230546) +++ head/sys/nfsclient/nfs_vnops.c Wed Jan 25 20:05:58 2012 (r230547) @@ -959,7 +959,8 @@ nfs_lookup(struct vop_lookup_args *ap) * We only accept a positive hit in the cache if the * change time of the file matches our cached copy. * Otherwise, we discard the cache entry and fallback - * to doing a lookup RPC. + * to doing a lookup RPC. We also only trust cache + * entries for less than nm_nametimeo seconds. * * To better handle stale file handles and attributes, * clear the attribute cache of this node if it is a @@ -980,7 +981,8 @@ nfs_lookup(struct vop_lookup_args *ap) KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(newvp); mtx_unlock(&newnp->n_mtx); } - if (VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && + if ((u_int)(ticks - ncticks) < (nmp->nm_nametimeo * hz) && + VOP_GETATTR(newvp, &vattr, cnp->cn_cred) == 0 && timespeccmp(&vattr.va_ctime, &nctime, ==)) { nfsstats.lookupcache_hits++; if (cnp->cn_nameiop != LOOKUP && Modified: head/sys/nfsclient/nfsmount.h ============================================================================== --- head/sys/nfsclient/nfsmount.h Wed Jan 25 18:49:11 2012 (r230546) +++ head/sys/nfsclient/nfsmount.h Wed Jan 25 20:05:58 2012 (r230547) @@ -83,6 +83,7 @@ struct nfsmount { struct rpc_timers nm_timers[NFS_MAX_TIMER]; /* RTT Timers for rpcs */ char nm_principal[MNAMELEN]; /* GSS-API principal of server */ gss_OID nm_mech_oid; /* OID of selected GSS-API mechanism */ + int nm_nametimeo; /* timeout for +ve entries (sec) */ int nm_negnametimeo; /* timeout for -ve entries (sec) */ /* NFSv4 */ @@ -116,6 +117,10 @@ struct nfsmount { #define NFS_TPRINTF_DELAY 30 #endif +#ifndef NFS_DEFAULT_NAMETIMEO +#define NFS_DEFAULT_NAMETIMEO 60 +#endif + #ifndef NFS_DEFAULT_NEGNAMETIMEO #define NFS_DEFAULT_NEGNAMETIMEO 60 #endif From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 20:13:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 616C6106566C; Wed, 25 Jan 2012 20:13:38 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5041E8FC0A; Wed, 25 Jan 2012 20:13:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PKDcpB043574; Wed, 25 Jan 2012 20:13:38 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PKDcOP043572; Wed, 25 Jan 2012 20:13:38 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201252013.q0PKDcOP043572@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 25 Jan 2012 20:13:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230548 - head/usr.bin/procstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 20:13:38 -0000 Author: trociny Date: Wed Jan 25 20:13:37 2012 New Revision: 230548 URL: http://svn.freebsd.org/changeset/base/230548 Log: After the recent changes there is no need in rlimit array any more. Submitted by: Andrey Zonov MFC after: 1 week Modified: head/usr.bin/procstat/procstat_rlimit.c Modified: head/usr.bin/procstat/procstat_rlimit.c ============================================================================== --- head/usr.bin/procstat/procstat_rlimit.c Wed Jan 25 20:05:58 2012 (r230547) +++ head/usr.bin/procstat/procstat_rlimit.c Wed Jan 25 20:13:37 2012 (r230548) @@ -66,8 +66,6 @@ static struct { #error "Resource limits have grown. Add new entries to rlimit_param[]." #endif -static struct rlimit rlimit[RLIM_NLIMITS]; - static const char *humanize_rlimit(int indx, rlim_t limit) { @@ -90,6 +88,7 @@ const char *humanize_rlimit(int indx, rl void procstat_rlimit(struct kinfo_proc *kipp) { + struct rlimit rlimit; int error, i, name[5]; size_t len; @@ -104,7 +103,7 @@ procstat_rlimit(struct kinfo_proc *kipp) name[3] = kipp->ki_pid; for (i = 0; i < RLIM_NLIMITS; i++) { name[4] = i; - error = sysctl(name, 5, &rlimit[i], &len, NULL, 0); + error = sysctl(name, 5, &rlimit, &len, NULL, 0); if (error < 0 && errno != ESRCH) { warn("sysctl: kern.proc.rlimit: %d", kipp->ki_pid); return; @@ -114,7 +113,7 @@ procstat_rlimit(struct kinfo_proc *kipp) printf("%5d %-16s %-16s ", kipp->ki_pid, kipp->ki_comm, rlimit_param[i].name); - printf("%16s ", humanize_rlimit(i, rlimit[i].rlim_cur)); - printf("%16s\n", humanize_rlimit(i, rlimit[i].rlim_max)); - } + printf("%16s ", humanize_rlimit(i, rlimit.rlim_cur)); + printf("%16s\n", humanize_rlimit(i, rlimit.rlim_max)); + } } From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 20:14:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 53058106564A; Wed, 25 Jan 2012 20:14:42 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 415728FC13; Wed, 25 Jan 2012 20:14:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PKEgQB043644; Wed, 25 Jan 2012 20:14:42 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PKEgaq043641; Wed, 25 Jan 2012 20:14:42 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201252014.q0PKEgaq043641@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 25 Jan 2012 20:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230549 - head/usr.bin/limits X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 20:14:42 -0000 Author: trociny Date: Wed Jan 25 20:14:41 2012 New Revision: 230549 URL: http://svn.freebsd.org/changeset/base/230549 Log: Add -P option to allow get and set limits for other processes. Submitted by: Andrey Zonov MFC after: 2 weeks Modified: head/usr.bin/limits/limits.1 head/usr.bin/limits/limits.c Modified: head/usr.bin/limits/limits.1 ============================================================================== --- head/usr.bin/limits/limits.1 Wed Jan 25 20:13:37 2012 (r230548) +++ head/usr.bin/limits/limits.1 Wed Jan 25 20:14:41 2012 (r230549) @@ -19,7 +19,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2011 +.Dd January 23, 2011 .Dt LIMITS 1 .Os .Sh NAME @@ -27,7 +27,7 @@ .Nd set or display process resource limits .Sh SYNOPSIS .Nm -.Op Fl C Ar class | Fl U Ar user +.Op Fl C Ar class | Fl P Ar pid | Fl U Ar user .Op Fl SHB .Op Fl ea .Op Fl bcdflmnstuvpw Op Ar val @@ -143,6 +143,9 @@ for the class are used, if it exists, or the .Dq Li root class if the user is a superuser account. +.It Fl P Ar pid +Select or set limits for the process identified by the +.Ar pid . .It Fl S Select display or setting of .Dq soft Modified: head/usr.bin/limits/limits.c ============================================================================== --- head/usr.bin/limits/limits.c Wed Jan 25 20:13:37 2012 (r230548) +++ head/usr.bin/limits/limits.c Wed Jan 25 20:14:41 2012 (r230549) @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -249,6 +250,8 @@ static void usage(void); static int getshelltype(void); static void print_limit(rlim_t limit, unsigned divisor, const char *inf, const char *pfx, const char *sfx, const char *which); +static void getrlimit_proc(pid_t pid, int resource, struct rlimit *rlp); +static void setrlimit_proc(pid_t pid, int resource, const struct rlimit *rlp); extern char **environ; static const char rcs_string[] = RCS_STRING; @@ -262,24 +265,24 @@ main(int argc, char *argv[]) int rcswhich, shelltype; int i, num_limits = 0; int ch, doeval = 0, doall = 0; - int rtrn; + int rtrn, setproc; login_cap_t * lc = NULL; enum { ANY=0, SOFT=1, HARD=2, BOTH=3, DISPLAYONLY=4 } type = ANY; enum { RCSUNKNOWN=0, RCSSET=1, RCSSEL=2 } todo = RCSUNKNOWN; int which_limits[RLIM_NLIMITS]; rlim_t set_limits[RLIM_NLIMITS]; struct rlimit limits[RLIM_NLIMITS]; + pid_t pid; /* init resource tables */ for (i = 0; i < RLIM_NLIMITS; i++) { which_limits[i] = 0; /* Don't set/display any */ set_limits[i] = RLIM_INFINITY; - /* Get current resource values */ - getrlimit(i, &limits[i]); } + pid = -1; optarg = NULL; - while ((ch = getopt(argc, argv, ":EeC:U:BSHab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) { + while ((ch = getopt(argc, argv, ":EeC:U:BSHP:ab:c:d:f:l:m:n:s:t:u:v:p:w:")) != -1) { switch(ch) { case 'a': doall = 1; @@ -312,6 +315,12 @@ main(int argc, char *argv[]) case 'B': type = SOFT|HARD; break; + case 'P': + if (!isdigit(*optarg) || (pid = atoi(optarg)) < 0) { + warnx("invalid pid `%s'", optarg); + usage(); + } + break; default: case ':': /* Without arg */ if ((p = strchr(rcs_string, optopt)) != NULL) { @@ -335,6 +344,30 @@ main(int argc, char *argv[]) optarg = NULL; } + if (pid != -1) { + if (cls != NULL) { + warnx("-C cannot be used with -P option"); + usage(); + } + if (pwd != NULL) { + warnx("-U cannot be used with -P option"); + usage(); + } + } + + /* Get current resource values */ + setproc = 0; + for (i = 0; i < RLIM_NLIMITS; i++) { + if (pid == -1) { + getrlimit(i, &limits[i]); + } else if (doall || num_limits == 0) { + getrlimit_proc(pid, i, &limits[i]); + } else if (which_limits[i] != 0) { + getrlimit_proc(pid, i, &limits[i]); + setproc = 1; + } + } + /* If user was specified, get class from that */ if (pwd != NULL) lc = login_getpwclass(pwd); @@ -414,6 +447,10 @@ main(int argc, char *argv[]) warnx("-e cannot be used with `cmd' option"); usage(); } + if (pid != -1) { + warnx("-P cannot be used with `cmd' option"); + usage(); + } login_close(lc); @@ -440,6 +477,14 @@ main(int argc, char *argv[]) err(1, "%s", *argv); } + if (setproc) { + for (rcswhich = 0; rcswhich < RLIM_NLIMITS; rcswhich++) { + if (which_limits[rcswhich] != 0) + setrlimit_proc(pid, rcswhich, &limits[rcswhich]); + } + exit(EXIT_SUCCESS); + } + shelltype = doeval ? getshelltype() : SH_NONE; if (type == ANY) /* Default to soft limits */ @@ -493,7 +538,8 @@ static void usage(void) { (void)fprintf(stderr, -"usage: limits [-C class|-U user] [-eaSHBE] [-bcdflmnstuvpw [val]] [[name=val ...] cmd]\n"); + "usage: limits [-C class|-P pid|-U user] [-eaSHBE] " + "[-bcdflmnstuvpw [val]] [[name=val ...] cmd]\n"); exit(EXIT_FAILURE); } @@ -677,3 +723,38 @@ getshelltype(void) return SH_SH; } +static void +getrlimit_proc(pid_t pid, int resource, struct rlimit *rlp) +{ + int error; + int name[5]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = pid; + name[4] = resource; + len = sizeof(*rlp); + error = sysctl(name, 5, rlp, &len, NULL, 0); + if (error == -1) + err(EXIT_FAILURE, "sysctl: kern.proc.rlimit: %d", pid); + if (len != sizeof(*rlp)) + errx(EXIT_FAILURE, "sysctl() returns wrong size"); +} + +static void +setrlimit_proc(pid_t pid, int resource, const struct rlimit *rlp) +{ + int error; + int name[5]; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_RLIMIT; + name[3] = pid; + name[4] = resource; + error = sysctl(name, 5, NULL, 0, rlp, sizeof(*rlp)); + if (error == -1) + err(EXIT_FAILURE, "sysctl: kern.proc.rlimit: %d", pid); +} From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 20:15:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B6F5106566C; Wed, 25 Jan 2012 20:15:59 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A4F18FC0C; Wed, 25 Jan 2012 20:15:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PKFxaO043725; Wed, 25 Jan 2012 20:15:59 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PKFxDV043722; Wed, 25 Jan 2012 20:15:59 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201201252015.q0PKFxDV043722@svn.freebsd.org> From: Mikolaj Golub Date: Wed, 25 Jan 2012 20:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230550 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 20:15:59 -0000 Author: trociny Date: Wed Jan 25 20:15:58 2012 New Revision: 230550 URL: http://svn.freebsd.org/changeset/base/230550 Log: Fix CTL flags in the declarations of KERN_PROC_ENV, AUXV and PS_STRINGS sysctls: they are read only. MFC after: 1 week Modified: head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Jan 25 20:14:41 2012 (r230549) +++ head/sys/kern/kern_proc.c Wed Jan 25 20:15:58 2012 (r230550) @@ -2508,13 +2508,11 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_args, "Process argument list"); -static SYSCTL_NODE(_kern_proc, KERN_PROC_ENV, env, - CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, +static SYSCTL_NODE(_kern_proc, KERN_PROC_ENV, env, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc_env, "Process environment"); -static SYSCTL_NODE(_kern_proc, KERN_PROC_AUXV, auxv, - CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, - sysctl_kern_proc_auxv, "Process ELF auxiliary vector"); +static SYSCTL_NODE(_kern_proc, KERN_PROC_AUXV, auxv, CTLFLAG_RD | + CTLFLAG_MPSAFE, sysctl_kern_proc_auxv, "Process ELF auxiliary vector"); static SYSCTL_NODE(_kern_proc, KERN_PROC_PATHNAME, pathname, CTLFLAG_RD | CTLFLAG_MPSAFE, sysctl_kern_proc_pathname, "Process executable path"); @@ -2571,6 +2569,6 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, sysctl_kern_proc_rlimit, "Process resource limits"); -static SYSCTL_NODE(_kern_proc, KERN_PROC_PS_STRINGS, ps_strings, - CTLFLAG_RW | CTLFLAG_ANYBODY | CTLFLAG_MPSAFE, - sysctl_kern_proc_ps_strings, "Process ps_strings location"); +static SYSCTL_NODE(_kern_proc, KERN_PROC_PS_STRINGS, ps_strings, CTLFLAG_RD | + CTLFLAG_MPSAFE, sysctl_kern_proc_ps_strings, + "Process ps_strings location"); From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 20:46:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04E13106564A; Wed, 25 Jan 2012 20:46:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E63AE8FC13; Wed, 25 Jan 2012 20:46:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PKkAeg044761; Wed, 25 Jan 2012 20:46:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PKkAEj044757; Wed, 25 Jan 2012 20:46:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201252046.q0PKkAEj044757@svn.freebsd.org> From: Alexander Motin Date: Wed, 25 Jan 2012 20:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230551 - in head: share/man/man4 sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 20:46:11 -0000 Author: mav Date: Wed Jan 25 20:46:10 2012 New Revision: 230551 URL: http://svn.freebsd.org/changeset/base/230551 Log: Rewrite jack presence detection and implement automatic recording source selection in snd_hda(4) driver. Now driver tracks jack presence detection status for every CODEC pin. For playback associations, when configured, that information, same as before, can be used to automatically redirect audio to headphones. Also same as before, these events are used to track digital display connection status and fetch ELD. Now in addition to that driver uses that information to automatically switch recording source of the mixer to the connected input. When there are devices with no jack detection and with one both connected, last ones will have the precedence. As result, on most laptops after boot internal microphone should be automatically selected. But if external one (for example, headset) connected, it will be selected automatically. When external mic disconnected, internal one will be selected again. Automatic recording source selection is enabled by default now to make recording work out of the box without touching mixer. But it can be disabled or limited only to attach time using hint.pcm.X.rec.autosrc loader tunables or dev.pcm.X.rec.autosrc sysctls. MFC after: 2 months Sponsored by: iXsystems, Inc. Modified: head/share/man/man4/snd_hda.4 head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdaa.h Modified: head/share/man/man4/snd_hda.4 ============================================================================== --- head/share/man/man4/snd_hda.4 Wed Jan 25 20:15:58 2012 (r230550) +++ head/share/man/man4/snd_hda.4 Wed Jan 25 20:46:10 2012 (r230551) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 11, 2012 +.Dd January 25, 2012 .Dt SND_HDA 4 .Os .Sh NAME @@ -182,6 +182,18 @@ May be specified as a 32-bit hexadecimal or as a set of space-separated .Dq Ar option Ns = Ns Ar value pairs. +.It Va hint.pcm.%d.rec.autosrc +Controls automatic recording source feature: +.Bl -tag -compact +.It 0 +disabled, +.It 1 +once on attach, +.It 2 +enabled. +.El +When enabled, driver will automatically set recording source of the mixer to +connected input using jack presence detection statuses. .El .Pp Pin configuration is the UAA driver's main source of information about codec @@ -357,6 +369,16 @@ Original pin configuration written by BI Setting this to a non-zero value makes driver to destroy existing pcm devices and process new pins configuration set via .Va dev.hdaa.%d.nid%d_config. +.It Va dev.pcm.%d.play.32bit , dev.pcm.%d.rec.32bit +HDA controller uses 32bit representation for all samples of more then 16 bits. +These variables allow to specify how many bits of these 32 should be +used by CODEC. +Depending on codec capabilities, possible values are 20, 24 and 32 bit. +The default value is 24. +.It Va dev.pcm.%d.rec.autosrc +Run-time equivalent of the +.Va hint.pcm.%d.rec.autosrc +tunable. .El .Sh EXAMPLES Taking HP Compaq DX2300 with Realtek ALC888 HDA codec for example. Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Wed Jan 25 20:15:58 2012 (r230550) +++ head/sys/dev/sound/pci/hda/hdaa.c Wed Jan 25 20:46:10 2012 (r230551) @@ -239,44 +239,30 @@ hdaa_audio_ctl_amp_get(struct hdaa_devin } /* - * Jack detection (Speaker/HP redirection) event handler. + * Headphones redirection change handler. */ static void -hdaa_hp_switch_handler(struct hdaa_widget *w) +hdaa_hpredir_handler(struct hdaa_widget *w) { struct hdaa_devinfo *devinfo = w->devinfo; - struct hdaa_audio_as *as; + struct hdaa_audio_as *as = &devinfo->as[w->bindas]; struct hdaa_widget *w1; struct hdaa_audio_ctl *ctl; - uint32_t val, res; - int j; - - if (w->enable == 0 || w->type != - HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) - return; + uint32_t val; + int j, connected = w->wclass.pin.connected; - res = hda_command(devinfo->dev, HDA_CMD_GET_PIN_SENSE(0, w->nid)); - HDA_BOOTVERBOSE( - device_printf(devinfo->dev, - "Pin sense: nid=%d sence=0x%08x", w->nid, res); - ); - res = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; - if (devinfo->quirks & HDAA_QUIRK_SENSEINV) - res ^= 1; HDA_BOOTVERBOSE( - printf(" (%sconnected)\n", res == 0 ? "dis" : ""); + device_printf((as->pdevinfo && as->pdevinfo->dev) ? + as->pdevinfo->dev : devinfo->dev, + "Redirect output to: %s\n", + connected ? "headphones": "main"); ); - - as = &devinfo->as[w->bindas]; - if (as->hpredir < 0 || as->pins[15] != w->nid) - return; - /* (Un)Mute headphone pin. */ ctl = hdaa_audio_ctl_amp_get(devinfo, w->nid, HDAA_CTL_IN, -1, 1); if (ctl != NULL && ctl->mute) { /* If pin has muter - use it. */ - val = (res != 0) ? 0 : 1; + val = connected ? 0 : 1; if (val != ctl->forcemute) { ctl->forcemute = val; hdaa_audio_ctl_amp_set(ctl, @@ -285,7 +271,7 @@ hdaa_hp_switch_handler(struct hdaa_widge } } else { /* If there is no muter - disable pin output. */ - if (res != 0) + if (connected) val = w->wclass.pin.ctrl | HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; else @@ -306,7 +292,7 @@ hdaa_hp_switch_handler(struct hdaa_widge as->pins[j], HDAA_CTL_IN, -1, 1); if (ctl != NULL && ctl->mute) { /* If pin has muter - use it. */ - val = (res != 0) ? 1 : 0; + val = connected ? 1 : 0; if (val == ctl->forcemute) continue; ctl->forcemute = val; @@ -317,9 +303,8 @@ hdaa_hp_switch_handler(struct hdaa_widge } /* If there is no muter - disable pin output. */ w1 = hdaa_widget_get(devinfo, as->pins[j]); - if (w1 != NULL && w1->type == - HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) { - if (res != 0) + if (w1 != NULL) { + if (connected) val = w1->wclass.pin.ctrl & ~HDA_CMD_SET_PIN_WIDGET_CTRL_OUT_ENABLE; else @@ -336,110 +321,142 @@ hdaa_hp_switch_handler(struct hdaa_widge } /* - * Callback for poll based jack detection. + * Recording source change handler. */ static void -hdaa_jack_poll_callback(void *arg) +hdaa_autorecsrc_handler(struct hdaa_audio_as *as, struct hdaa_widget *w) { - struct hdaa_devinfo *devinfo = arg; - struct hdaa_widget *w; - int i; + struct hdaa_pcm_devinfo *pdevinfo = as->pdevinfo; + struct hdaa_devinfo *devinfo; + struct hdaa_widget *w1; + int i, mask, fullmask, prio, bestprio; + char buf[128]; - hdaa_lock(devinfo); - if (devinfo->poll_ival == 0) { - hdaa_unlock(devinfo); + if (!as->mixed || pdevinfo == NULL || pdevinfo->mixer == NULL) return; - } - for (i = 0; i < devinfo->ascnt; i++) { - if (devinfo->as[i].hpredir < 0) + /* Don't touch anything if we asked not to. */ + if (pdevinfo->autorecsrc == 0 || + (pdevinfo->autorecsrc == 1 && w != NULL)) + return; + /* Don't touch anything if "mix" or "speaker" selected. */ + if (pdevinfo->recsrc & (SOUND_MASK_IMIX | SOUND_MASK_SPEAKER)) + return; + /* Don't touch anything if several selected. */ + if (ffs(pdevinfo->recsrc) != fls(pdevinfo->recsrc)) + return; + devinfo = pdevinfo->devinfo; + mask = fullmask = 0; + bestprio = 0; + for (i = 0; i < 16; i++) { + if (as->pins[i] <= 0) continue; - w = hdaa_widget_get(devinfo, devinfo->as[i].pins[15]); - if (w == NULL || w->enable == 0 || w->type != - HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + w1 = hdaa_widget_get(devinfo, as->pins[i]); + if (w1 == NULL || w1->enable == 0) + continue; + if (w1->wclass.pin.connected == 0) continue; - hdaa_hp_switch_handler(w); + prio = (w1->wclass.pin.connected == 1) ? 2 : 1; + if (prio < bestprio) + continue; + if (prio > bestprio) { + mask = 0; + bestprio = prio; + } + mask |= (1 << w1->ossdev); + fullmask |= (1 << w1->ossdev); } - callout_reset(&devinfo->poll_jack, devinfo->poll_ival, - hdaa_jack_poll_callback, devinfo); + if (mask == 0) + return; + /* Prefer newly connected input. */ + if (w != NULL && (mask & (1 << w->ossdev))) + mask = (1 << w->ossdev); + /* Prefer previously selected input */ + if (mask & pdevinfo->recsrc) + mask &= pdevinfo->recsrc; + /* Prefer mic. */ + if (mask & SOUND_MASK_MIC) + mask = SOUND_MASK_MIC; + /* Prefer monitor (2nd mic). */ + if (mask & SOUND_MASK_MONITOR) + mask = SOUND_MASK_MONITOR; + /* Just take first one. */ + mask = (1 << (ffs(mask) - 1)); + HDA_BOOTVERBOSE( + hdaa_audio_ctl_ossmixer_mask2allname(mask, buf, sizeof(buf)); + device_printf(pdevinfo->dev, + "Automatically set rec source to: %s\n", buf); + ); hdaa_unlock(devinfo); + mix_setrecsrc(pdevinfo->mixer, mask); + hdaa_lock(devinfo); } /* - * Jack detection initializer. + * Jack presence detection event handler. */ static void -hdaa_hp_switch_init(struct hdaa_devinfo *devinfo) +hdaa_presence_handler(struct hdaa_widget *w) { - struct hdaa_audio_as *as = devinfo->as; - struct hdaa_widget *w; - int i, poll = 0; + struct hdaa_devinfo *devinfo = w->devinfo; + struct hdaa_audio_as *as; + uint32_t res; + int connected; - for (i = 0; i < devinfo->ascnt; i++) { - if (as[i].hpredir < 0) - continue; + if (w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + return; - w = hdaa_widget_get(devinfo, as[i].pins[15]); - if (w == NULL || w->enable == 0 || w->type != - HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) - continue; - if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || - (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) { - device_printf(devinfo->dev, - "No jack detection support at pin %d\n", - as[i].pins[15]); - continue; - } - if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap) && - w->unsol < 0) { - w->unsol = HDAC_UNSOL_ALLOC( - device_get_parent(devinfo->dev), devinfo->dev, - w->nid); - hda_command(devinfo->dev, - HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, - HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | - w->unsol)); - } - if (w->unsol < 0) - poll = 1; - HDA_BOOTVERBOSE( - device_printf(devinfo->dev, - "Headphones redirection " - "for as=%d nid=%d using %s.\n", - i, w->nid, - (poll != 0) ? "polling" : "unsolicited responses"); - ); - hdaa_hp_switch_handler(w); - } - if (poll) { - callout_reset(&devinfo->poll_jack, 1, - hdaa_jack_poll_callback, devinfo); - } + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) + return; + + res = hda_command(devinfo->dev, HDA_CMD_GET_PIN_SENSE(0, w->nid)); + connected = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; + if (devinfo->quirks & HDAA_QUIRK_SENSEINV) + connected = !connected; + if (connected == w->wclass.pin.connected) + return; + w->wclass.pin.connected = connected; + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Pin sense: nid=%d sence=0x%08x (%sconnected)\n", + w->nid, res, !w->wclass.pin.connected ? "dis" : ""); + ); + + as = &devinfo->as[w->bindas]; + if (as->hpredir >= 0 && as->pins[15] == w->nid) + hdaa_hpredir_handler(w); + if (as->dir == HDAA_CTL_IN) + hdaa_autorecsrc_handler(as, w); } +/* + * Callback for poll based presence detection. + */ static void -hdaa_hp_switch_deinit(struct hdaa_devinfo *devinfo) +hdaa_jack_poll_callback(void *arg) { - struct hdaa_audio_as *as = devinfo->as; - struct hdaa_widget *w; - int i; + struct hdaa_devinfo *devinfo = arg; + struct hdaa_widget *w; + int i; + hdaa_lock(devinfo); + if (devinfo->poll_ival == 0) { + hdaa_unlock(devinfo); + return; + } for (i = 0; i < devinfo->ascnt; i++) { - w = hdaa_widget_get(devinfo, as[i].pins[15]); + if (devinfo->as[i].hpredir < 0) + continue; + w = hdaa_widget_get(devinfo, devinfo->as[i].pins[15]); if (w == NULL || w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) continue; - if (HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap) || - HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) - continue; - if (w->unsol < 0) - continue; - hda_command(devinfo->dev, - HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, 0)); - HDAC_UNSOL_FREE( - device_get_parent(devinfo->dev), devinfo->dev, - w->unsol); - w->unsol = -1; + hdaa_presence_handler(w); } + callout_reset(&devinfo->poll_jack, devinfo->poll_ival, + hdaa_jack_poll_callback, devinfo); + hdaa_unlock(devinfo); } static void @@ -534,13 +551,18 @@ hdaa_eld_handler(struct hdaa_widget *w) HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) return; + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) + return; + + res = hda_command(devinfo->dev, HDA_CMD_GET_PIN_SENSE(0, w->nid)); + if ((w->eld != 0) == ((res & HDA_CMD_GET_PIN_SENSE_ELD_VALID) != 0)) + return; if (w->eld != NULL) { w->eld_len = 0; free(w->eld, M_HDAA); w->eld = NULL; } - - res = hda_command(devinfo->dev, HDA_CMD_GET_PIN_SENSE(0, w->nid)); HDA_BOOTVERBOSE( device_printf(devinfo->dev, "Pin sense: nid=%d sence=0x%08x " @@ -575,49 +597,73 @@ hdaa_eld_handler(struct hdaa_widget *w) ); } - +/* + * Pin sense initializer. + */ static void -hdaa_eld_init(struct hdaa_devinfo *devinfo) +hdaa_sense_init(struct hdaa_devinfo *devinfo) { - struct hdaa_widget *w; - int i; + struct hdaa_audio_as *as; + struct hdaa_widget *w; + int i, poll = 0; for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdaa_widget_get(devinfo, i); - if (w == NULL || w->type != + if (w == NULL || w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) continue; - if (!HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap) && - !HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) - continue; if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap) && w->unsol < 0) { w->unsol = HDAC_UNSOL_ALLOC( - device_get_parent(devinfo->dev), devinfo->dev, - w->nid); + device_get_parent(devinfo->dev), devinfo->dev, w->nid); hda_command(devinfo->dev, HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid, - HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | - w->unsol)); + HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | w->unsol)); } + as = &devinfo->as[w->bindas]; + if (as->hpredir >= 0 && as->pins[15] == w->nid) { + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) { + device_printf(devinfo->dev, + "No presence detection support at nid %d\n", + as[i].pins[15]); + } else { + if (w->unsol < 0) + poll = 1; + HDA_BOOTVERBOSE( + device_printf(devinfo->dev, + "Headphones redirection for " + "association %d nid=%d using %s.\n", + w->bindas, w->nid, + (poll != 0) ? "polling" : + "unsolicited responses"); + ); + }; + } + hdaa_presence_handler(w); + if (!HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap) && + !HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) + continue; hdaa_eld_handler(w); } + if (poll) { + callout_reset(&devinfo->poll_jack, 1, + hdaa_jack_poll_callback, devinfo); + } } static void -hdaa_eld_deinit(struct hdaa_devinfo *devinfo) +hdaa_sense_deinit(struct hdaa_devinfo *devinfo) { struct hdaa_widget *w; int i; + callout_stop(&devinfo->poll_jack); for (i = devinfo->startnode; i < devinfo->endnode; i++) { w = hdaa_widget_get(devinfo, i); - if (w == NULL || w->type != + if (w == NULL || w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) continue; - if (!HDA_PARAM_PIN_CAP_DP(w->wclass.pin.cap) && - !HDA_PARAM_PIN_CAP_HDMI(w->wclass.pin.cap)) - continue; if (w->unsol < 0) continue; hda_command(devinfo->dev, @@ -1191,6 +1237,10 @@ hdaa_widget_postprocess(struct hdaa_widg } strlcat(w->name, HDA_CONNS[conn], sizeof(w->name)); strlcat(w->name, ")", sizeof(w->name)); + + if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || + (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) + w->wclass.pin.connected = 2; } } @@ -5778,13 +5828,9 @@ hdaa_configure(device_t dev) ); hdaa_patch_direct(devinfo); HDA_BOOTHVERBOSE( - device_printf(dev, "ELD init...\n"); + device_printf(dev, "Pin sense init...\n"); ); - hdaa_eld_init(devinfo); - HDA_BOOTHVERBOSE( - device_printf(dev, "HP switch init...\n"); - ); - hdaa_hp_switch_init(devinfo); + hdaa_sense_init(devinfo); HDA_BOOTHVERBOSE( device_printf(dev, "Creating PCM devices...\n"); ); @@ -5849,13 +5895,9 @@ hdaa_unconfigure(device_t dev) int i, j; HDA_BOOTHVERBOSE( - device_printf(dev, "HP switch deinit...\n"); + device_printf(dev, "Pin sense deinit...\n"); ); - hdaa_hp_switch_deinit(devinfo); - HDA_BOOTHVERBOSE( - device_printf(dev, "ELD deinit...\n"); - ); - hdaa_eld_deinit(devinfo); + hdaa_sense_deinit(devinfo); free(devinfo->ctl, M_HDAA); devinfo->ctl = NULL; devinfo->ctlcnt = 0; @@ -6085,10 +6127,6 @@ hdaa_suspend(device_t dev) } } HDA_BOOTHVERBOSE( - device_printf(dev, "HP switch deinit...\n"); - ); - hdaa_hp_switch_deinit(devinfo); - HDA_BOOTHVERBOSE( device_printf(dev, "Power down FG" " nid=%d to the D3 state...\n", devinfo->nid); @@ -6129,9 +6167,9 @@ hdaa_resume(device_t dev) ); hdaa_patch_direct(devinfo); HDA_BOOTHVERBOSE( - device_printf(dev, "HP switch init...\n"); + device_printf(dev, "Pin sense init...\n"); ); - hdaa_hp_switch_init(devinfo); + hdaa_sense_init(devinfo); hdaa_unlock(devinfo); for (i = 0; i < devinfo->num_devs; i++) { @@ -6404,7 +6442,7 @@ hdaa_unsol_intr(device_t dev, uint32_t r else flags = 0x01; if (flags & 0x01) - hdaa_hp_switch_handler(w); + hdaa_presence_handler(w); if (flags & 0x02) hdaa_eld_handler(w); } @@ -6614,8 +6652,6 @@ hdaa_pcm_attach(device_t dev) ); if (mixer_init(dev, &hdaa_audio_ctl_ossmixer_class, pdevinfo) != 0) device_printf(dev, "Can't register mixer\n"); - else - hdaa_audio_ctl_set_defaults(pdevinfo); HDA_BOOTHVERBOSE( device_printf(dev, "Registering PCM channels...\n"); @@ -6648,6 +6684,24 @@ hdaa_pcm_attach(device_t dev) "32bit", CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, as, sizeof(as), hdaa_sysctl_32bit, "I", "Resolution of 32bit samples (20/24/32bit)"); + pdevinfo->autorecsrc = 2; + resource_int_value(device_get_name(dev), + device_get_unit(dev), "autosrc", &pdevinfo->autorecsrc); + SYSCTL_ADD_INT(&d->rec_sysctl_ctx, + SYSCTL_CHILDREN(d->rec_sysctl_tree), OID_AUTO, + "autosrc", CTLTYPE_INT | CTLFLAG_RW, + &pdevinfo->autorecsrc, 0, + "Automatic recording source selection"); + } + + if (pdevinfo->mixer != NULL) { + hdaa_audio_ctl_set_defaults(pdevinfo); + if (pdevinfo->recas >= 0) { + as = &devinfo->as[pdevinfo->recas]; + hdaa_lock(devinfo); + hdaa_autorecsrc_handler(as, NULL); + hdaa_unlock(devinfo); + } } snprintf(status, SND_STATUSLEN, "on %s %s", Modified: head/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.h Wed Jan 25 20:15:58 2012 (r230550) +++ head/sys/dev/sound/pci/hda/hdaa.h Wed Jan 25 20:46:10 2012 (r230551) @@ -125,6 +125,7 @@ struct hdaa_widget { uint32_t newconf; uint32_t cap; uint32_t ctrl; + int connected; } pin; struct { uint8_t stripecap; @@ -180,6 +181,7 @@ struct hdaa_pcm_devinfo { u_char digital; uint32_t ossmask; /* Mask of supported OSS devices. */ uint32_t recsrc; /* Mask of supported OSS sources. */ + int autorecsrc; }; struct hdaa_devinfo { From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 20:48:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3840106566C; Wed, 25 Jan 2012 20:48:20 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 918828FC16; Wed, 25 Jan 2012 20:48:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PKmKsu044864; Wed, 25 Jan 2012 20:48:20 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PKmKk1044860; Wed, 25 Jan 2012 20:48:20 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201252048.q0PKmKk1044860@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 25 Jan 2012 20:48:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230552 - in head/sys: fs/nfsclient kern nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 20:48:20 -0000 Author: kib Date: Wed Jan 25 20:48:20 2012 New Revision: 230552 URL: http://svn.freebsd.org/changeset/base/230552 Log: Fix remaining calls to cache_enter() in both NFS clients to provide appropriate timestamps. Restore the assertions which verify that NCF_TS is set when timestamp is asked for. Reviewed by: jhb (previous version) MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clvnops.c head/sys/kern/vfs_cache.c head/sys/nfsclient/nfs_vnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Wed Jan 25 20:46:10 2012 (r230551) +++ head/sys/fs/nfsclient/nfs_clvnops.c Wed Jan 25 20:48:20 2012 (r230552) @@ -1433,8 +1433,6 @@ nfs_mknodrpc(struct vnode *dvp, struct v } } if (!error) { - if ((cnp->cn_flags & MAKEENTRY)) - cache_enter(dvp, newvp, cnp); *vpp = newvp; } else if (NFS_ISV4(dvp)) { error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, @@ -1592,8 +1590,8 @@ again: } } if (!error) { - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, newvp, cnp); + if ((cnp->cn_flags & MAKEENTRY) && attrflag) + cache_enter_time(dvp, newvp, cnp, &nfsva.na_ctime); *ap->a_vpp = newvp; } else if (NFS_ISV4(dvp)) { error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, @@ -1968,8 +1966,9 @@ nfs_link(struct vop_link_args *ap) * must care about lookup caching hit rate, so... */ if (VFSTONFS(vp->v_mount)->nm_negnametimeo != 0 && - (cnp->cn_flags & MAKEENTRY)) - cache_enter(tdvp, vp, cnp); + (cnp->cn_flags & MAKEENTRY) && dattrflag) { + cache_enter_time(tdvp, vp, cnp, &dnfsva.na_mtime); + } if (error && NFS_ISV4(vp)) error = nfscl_maperr(cnp->cn_thread, error, (uid_t)0, (gid_t)0); @@ -2025,15 +2024,6 @@ nfs_symlink(struct vop_symlink_args *ap) error = nfscl_maperr(cnp->cn_thread, error, vap->va_uid, vap->va_gid); } else { - /* - * If negative lookup caching is enabled, I might as well - * add an entry for this node. Not necessary for correctness, - * but if negative caching is enabled, then the system - * must care about lookup caching hit rate, so... - */ - if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && - (cnp->cn_flags & MAKEENTRY)) - cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; } @@ -2043,6 +2033,16 @@ nfs_symlink(struct vop_symlink_args *ap) if (dattrflag != 0) { mtx_unlock(&dnp->n_mtx); (void) nfscl_loadattrcache(&dvp, &dnfsva, NULL, NULL, 0, 1); + /* + * If negative lookup caching is enabled, I might as well + * add an entry for this node. Not necessary for correctness, + * but if negative caching is enabled, then the system + * must care about lookup caching hit rate, so... + */ + if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && + (cnp->cn_flags & MAKEENTRY)) { + cache_enter_time(dvp, newvp, cnp, &dnfsva.na_mtime); + } } else { dnp->n_attrstamp = 0; mtx_unlock(&dnp->n_mtx); @@ -2118,8 +2118,9 @@ nfs_mkdir(struct vop_mkdir_args *ap) * must care about lookup caching hit rate, so... */ if (VFSTONFS(dvp->v_mount)->nm_negnametimeo != 0 && - (cnp->cn_flags & MAKEENTRY)) - cache_enter(dvp, newvp, cnp); + (cnp->cn_flags & MAKEENTRY) && dattrflag) { + cache_enter_time(dvp, newvp, cnp, &dnfsva.na_mtime); + } *ap->a_vpp = newvp; } return (error); Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Jan 25 20:46:10 2012 (r230551) +++ head/sys/kern/vfs_cache.c Wed Jan 25 20:48:20 2012 (r230552) @@ -237,13 +237,9 @@ static void cache_out_ts(struct namecache *ncp, struct timespec *tsp, int *ticksp) { - if ((ncp->nc_flag & NCF_TS) == 0) { - if (tsp != NULL) - bzero(tsp, sizeof(*tsp)); - if (ticksp != NULL) - *ticksp = 0; - return; - } + KASSERT((ncp->nc_flag & NCF_TS) != 0 || + (tsp == NULL && ticksp == NULL), + ("No NCF_TS")); if (tsp != NULL) *tsp = ((struct namecache_ts *)ncp)->nc_time; @@ -791,8 +787,8 @@ cache_enter_time(dvp, vp, cnp, tsp) n2->nc_nlen == cnp->cn_namelen && !bcmp(nc_get_name(n2), cnp->cn_nameptr, n2->nc_nlen)) { if (tsp != NULL) { - if ((n2->nc_flag & NCF_TS) == 0) - continue; + KASSERT((n2->nc_flag & NCF_TS) != 0, + ("no NCF_TS")); n3 = (struct namecache_ts *)n2; n3->nc_time = ((struct namecache_ts *)ncp)->nc_time; Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Wed Jan 25 20:46:10 2012 (r230551) +++ head/sys/nfsclient/nfs_vnops.c Wed Jan 25 20:48:20 2012 (r230552) @@ -1532,8 +1532,6 @@ nfsmout: if (newvp) vput(newvp); } else { - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, newvp, cnp); *vpp = newvp; } mtx_lock(&(VTONFS(dvp))->n_mtx); @@ -1672,8 +1670,6 @@ nfsmout: vput(newvp); } if (!error) { - if (cnp->cn_flags & MAKEENTRY) - cache_enter(dvp, newvp, cnp); *ap->a_vpp = newvp; } mtx_lock(&(VTONFS(dvp))->n_mtx); From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 20:54:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E05D5106566B; Wed, 25 Jan 2012 20:54:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF7308FC08; Wed, 25 Jan 2012 20:54:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PKs93h045077; Wed, 25 Jan 2012 20:54:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PKs9iF045075; Wed, 25 Jan 2012 20:54:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201201252054.q0PKs9iF045075@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 25 Jan 2012 20:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230553 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 20:54:10 -0000 Author: kib Date: Wed Jan 25 20:54:09 2012 New Revision: 230553 URL: http://svn.freebsd.org/changeset/base/230553 Log: When doing vflush(WRITECLOSE), clean vnode pages. Unmounts do vfs_msync() before calling VFS_UNMOUNT(), but there is still a race allowing a process to dirty pages after msync finished. Remounts rw->ro just left dirty pages in system. Reviewed by: alc, tegge (long time ago) Tested by: pho MFC after: 2 weeks Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Wed Jan 25 20:48:20 2012 (r230552) +++ head/sys/kern/vfs_subr.c Wed Jan 25 20:54:09 2012 (r230553) @@ -2496,6 +2496,18 @@ loop: * vnodes open for writing. */ if (flags & WRITECLOSE) { + if (vp->v_object != NULL) { + VM_OBJECT_LOCK(vp->v_object); + vm_object_page_clean(vp->v_object, 0, 0, 0); + VM_OBJECT_UNLOCK(vp->v_object); + } + error = VOP_FSYNC(vp, MNT_WAIT, td); + if (error != 0) { + VOP_UNLOCK(vp, 0); + vdrop(vp); + MNT_VNODE_FOREACH_ABORT(mp, mvp); + return (error); + } error = VOP_GETATTR(vp, &vattr, td->td_ucred); VI_LOCK(vp); From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 20:54:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB8FE106564A; Wed, 25 Jan 2012 20:54:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA7AE8FC13; Wed, 25 Jan 2012 20:54:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PKsGoM045116; Wed, 25 Jan 2012 20:54:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PKsG04045114; Wed, 25 Jan 2012 20:54:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201252054.q0PKsG04045114@svn.freebsd.org> From: Alexander Motin Date: Wed, 25 Jan 2012 20:54:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230554 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 20:54:16 -0000 Author: mav Date: Wed Jan 25 20:54:16 2012 New Revision: 230554 URL: http://svn.freebsd.org/changeset/base/230554 Log: Oops, fix the loader tunable name added in r230551. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Wed Jan 25 20:54:09 2012 (r230553) +++ head/sys/dev/sound/pci/hda/hdaa.c Wed Jan 25 20:54:16 2012 (r230554) @@ -6685,8 +6685,8 @@ hdaa_pcm_attach(device_t dev) as, sizeof(as), hdaa_sysctl_32bit, "I", "Resolution of 32bit samples (20/24/32bit)"); pdevinfo->autorecsrc = 2; - resource_int_value(device_get_name(dev), - device_get_unit(dev), "autosrc", &pdevinfo->autorecsrc); + resource_int_value(device_get_name(dev), device_get_unit(dev), + "rec.autosrc", &pdevinfo->autorecsrc); SYSCTL_ADD_INT(&d->rec_sysctl_ctx, SYSCTL_CHILDREN(d->rec_sysctl_tree), OID_AUTO, "autosrc", CTLTYPE_INT | CTLFLAG_RW, From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 21:49:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74B66106564A; Wed, 25 Jan 2012 21:49:49 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 638028FC20; Wed, 25 Jan 2012 21:49:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PLnnjY046847; Wed, 25 Jan 2012 21:49:49 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PLnnue046845; Wed, 25 Jan 2012 21:49:49 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201201252149.q0PLnnue046845@svn.freebsd.org> From: Michael Tuexen Date: Wed, 25 Jan 2012 21:49:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230555 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 21:49:49 -0000 Author: tuexen Date: Wed Jan 25 21:49:48 2012 New Revision: 230555 URL: http://svn.freebsd.org/changeset/base/230555 Log: Don't print a warning when using netstat to print SCTP statistics when there is not SCTP in the kernel. This problem was reported by Sean Mahood. MFC after: 1 week. Modified: head/usr.bin/netstat/sctp.c Modified: head/usr.bin/netstat/sctp.c ============================================================================== --- head/usr.bin/netstat/sctp.c Wed Jan 25 20:54:16 2012 (r230554) +++ head/usr.bin/netstat/sctp.c Wed Jan 25 21:49:48 2012 (r230555) @@ -611,7 +611,8 @@ sctp_stats(u_long off, const char *name, memset(&zerostat, 0, len); if (sysctlbyname("net.inet.sctp.stats", &sctpstat, &len, zflag ? &zerostat : NULL, zflag ? len : 0) < 0) { - warn("sysctl: net.inet.sctp.stats"); + if (errno != ENOENT) + warn("sysctl: net.inet.sctp.stats"); return; } } else From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 21:59:53 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABB9C106566C; Wed, 25 Jan 2012 21:59:53 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 380F38FC28; Wed, 25 Jan 2012 21:59:51 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA14884; Wed, 25 Jan 2012 23:59:50 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RqAsg-0006va-9U; Wed, 25 Jan 2012 23:59:50 +0200 Message-ID: <4F207B55.4020500@FreeBSD.org> Date: Wed, 25 Jan 2012 23:59:49 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Florian Smeets References: <201112112102.pBBL21kB068967@svn.freebsd.org> <4F1DE4FF.3080606@FreeBSD.org> In-Reply-To: <4F1DE4FF.3080606@FreeBSD.org> X-Enigmail-Version: undefined Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r228424 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 21:59:53 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 on 24/01/2012 00:53 Florian Smeets said the following: > On 11.12.11 22:02, Andriy Gapon wrote: >> Author: avg Date: Sun Dec 11 21:02:01 2011 New Revision: 228424 URL: >> http://svn.freebsd.org/changeset/base/228424 >> >> Log: panic: add a switch and infrastructure for stopping other CPUs in >> SMP case >> > > Hi, > > Attilio asked me to verify that this commit does not introduce a > performance regression. First of all, thank you very much for doing this! > The box used to run these tests was a 40 Core 32GB Xeon box (HTT was turned > off, so 40 real hardware cores). As benchmark pgbench/PostgreSQL were used, > a snapshot of PostgreSQL 9.2 from 16.01.2012 was used as they did a lot of > scaling work in 9.2 which improved the numbers quite a lot vs. 9.1. The > initial benchmarks were run with a scaling factor of 100 which creates a > database work set of ~1.5GB. Max throughput was achieved at 20 Clients. > > x 228423-20 + 228424-20 > +----------------------------------------------------------------------+ | > x + | |x x x > +* + + xxx * ++ + + x| | > |___________________A______M_____________| | | > |___________A____M_____| | > +----------------------------------------------------------------------+ N > Min Max Median Avg Stddev x 10 > 111073.26 115016.79 113113.49 112745.69 1169.2132 + 10 > 112583.56 114454.33 113668.08 113343.31 661.31761 No > difference proven at 95.0% confidence > > At 40 threads the results varied between 43000 - 76500 across reboots. > Attilio suspects that this can be caused by the kernel memory layout > changing under the woods creating cache effects difficult to control, > therefor the scaling factor was reduced to 10 (~150MB work set) and the > numbers got deterministic across reboot. > > x 228423-40-sf10 + 228424-40-sf10 * 228424-40-sf10-cl > +----------------------------------------------------------------------+ |x > x x *** * * + x **+ *+ * * ** + + +| | > |__________A__________| | | > |______________MA________________| | | > |__________A__M_______| | > +----------------------------------------------------------------------+ N > Min Max Median Avg Stddev x 10 > 192489.43 196045.39 194138.34 194149.19 986.61561 + 10 > 194093.35 198864.83 196129.36 196214.69 1545.8783 > Difference at 95.0% confidence 2065.5 +/- 1218.43 1.06387% +/- 0.627572% > (Student's t, pooled s = 1296.76) * 10 194288.28 197083.85 > 195955.26 195733.15 1012.3529 Difference at 95.0% confidence > 1583.96 +/- 939.189 0.815847% +/- 0.483746% (Student's t, pooled s = > 999.567) Is it possible to see ministat's report for the difference between 228424-40-sf10 and 228424-40-sf10-cl datasets? > The 228424-40-sf10-cl results are with a patch from Attilio [1] which he > will followup on. I like the patch already, regardless of how much performance difference it produces :-) > If anybody wants to look at the raw numbers they are available at [2]. > > There are results for pbzip2 runs here [3] also, the numbers are "real" > time from /usr/bin/time. > > Cheers, Florian > > [1] http://people.freebsd.org/~attilio/cachelineunshare.patch [2] > http://tb.smeets.im/~flo/stop-sched/pgsql/ [3] > http://tb.smeets.im/~flo/stop-sched/pbzip2/ > - -- Andriy Gapon -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJPIHtVAAoJEHSlLSemUf4vSTQIALerbsXk+V283mw9lk7T4Jbk QOYhyexcLz+GDs9X3B35LmP46romYTT21S2DgVDtK76pq2a1SBGhkhExWi9sfZdv RuTWOiInEd8d06I7T+SdCosDr6UGMNUMb+8h/pBOzyGEUt0WOugbqmJNPUu9uFEb KGrSnjr6xDIIY/bty01H4unnqfZX5t6RTMuxzrbxxSmf8SIjChQhDgFZpSq0ue4n QJjTg1DK0W6mHHTIzpfydya+I4uEQCkxQiElFNsJla7W3ZyAPgXlMVpYdmcxD+xr 2NUMOjXvQ2sWkVKaKDVqmlYxs5mtyBvjOR23cPuoP6rYNrtgtXLMiG/KAtaDuhs= =cI8w -----END PGP SIGNATURE----- From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 22:14:56 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BCC51065676; Wed, 25 Jan 2012 22:14:56 +0000 (UTC) (envelope-from flo@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 2E27E8FC16; Wed, 25 Jan 2012 22:14:56 +0000 (UTC) Received: from nibbler-wlan.fritz.box (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0PMEsJM078151; Wed, 25 Jan 2012 22:14:55 GMT (envelope-from flo@FreeBSD.org) Message-ID: <4F207EDD.1000407@FreeBSD.org> Date: Wed, 25 Jan 2012 23:14:53 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0) Gecko/20120118 Thunderbird/10.0 MIME-Version: 1.0 To: Andriy Gapon References: <201112112102.pBBL21kB068967@svn.freebsd.org> <4F1DE4FF.3080606@FreeBSD.org> <4F207B55.4020500@FreeBSD.org> In-Reply-To: <4F207B55.4020500@FreeBSD.org> X-Enigmail-Version: 1.4a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigF63A6A7E0C371786D9BE842D" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r228424 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 22:14:56 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF63A6A7E0C371786D9BE842D Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 25.01.12 22:59, Andriy Gapon wrote: > on 24/01/2012 00:53 Florian Smeets said the following: >> On 11.12.11 22:02, Andriy Gapon wrote: >>> Author: avg Date: Sun Dec 11 21:02:01 2011 New Revision: 228424 URL: >>> http://svn.freebsd.org/changeset/base/228424 >>> >>> Log: panic: add a switch and infrastructure for stopping other CPUs i= n >>> SMP case >>> >=20 >> Hi, >=20 >> Attilio asked me to verify that this commit does not introduce a=20 >> performance regression. >=20 > First of all, thank you very much for doing this! >=20 >> The box used to run these tests was a 40 Core 32GB Xeon box (HTT was t= urned >> off, so 40 real hardware cores). As benchmark pgbench/PostgreSQL were = used, >> a snapshot of PostgreSQL 9.2 from 16.01.2012 was used as they did a lo= t of >> scaling work in 9.2 which improved the numbers quite a lot vs. 9.1. Th= e >> initial benchmarks were run with a scaling factor of 100 which creates= a >> database work set of ~1.5GB. Max throughput was achieved at 20 Clients= =2E >=20 [mangled ministat removed] >=20 >> At 40 threads the results varied between 43000 - 76500 across reboots.= =20 >> Attilio suspects that this can be caused by the kernel memory layout=20 >> changing under the woods creating cache effects difficult to control, = >> therefor the scaling factor was reduced to 10 (~150MB work set) and th= e=20 >> numbers got deterministic across reboot. >=20 [mangled ministat removed] >=20 >=20 > Is it possible to see ministat's report for the difference between > 228424-40-sf10 and 228424-40-sf10-cl datasets? >=20 Sure, here we go. x 228424-40-sf10 + 228424-40-sf10-cl +----------------------------------------------------------------------+ |x + + + x ++x + x + + ++ x x x| | |____________________M_A_____________________| | | |______________A__M__________| | +----------------------------------------------------------------------+ N Min Max Median Avg Stdd= ev x 10 194093.35 198864.83 196129.36 196214.69 1545.87= 83 + 10 194288.28 197083.85 195955.26 195733.15 1012.35= 29 No difference proven at 95.0% confidence >> The 228424-40-sf10-cl results are with a patch from Attilio [1] which = he=20 >> will followup on. >=20 > I like the patch already, regardless of how much performance difference= it > produces :-) >=20 Florian [1] http://people.freebsd.org/~attilio/cachelineunshare.patch --------------enigF63A6A7E0C371786D9BE842D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAk8gft4ACgkQapo8P8lCvwnSvACghSPbOTJMy4j/4pCGtP/+ZXn8 oOkAn3GQd9LA3SznCIMd1IE57PuQvwtv =hrC0 -----END PGP SIGNATURE----- --------------enigF63A6A7E0C371786D9BE842D-- From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 23:33:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06BD91065670; Wed, 25 Jan 2012 23:33:51 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E886A8FC0A; Wed, 25 Jan 2012 23:33:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0PNXohV050310; Wed, 25 Jan 2012 23:33:50 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0PNXoWK050308; Wed, 25 Jan 2012 23:33:50 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201201252333.q0PNXoWK050308@svn.freebsd.org> From: Sean Bruno Date: Wed, 25 Jan 2012 23:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230558 - head/sys/dev/firewire X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 23:33:51 -0000 Author: sbruno Date: Wed Jan 25 23:33:50 2012 New Revision: 230558 URL: http://svn.freebsd.org/changeset/base/230558 Log: Update sbp_targ such that it can actually handle multiple CTIO's during operation PR: kern/119575 Modified: head/sys/dev/firewire/sbp_targ.c Modified: head/sys/dev/firewire/sbp_targ.c ============================================================================== --- head/sys/dev/firewire/sbp_targ.c Wed Jan 25 22:39:22 2012 (r230557) +++ head/sys/dev/firewire/sbp_targ.c Wed Jan 25 23:33:50 2012 (r230558) @@ -62,6 +62,7 @@ #include #include #include +#include #define SBP_TARG_RECV_LEN 8 #define MAX_INITIATORS 8 @@ -186,6 +187,21 @@ struct morb4 { #endif }; + +/* + * Urestricted page table format + * states that the segment length + * and high base addr are in the first + * 32 bits and the base low is in + * the second + */ +struct unrestricted_page_table_fmt { + uint16_t segment_len; + uint16_t segment_base_high; + uint32_t segment_base_low; +}; + + struct orb_info { struct sbp_targ_softc *sc; struct fw_device *fwdev; @@ -208,7 +224,10 @@ struct orb_info { struct corb4 orb4; STAILQ_ENTRY(orb_info) link; uint32_t orb[8]; - uint32_t *page_table; + struct unrestricted_page_table_fmt *page_table; + struct unrestricted_page_table_fmt *cur_pte; + struct unrestricted_page_table_fmt *last_pte; + uint32_t last_block_read; struct sbp_status status; }; @@ -219,6 +238,7 @@ static char *orb_fun_name[] = { static void sbp_targ_recv(struct fw_xfer *); static void sbp_targ_fetch_orb(struct sbp_targ_softc *, struct fw_device *, uint16_t, uint32_t, struct sbp_targ_login *, int); +static void sbp_targ_xfer_pt(struct orb_info *); static void sbp_targ_abort(struct sbp_targ_softc *, struct orb_info *); static void @@ -252,13 +272,19 @@ sbp_targ_dealloc_login(struct sbp_targ_l } for (orbi = STAILQ_FIRST(&login->orbs); orbi != NULL; orbi = next) { next = STAILQ_NEXT(orbi, link); + if (debug) + printf("%s: free orbi %p\n", __func__, orbi); free(orbi, M_SBP_TARG); + orbi = NULL; } callout_stop(&login->hold_callout); STAILQ_REMOVE(&login->lstate->logins, login, sbp_targ_login, link); login->lstate->sc->logins[login->id] = NULL; + if (debug) + printf("%s: free login %p\n", __func__, login); free((void *)login, M_SBP_TARG); + login = NULL; } static void @@ -361,20 +387,26 @@ sbp_targ_find_devs(struct sbp_targ_softc if (ccb->ccb_h.target_id == CAM_TARGET_WILDCARD && ccb->ccb_h.target_lun == CAM_LUN_WILDCARD) { *lstate = sc->black_hole; + if (debug) + printf("setting black hole for this target id(%d)\n", ccb->ccb_h.target_id); return (CAM_REQ_CMP); } - if (ccb->ccb_h.target_id != 0) - return (CAM_TID_INVALID); - lun = ccb->ccb_h.target_lun; if (lun >= MAX_LUN) return (CAM_LUN_INVALID); *lstate = sc->lstate[lun]; - if (notfound_failure != 0 && *lstate == NULL) + if (notfound_failure != 0 && *lstate == NULL) { + if (debug) + printf("%s: lstate for lun is invalid, target(%d), lun(%d)\n", + __func__, ccb->ccb_h.target_id, lun); return (CAM_PATH_INVALID); + } else + if (debug) + printf("%s: setting lstate for tgt(%d) lun(%d)\n", + __func__,ccb->ccb_h.target_id, lun); return (CAM_REQ_CMP); } @@ -411,11 +443,18 @@ sbp_targ_en_lun(struct sbp_targ_softc *s printf("Couldn't allocate lstate\n"); ccb->ccb_h.status = CAM_RESRC_UNAVAIL; return; - } - if (ccb->ccb_h.target_id == CAM_TARGET_WILDCARD) + } else { + if (debug) + printf("%s: malloc'd lstate %p\n",__func__, lstate); + } + if (ccb->ccb_h.target_id == CAM_TARGET_WILDCARD) { sc->black_hole = lstate; - else + if (debug) + printf("Blackhole set due to target id == %d\n", + ccb->ccb_h.target_id); + } else sc->lstate[ccb->ccb_h.target_lun] = lstate; + memset(lstate, 0, sizeof(*lstate)); lstate->sc = sc; status = xpt_create_path(&lstate->path, /*periph*/NULL, @@ -424,6 +463,7 @@ sbp_targ_en_lun(struct sbp_targ_softc *s xpt_path_lun_id(ccb->ccb_h.path)); if (status != CAM_REQ_CMP) { free(lstate, M_SBP_TARG); + lstate = NULL; xpt_print_path(ccb->ccb_h.path); printf("Couldn't allocate path\n"); ccb->ccb_h.status = CAM_RESRC_UNAVAIL; @@ -443,6 +483,7 @@ sbp_targ_en_lun(struct sbp_targ_softc *s if (lstate == NULL) { ccb->ccb_h.status = CAM_LUN_INVALID; + printf("Invalid lstate for this target\n"); return; } ccb->ccb_h.status = CAM_REQ_CMP; @@ -458,6 +499,7 @@ sbp_targ_en_lun(struct sbp_targ_softc *s } if (ccb->ccb_h.status != CAM_REQ_CMP) { + printf("status != CAM_REQ_CMP\n"); return; } @@ -475,7 +517,10 @@ sbp_targ_en_lun(struct sbp_targ_softc *s sc->black_hole = NULL; else sc->lstate[ccb->ccb_h.target_lun] = NULL; + if (debug) + printf("%s: free lstate %p\n", __func__, lstate); free(lstate, M_SBP_TARG); + lstate = NULL; /* bus reset */ sc->fd.fc->ibr(sc->fd.fc); @@ -538,7 +583,7 @@ sbp_targ_get_orb_info(struct sbp_targ_ls if (orbi->orb_lo == tag_id) goto found; printf("%s: orb not found tag_id=0x%08x init_id=%d\n", - __func__, tag_id, init_id); + __func__, tag_id, init_id); return (NULL); found: return (orbi); @@ -559,12 +604,13 @@ sbp_targ_abort(struct sbp_targ_softc *sc xpt_done(orbi->ccb); orbi->ccb = NULL; } -#if 0 if (orbi->state <= ORBI_STATUS_ATIO) { sbp_targ_remove_orb_info_locked(orbi->login, orbi); + if (debug) + printf("%s: free orbi %p\n", __func__, orbi); free(orbi, M_SBP_TARG); + orbi = NULL; } else -#endif orbi->state = ORBI_STATUS_ABORTED; } } @@ -576,12 +622,21 @@ sbp_targ_free_orbi(struct fw_xfer *xfer) { struct orb_info *orbi; - orbi = (struct orb_info *)xfer->sc; if (xfer->resp != 0) { /* XXX */ printf("%s: xfer->resp = %d\n", __func__, xfer->resp); } + orbi = (struct orb_info *)xfer->sc; + if ( orbi->page_table != NULL ) { + if (debug) + printf("%s: free orbi->page_table %p\n", __func__, orbi->page_table); + free(orbi->page_table, M_SBP_TARG); + orbi->page_table = NULL; + } + if (debug) + printf("%s: free orbi %p\n", __func__, orbi); free(orbi, M_SBP_TARG); + orbi = NULL; fw_xfer_free(xfer); } @@ -595,7 +650,7 @@ sbp_targ_status_FIFO(struct orb_info *or sbp_targ_remove_orb_info(orbi->login, orbi); xfer = fwmem_write_block(orbi->fwdev, (void *)orbi, - /*spd*/2, fifo_hi, fifo_lo, + /*spd*/FWSPD_S400, fifo_hi, fifo_lo, sizeof(uint32_t) * (orbi->status.len + 1), (char *)&orbi->status, sbp_targ_free_orbi); @@ -605,6 +660,10 @@ sbp_targ_status_FIFO(struct orb_info *or } } +/* + * Generate the appropriate CAM status for the + * target. + */ static void sbp_targ_send_status(struct orb_info *orbi, union ccb *ccb) { @@ -621,6 +680,8 @@ sbp_targ_send_status(struct orb_info *or sbp_status->status = 0; /* XXX */ sbp_status->dead = 0; /* XXX */ + ccb->ccb_h.status= CAM_REQ_CMP; + switch (ccb->csio.scsi_status) { case SCSI_STATUS_OK: if (debug) @@ -628,8 +689,15 @@ sbp_targ_send_status(struct orb_info *or sbp_status->len = 1; break; case SCSI_STATUS_CHECK_COND: + if (debug) + printf("%s: STATUS SCSI_STATUS_CHECK_COND\n", __func__); + goto process_scsi_status; case SCSI_STATUS_BUSY: + if (debug) + printf("%s: STATUS SCSI_STATUS_BUSY\n", __func__); + goto process_scsi_status; case SCSI_STATUS_CMD_TERMINATED: +process_scsi_status: { struct sbp_cmd_status *sbp_cmd_status; struct scsi_sense_data *sense; @@ -640,9 +708,6 @@ sbp_targ_send_status(struct orb_info *or int64_t sinfo; int sense_len; - if (debug) - printf("%s: STATUS %d\n", __func__, - ccb->csio.scsi_status); sbp_cmd_status = (struct sbp_cmd_status *)&sbp_status->data[0]; sbp_cmd_status->status = ccb->csio.scsi_status; sense = &ccb->csio.sense_data; @@ -734,6 +799,7 @@ sbp_targ_send_status(struct orb_info *or if (scsi_get_sks(sense, sense_len, sks) == 0) { bcopy(sks, &sbp_cmd_status->s_keydep[0], sizeof(sks)); sbp_status->len = 5; + ccb->ccb_h.status |= CAM_SENT_SENSE; } break; @@ -743,13 +809,20 @@ sbp_targ_send_status(struct orb_info *or sbp_status->status); } - if (orbi->page_table != NULL) - free(orbi->page_table, M_SBP_TARG); sbp_targ_status_FIFO(orbi, orbi->login->fifo_hi, orbi->login->fifo_lo, /*dequeue*/1); } +/* + * Invoked as a callback handler from fwmem_read/write_block + * + * Process read/write of initiator address space + * completion and pass status onto the backend target. + * If this is a partial read/write for a CCB then + * we decrement the orbi's refcount to indicate + * the status of the read/write is complete + */ static void sbp_targ_cam_done(struct fw_xfer *xfer) { @@ -758,7 +831,7 @@ sbp_targ_cam_done(struct fw_xfer *xfer) orbi = (struct orb_info *)xfer->sc; - if (debug > 1) + if (debug) printf("%s: resp=%d refcount=%d\n", __func__, xfer->resp, orbi->refcount); @@ -779,13 +852,26 @@ sbp_targ_cam_done(struct fw_xfer *xfer) if (debug) printf("%s: orbi aborted\n", __func__); sbp_targ_remove_orb_info(orbi->login, orbi); - if (orbi->page_table != NULL) + if (orbi->page_table != NULL) { + if (debug) + printf("%s: free orbi->page_table %p\n", + __func__, orbi->page_table); free(orbi->page_table, M_SBP_TARG); + } + if (debug) + printf("%s: free orbi %p\n", __func__, orbi); free(orbi, M_SBP_TARG); - } else if (orbi->status.resp == 0) { - if ((ccb->ccb_h.flags & CAM_SEND_STATUS) != 0) + orbi = NULL; + } else if (orbi->status.resp == ORBI_STATUS_NONE) { + if ((ccb->ccb_h.flags & CAM_SEND_STATUS) != 0) { + if (debug) + printf("%s: CAM_SEND_STATUS set %0x\n", __func__, ccb->ccb_h.flags); sbp_targ_send_status(orbi, ccb); - ccb->ccb_h.status = CAM_REQ_CMP; + } else { + if (debug) + printf("%s: CAM_SEND_STATUS not set %0x\n", __func__, ccb->ccb_h.flags); + ccb->ccb_h.status = CAM_REQ_CMP; + } SBP_LOCK(orbi->sc); xpt_done(ccb); SBP_UNLOCK(orbi->sc); @@ -855,6 +941,13 @@ sbp_targ_abort_ccb(struct sbp_targ_softc return (CAM_PATH_INVALID); } +/* + * directly execute a read or write to the initiator + * address space and set hand(sbp_targ_cam_done) to + * process the completion from the SIM to the target. + * set orbi->refcount to inidicate that a read/write + * is inflight to/from the initiator. + */ static void sbp_targ_xfer_buf(struct orb_info *orbi, u_int offset, uint16_t dst_hi, uint32_t dst_lo, u_int size, @@ -874,16 +967,21 @@ sbp_targ_xfer_buf(struct orb_info *orbi, len = MIN(size, 2048 /* XXX */); size -= len; orbi->refcount ++; - if (ccb_dir == CAM_DIR_OUT) + if (ccb_dir == CAM_DIR_OUT) { + if (debug) + printf("%s: CAM_DIR_OUT --> read block in?\n",__func__); xfer = fwmem_read_block(orbi->fwdev, - (void *)orbi, /*spd*/2, + (void *)orbi, /*spd*/FWSPD_S400, dst_hi, dst_lo + off, len, ptr + off, hand); - else + } else { + if (debug) + printf("%s: CAM_DIR_IN --> write block out?\n",__func__); xfer = fwmem_write_block(orbi->fwdev, - (void *)orbi, /*spd*/2, + (void *)orbi, /*spd*/FWSPD_S400, dst_hi, dst_lo + off, len, ptr + off, hand); + } if (xfer == NULL) { printf("%s: xfer == NULL", __func__); /* XXX what should we do?? */ @@ -897,18 +995,22 @@ static void sbp_targ_pt_done(struct fw_xfer *xfer) { struct orb_info *orbi; - union ccb *ccb; - u_int i, offset, res, len; - uint32_t t1, t2, *p; + struct unrestricted_page_table_fmt *pt; + uint32_t i; orbi = (struct orb_info *)xfer->sc; - ccb = orbi->ccb; + if (orbi->state == ORBI_STATUS_ABORTED) { if (debug) printf("%s: orbi aborted\n", __func__); sbp_targ_remove_orb_info(orbi->login, orbi); + if (debug) { + printf("%s: free orbi->page_table %p\n", __func__, orbi->page_table); + printf("%s: free orbi %p\n", __func__, orbi); + } free(orbi->page_table, M_SBP_TARG); free(orbi, M_SBP_TARG); + orbi = NULL; fw_xfer_free(xfer); return; } @@ -920,60 +1022,158 @@ sbp_targ_pt_done(struct fw_xfer *xfer) orbi->status.len = 1; sbp_targ_abort(orbi->sc, STAILQ_NEXT(orbi, link)); + if (debug) + printf("%s: free orbi->page_table %p\n", __func__, orbi->page_table); + sbp_targ_status_FIFO(orbi, orbi->login->fifo_hi, orbi->login->fifo_lo, /*dequeue*/1); free(orbi->page_table, M_SBP_TARG); + orbi->page_table = NULL; fw_xfer_free(xfer); return; } - res = ccb->csio.dxfer_len; - offset = 0; - if (debug) - printf("%s: dxfer_len=%d\n", __func__, res); - orbi->refcount ++; - for (p = orbi->page_table, i = orbi->orb4.data_size; i > 0; i --) { - t1 = ntohl(*p++); - t2 = ntohl(*p++); - if (debug > 1) - printf("page_table: %04x:%08x %d\n", - t1 & 0xffff, t2, t1>>16); - len = MIN(t1 >> 16, res); - res -= len; - sbp_targ_xfer_buf(orbi, offset, t1 & 0xffff, t2, len, - sbp_targ_cam_done); - offset += len; - if (res == 0) - break; + orbi->refcount++; +/* + * Set endianess here so we don't have + * to deal with is later + */ + for (i = 0, pt = orbi->page_table; i < orbi->orb4.data_size; i++, pt++) { + pt->segment_len = ntohs(pt->segment_len); + if (debug) + printf("%s:segment_len = %u\n", __func__,pt->segment_len); + pt->segment_base_high = ntohs(pt->segment_base_high); + pt->segment_base_low = ntohl(pt->segment_base_low); } - orbi->refcount --; + + sbp_targ_xfer_pt(orbi); + + orbi->refcount--; if (orbi->refcount == 0) printf("%s: refcount == 0\n", __func__); - if (res !=0) - /* XXX handle res != 0 case */ - printf("%s: page table is too small(%d)\n", __func__, res); fw_xfer_free(xfer); return; } +static void sbp_targ_xfer_pt(struct orb_info *orbi) +{ + union ccb *ccb; + uint32_t res, offset, len; + + ccb = orbi->ccb; + if (debug) + printf("%s: dxfer_len=%d\n", __func__, ccb->csio.dxfer_len); + res = ccb->csio.dxfer_len; + /* + * If the page table required multiple CTIO's to + * complete, then cur_pte is non NULL + * and we need to start from the last position + * If this is the first pass over a page table + * then we just start at the beginning of the page + * table. + * + * Parse the unrestricted page table and figure out where we need + * to shove the data from this read request. + */ + for (offset = 0, len = 0; (res != 0) && (orbi->cur_pte < orbi->last_pte); offset += len) { + len = MIN(orbi->cur_pte->segment_len, res); + res -= len; + if (debug) + printf("%s:page_table: %04x:%08x segment_len(%u) res(%u) len(%u)\n", + __func__, orbi->cur_pte->segment_base_high, + orbi->cur_pte->segment_base_low, + orbi->cur_pte->segment_len, + res, len); + sbp_targ_xfer_buf(orbi, offset, + orbi->cur_pte->segment_base_high, + orbi->cur_pte->segment_base_low, + len, sbp_targ_cam_done); + /* + * If we have only written partially to + * this page table, then we need to save + * our position for the next CTIO. If we + * have completed the page table, then we + * are safe to move on to the next entry. + */ + if (len == orbi->cur_pte->segment_len) { + orbi->cur_pte++; + } else { + uint32_t saved_base_low; + + /* Handle transfers that cross a 4GB boundary. */ + saved_base_low = orbi->cur_pte->segment_base_low; + orbi->cur_pte->segment_base_low += len; + if (orbi->cur_pte->segment_base_low < saved_base_low) + orbi->cur_pte->segment_base_high++; + + orbi->cur_pte->segment_len -= len; + } + } + if (debug) { + printf("%s: base_low(%08x) page_table_off(%p) last_block(%u)\n", + __func__, orbi->cur_pte->segment_base_low, + orbi->cur_pte, orbi->last_block_read); + } + if (res != 0) + printf("Warning - short pt encountered. " + "Could not transfer all data.\n"); + return; +} + +/* + * Create page table in local memory + * and transfer it from the initiator + * in order to know where we are supposed + * to put the data. + */ + static void sbp_targ_fetch_pt(struct orb_info *orbi) { struct fw_xfer *xfer; - if (debug) - printf("%s: page_table_size=%d\n", - __func__, orbi->orb4.data_size); - orbi->page_table = malloc(orbi->orb4.data_size*8, M_SBP_TARG, M_NOWAIT); - if (orbi->page_table == NULL) - goto error; - xfer = fwmem_read_block(orbi->fwdev, (void *)orbi, /*spd*/2, - orbi->data_hi, orbi->data_lo, orbi->orb4.data_size*8, - (void *)orbi->page_table, sbp_targ_pt_done); - if (xfer != NULL) + /* + * Pull in page table from initiator + * and setup for data from our + * backend device. + */ + if (orbi->page_table == NULL) { + orbi->page_table = malloc(orbi->orb4.data_size* + sizeof(struct unrestricted_page_table_fmt), + M_SBP_TARG, M_NOWAIT|M_ZERO); + if (orbi->page_table == NULL) + goto error; + orbi->cur_pte = orbi->page_table; + orbi->last_pte = orbi->page_table + orbi->orb4.data_size; + orbi->last_block_read = orbi->orb4.data_size; + if (debug && orbi->page_table != NULL) + printf("%s: malloc'd orbi->page_table(%p), orb4.data_size(%u)\n", + __func__, orbi->page_table, orbi->orb4.data_size); + + xfer = fwmem_read_block(orbi->fwdev, (void *)orbi, /*spd*/FWSPD_S400, + orbi->data_hi, orbi->data_lo, orbi->orb4.data_size* + sizeof(struct unrestricted_page_table_fmt), + (void *)orbi->page_table, sbp_targ_pt_done); + + if (xfer != NULL) + return; + } else { + /* + * This is a CTIO for a page table we have + * already malloc'd, so just directly invoke + * the xfer function on the orbi. + */ + sbp_targ_xfer_pt(orbi); return; + } error: orbi->ccb->ccb_h.status = CAM_RESRC_UNAVAIL; + if (debug) + printf("%s: free orbi->page_table %p due to xfer == NULL\n", __func__, orbi->page_table); + if (orbi->page_table != NULL) { + free(orbi->page_table, M_SBP_TARG); + orbi->page_table = NULL; + } xpt_done(orbi->ccb); return; } @@ -1016,6 +1216,8 @@ sbp_targ_action1(struct cam_sim *sim, un if (debug) printf("%s: ctio aborted\n", __func__); sbp_targ_remove_orb_info_locked(orbi->login, orbi); + if (debug) + printf("%s: free orbi %p\n", __func__, orbi); free(orbi, M_SBP_TARG); ccb->ccb_h.status = CAM_REQ_ABORTED; xpt_done(ccb); @@ -1051,17 +1253,16 @@ sbp_targ_action1(struct cam_sim *sim, un } /* Sanity check */ - if (ccb_dir != CAM_DIR_NONE && - orbi->orb4.data_size != ccb->csio.dxfer_len) - printf("%s: data_size(%d) != dxfer_len(%d)\n", - __func__, orbi->orb4.data_size, - ccb->csio.dxfer_len); - - if (ccb_dir != CAM_DIR_NONE) + if (ccb_dir != CAM_DIR_NONE) { sbp_targ_xfer_buf(orbi, 0, orbi->data_hi, orbi->data_lo, MIN(orbi->orb4.data_size, ccb->csio.dxfer_len), sbp_targ_cam_done); + if ( orbi->orb4.data_size > ccb->csio.dxfer_len ) { + orbi->data_lo += ccb->csio.dxfer_len; + orbi->orb4.data_size -= ccb->csio.dxfer_len; + } + } if (ccb_dir == CAM_DIR_NONE) { if ((ccb->ccb_h.flags & CAM_SEND_STATUS) != 0) { @@ -1125,7 +1326,8 @@ sbp_targ_action1(struct cam_sim *sim, un cpi->target_sprt = PIT_PROCESSOR | PIT_DISCONNECT | PIT_TERM_IO; - cpi->hba_misc = PIM_NOBUSRESET | PIM_NO_6_BYTE; + cpi->transport = XPORT_SPI; /* FIXME add XPORT_FW type to cam */ + cpi->hba_misc = PIM_NOBUSRESET | PIM_NOBUSRESET; cpi->hba_eng_cnt = 0; cpi->max_target = 7; /* XXX */ cpi->max_lun = MAX_LUN - 1; @@ -1163,10 +1365,42 @@ sbp_targ_action1(struct cam_sim *sim, un xpt_done(ccb); break; } +#ifdef CAM_NEW_TRAN_CODE + case XPT_SET_TRAN_SETTINGS: + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); + break; + case XPT_GET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + struct ccb_trans_settings_scsi *scsi = + &cts->proto_specific.scsi; + struct ccb_trans_settings_spi *spi = + &cts->xport_specific.spi; + + cts->protocol = PROTO_SCSI; + cts->protocol_version = SCSI_REV_2; + cts->transport = XPORT_FW; /* should have a FireWire */ + cts->transport_version = 2; + spi->valid = CTS_SPI_VALID_DISC; + spi->flags = CTS_SPI_FLAGS_DISC_ENB; + scsi->valid = CTS_SCSI_VALID_TQ; + scsi->flags = CTS_SCSI_FLAGS_TAG_ENB; +#if 0 + printf("%s:%d:%d XPT_GET_TRAN_SETTINGS:\n", + device_get_nameunit(sc->fd.dev), + ccb->ccb_h.target_id, ccb->ccb_h.target_lun); +#endif + cts->ccb_h.status = CAM_REQ_CMP; + xpt_done(ccb); + break; + } +#endif + default: - printf("%s: unknown function %d\n", + printf("%s: unknown function 0x%x\n", __func__, ccb->ccb_h.func_code); - ccb->ccb_h.status = CAM_REQ_INVALID; + ccb->ccb_h.status = CAM_PROVIDE_FAIL; xpt_done(ccb); break; } @@ -1245,7 +1479,7 @@ sbp_targ_cmd_handler(struct fw_xfer *xfe atio->ccb_h.target_id = 0; /* XXX */ atio->ccb_h.target_lun = orbi->login->lstate->lun; atio->sense_len = 0; - atio->tag_action = 1; /* XXX */ + atio->tag_action = MSG_SIMPLE_TASK; atio->tag_id = orbi->orb_lo; atio->init_id = orbi->login->id; @@ -1429,7 +1663,7 @@ sbp_targ_mgm_handler(struct fw_xfer *xfe login->loginres.recon_hold = htons(login->hold_sec); STAILQ_INSERT_TAIL(&lstate->logins, login, link); - fwmem_write_block(orbi->fwdev, NULL, /*spd*/2, orb[2], orb[3], + fwmem_write_block(orbi->fwdev, NULL, /*spd*/FWSPD_S400, orb[2], orb[3], sizeof(struct sbp_login_res), (void *)&login->loginres, fw_asy_callback_free); /* XXX return status after loginres is successfully written */ @@ -1515,10 +1749,11 @@ sbp_targ_fetch_orb(struct sbp_targ_softc orbi->orb_lo = orb_lo; orbi->status.orb_hi = htons(orb_hi); orbi->status.orb_lo = htonl(orb_lo); + orbi->page_table = NULL; switch (mode) { case FETCH_MGM: - fwmem_read_block(fwdev, (void *)orbi, /*spd*/2, orb_hi, orb_lo, + fwmem_read_block(fwdev, (void *)orbi, /*spd*/FWSPD_S400, orb_hi, orb_lo, sizeof(uint32_t) * 8, &orbi->orb[0], sbp_targ_mgm_handler); break; @@ -1545,14 +1780,14 @@ sbp_targ_fetch_orb(struct sbp_targ_softc SLIST_REMOVE_HEAD(&login->lstate->accept_tios, sim_links.sle); STAILQ_INSERT_TAIL(&login->orbs, orbi, link); SBP_UNLOCK(sc); - fwmem_read_block(fwdev, (void *)orbi, /*spd*/2, orb_hi, orb_lo, + fwmem_read_block(fwdev, (void *)orbi, /*spd*/FWSPD_S400, orb_hi, orb_lo, sizeof(uint32_t) * 8, &orbi->orb[0], sbp_targ_cmd_handler); break; case FETCH_POINTER: orbi->state = ORBI_STATUS_POINTER; login->flags |= F_LINK_ACTIVE; - fwmem_read_block(fwdev, (void *)orbi, /*spd*/2, orb_hi, orb_lo, + fwmem_read_block(fwdev, (void *)orbi, /*spd*/FWSPD_S400, orb_hi, orb_lo, sizeof(uint32_t) * 2, &orbi->orb[0], sbp_targ_pointer_handler); break; @@ -1709,7 +1944,7 @@ done: if (rtcode != 0) printf("%s: rtcode = %d\n", __func__, rtcode); sfp = &xfer->send.hdr; - xfer->send.spd = 2; /* XXX */ + xfer->send.spd = FWSPD_S400; xfer->hand = sbp_targ_resp_callback; sfp->mode.wres.dst = fp->mode.wreqb.src; sfp->mode.wres.tlrt = fp->mode.wreqb.tlrt; From owner-svn-src-all@FreeBSD.ORG Wed Jan 25 23:49:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC3DD1065674; Wed, 25 Jan 2012 23:49:24 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 2C9CE8FC12; Wed, 25 Jan 2012 23:49:23 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAJqTIE+DaFvO/2dsb2JhbABDhQmqQYFyAQEFIwRSGw4KAgINGQJZBq5HkVSBL4dgAQYGCQUBAQIBCQIYCoJNBgIFAQUKAQMJCgEGAgJdFAaCH4EWBIg/jF+Sbw X-IronPort-AV: E=Sophos;i="4.71,571,1320642000"; d="scan'208";a="153729821" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 25 Jan 2012 18:49:23 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 1D8DAB3EB1; Wed, 25 Jan 2012 18:49:23 -0500 (EST) Date: Wed, 25 Jan 2012 18:49:23 -0500 (EST) From: Rick Macklem To: Bruce Evans Message-ID: <919199278.155166.1327535363109.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20120125152150.M1522@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.202] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230516 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 23:49:24 -0000 Bruce Evans wrote: > On Tue, 24 Jan 2012, Rick Macklem wrote: > > > Bruce Evans wrote: > >> On Wed, 25 Jan 2012, Rick Macklem wrote: > >> > >>> Log: > >>> If a mount -u is done to either NFS client that switches it > >>> from TCP to UDP and the rsize/wsize/readdirsize is greater > >>> than NFS_MAXDGRAMDATA, it is possible for a thread doing an > >>> I/O RPC to get stuck repeatedly doing retries. This happens > >>> ... > > >> Could it wait for the old i/o to complete (and not start any new > >> i/o?). This is little different from having to wait when changing > >> from rw to ro. The latter is not easy, and at least the old nfs > >> client seems to not even dream of it. ffs has always called a > >> ... > > > As you said above "not easy ... uses complicated suspension of i/o". > > I have not tried to code this, but I think it would be non-trivial. > > The code would need to block new I/O before RPCs are issued and wait > > for all in-progress I/Os to complete. At this time, the kernel RPC > > handles the in-progress RPCs and NFS doesn't "know" what is > > outstanding. Of course, code could be added to keep track of > > in-progress > > I/O RPCs, but that would have to be written, as well. > > Hmm, this means that even when the i/o sizes are small, the mode > switch > from tcp to udp may be unsafe since there may still be i/o's with > higher > sizes outstanding. So to switch from tcp to udp, the user should first > reduce the sizes, when wait a while before switching to udp. And what > happens with retries after changing sizes up or down? Does it retry > with the old sizes? > > Bruce Good point. I think (assuming a TCP mount with large rsize): # mount -u -o rsize=16384 /mnt # mount -u -o udp /mnt - could still result in a wedged thread trying to do a read that is too large for UDP. I'll revert r230516, since it doesn't really fix the problem, it just reduced its lieklyhood. I'll ask on freebsd-fs@ if anyone finds switching from TCP->UDP via a "mount -u" is useful to them. If no one thinks it's necessary, the patch could just disallow the switch, no matter what the old rsize/wsize/readdirsize is. Otherwise, the fix is somewhat involved and difficult for a scenario like this, where the NFS server is network partitioned or crashed: - sysadmin notices NFS mount is "hung" and does # mount -u -o udp /path to try and fix it, but it doesn't help - sysadmin tries "umount -f /path" to get rid of the "hung" mount. If "mount -u -o udp /path" is waiting for I/O ops to complete, (which is what the somewhat involved patch would need to do) the "umount -f /path" will get stuck waiting for the "mount -u" which will be waiting for I/O RPCs to complete. This could be partially fixed by making sure that the "mount -u -o udp /path" is interruptible (via C), but I still don't like the idea that "umount -f /path" won't work if "mount -u -o udp /path" is sitting in the kernel waiting for RPCs to complete, which would need to be done to make a TCP->UDP switch work. rick From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 00:07:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F19F106566C; Thu, 26 Jan 2012 00:07:35 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D77788FC14; Thu, 26 Jan 2012 00:07:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q07YUS052476; Thu, 26 Jan 2012 00:07:34 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q07YN5052473; Thu, 26 Jan 2012 00:07:34 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201260007.q0Q07YN5052473@svn.freebsd.org> From: Rick Macklem Date: Thu, 26 Jan 2012 00:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230559 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 00:07:35 -0000 Author: rmacklem Date: Thu Jan 26 00:07:34 2012 New Revision: 230559 URL: http://svn.freebsd.org/changeset/base/230559 Log: Revert r230516, since it doesn't really fix the problem. Modified: head/sys/fs/nfsclient/nfs_clvfsops.c head/sys/nfsclient/nfs_vfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Wed Jan 25 23:33:50 2012 (r230558) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Thu Jan 26 00:07:34 2012 (r230559) @@ -999,23 +999,6 @@ nfs_mount(struct mount *mp) error = EIO; goto out; } - - /* - * Cannot switch to UDP if current rsize/wsize/readdirsize is - * too large, since there may be an I/O RPC in progress that - * will get retried after the switch to the UDP socket. These - * retries will fail over and over and over again. - */ - if (args.sotype == SOCK_DGRAM && - (nmp->nm_rsize > NFS_MAXDGRAMDATA || - nmp->nm_wsize > NFS_MAXDGRAMDATA || - nmp->nm_readdirsize > NFS_MAXDGRAMDATA)) { - vfs_mount_error(mp, - "old rsize/wsize/readdirsize greater than UDP max"); - error = EINVAL; - goto out; - } - /* * When doing an update, we can't change version, * security, switch lockd strategies or change cookie Modified: head/sys/nfsclient/nfs_vfsops.c ============================================================================== --- head/sys/nfsclient/nfs_vfsops.c Wed Jan 25 23:33:50 2012 (r230558) +++ head/sys/nfsclient/nfs_vfsops.c Thu Jan 26 00:07:34 2012 (r230559) @@ -1116,23 +1116,6 @@ nfs_mount(struct mount *mp) error = EIO; goto out; } - - /* - * Cannot switch to UDP if current rsize/wsize/readdirsize is - * too large, since there may be an I/O RPC in progress that - * will get retried after the switch to the UDP socket. These - * retries will fail over and over and over again. - */ - if (args.sotype == SOCK_DGRAM && - (nmp->nm_rsize > NFS_MAXDGRAMDATA || - nmp->nm_wsize > NFS_MAXDGRAMDATA || - nmp->nm_readdirsize > NFS_MAXDGRAMDATA)) { - vfs_mount_error(mp, - "old rsize/wsize/readdirsize greater than UDP max"); - error = EINVAL; - goto out; - } - /* * When doing an update, we can't change from or to * v3, switch lockd strategies or change cookie translation From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 03:03:09 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FF7D1065670; Thu, 26 Jan 2012 03:03:09 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id BA4A68FC12; Thu, 26 Jan 2012 03:03:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0Q336GT080556; Thu, 26 Jan 2012 07:03:07 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0Q33680080555; Thu, 26 Jan 2012 07:03:06 +0400 (MSK) (envelope-from ache) Date: Thu, 26 Jan 2012 07:03:05 +0400 From: Andrey Chernov To: Mark Murray , David Schultz Message-ID: <20120126030305.GA80493@vniz.net> Mail-Followup-To: Andrey Chernov , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120118061943.GA80874@vniz.net> <20120120055823.GA28177@vniz.net> <20120120215649.GA40016@vniz.net> <20120122185545.GA11874@vniz.net> <20120125140237.GA74896@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 03:03:09 -0000 On Wed, Jan 25, 2012 at 07:16:41PM +0000, Mark Murray wrote: > I thought you were going to do this as a function? It would be > slightly neater to do it that way. > > Looks good! Are you sure this needs no locking or volatile > variables? Now with function, volatile, atomic and even enum: --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 +++ sys/libkern.h 2012-01-26 06:01:51.000000000 +0400 @@ -72,6 +72,8 @@ static __inline quad_t qabs(quad_t a) { /* Prototypes for non-quad routines. */ struct malloc_type; +enum arc4_is { ARC4_ENTR_NONE, ARC4_ENTR_HAVE, ARC4_ENTR_DONE }; +void arc4rand_iniseed_state(enum arc4_is state); uint32_t arc4random(void); void arc4rand(void *ptr, u_int len, int reseed); int bcmp(const void *, const void *, size_t); --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.000000000 +0300 +++ dev/random/randomdev_soft.c 2012-01-26 06:04:05.000000000 +0400 @@ -366,6 +366,7 @@ random_yarrow_unblock(void) selwakeuppri(&random_systat.rsel, PUSER); wakeup(&random_systat); } + arc4rand_iniseed_state(ARC4_ENTR_HAVE); } static int --- libkern/arc4random.c.old 2008-08-08 01:51:09.000000000 +0400 +++ libkern/arc4random.c 2012-01-26 06:01:07.000000000 +0400 @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 #define ARC4_RESEED_SECONDS 300 #define ARC4_KEYBYTES (256 / 8) +static volatile enum arc4_is iniseed_state = ARC4_ENTR_NONE; static u_int8_t arc4_i, arc4_j; static int arc4_numruns = 0; static u_int8_t arc4_sbox[256]; @@ -74,6 +75,7 @@ arc4_randomstir (void) /* Reset for next reseed cycle. */ arc4_t_reseed = tv_now.tv_sec + ARC4_RESEED_SECONDS; arc4_numruns = 0; + arc4rand_iniseed_state(ARC4_ENTR_DONE); /* * Throw away the first N words of output, as suggested in the @@ -103,6 +105,24 @@ arc4_init(void) SYSINIT(arc4_init, SI_SUB_LOCK, SI_ORDER_ANY, arc4_init, NULL); +void +arc4rand_iniseed_state(enum arc4_is state) +{ + switch (state) { + case ARC4_ENTR_NONE: + atomic_store_rel_int(&iniseed_state, state); + break; + case ARC4_ENTR_HAVE: + if (iniseed_state == ARC4_ENTR_NONE) + atomic_store_rel_int(&iniseed_state, state); + break; + case ARC4_ENTR_DONE: + if (iniseed_state == ARC4_ENTR_HAVE) + atomic_store_rel_int(&iniseed_state, state); + break; + } +} + /* * Generate a random byte. */ @@ -130,7 +150,7 @@ arc4rand(void *ptr, u_int len, int resee struct timeval tv; getmicrouptime(&tv); - if (reseed || + if (reseed || iniseed_state == ARC4_ENTR_HAVE || (arc4_numruns > ARC4_RESEED_BYTES) || (tv.tv_sec > arc4_t_reseed)) arc4_randomstir(); -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 03:39:54 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FC26106567C; Thu, 26 Jan 2012 03:39:54 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 9BD698FC18; Thu, 26 Jan 2012 03:39:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0Q3dpnY080764; Thu, 26 Jan 2012 07:39:52 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0Q3dpGc080763; Thu, 26 Jan 2012 07:39:51 +0400 (MSK) (envelope-from ache) Date: Thu, 26 Jan 2012 07:39:50 +0400 From: Andrey Chernov To: Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120126033950.GA80737@vniz.net> Mail-Followup-To: Andrey Chernov , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120120055823.GA28177@vniz.net> <20120120215649.GA40016@vniz.net> <20120122185545.GA11874@vniz.net> <20120125140237.GA74896@vniz.net> <20120126030305.GA80493@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120126030305.GA80493@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 03:39:54 -0000 On Thu, Jan 26, 2012 at 07:03:05AM +0400, Andrey Chernov wrote: > On Wed, Jan 25, 2012 at 07:16:41PM +0000, Mark Murray wrote: > > I thought you were going to do this as a function? It would be > > slightly neater to do it that way. > > > > Looks good! Are you sure this needs no locking or volatile > > variables? > > Now with function, volatile, atomic and even enum: Sorry. Reading of state variable should be atomical too. Fixed version: --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 +++ sys/libkern.h 2012-01-26 06:01:51.000000000 +0400 @@ -72,6 +72,8 @@ static __inline quad_t qabs(quad_t a) { /* Prototypes for non-quad routines. */ struct malloc_type; +enum arc4_is { ARC4_ENTR_NONE, ARC4_ENTR_HAVE, ARC4_ENTR_DONE }; +void arc4rand_iniseed_state(enum arc4_is state); uint32_t arc4random(void); void arc4rand(void *ptr, u_int len, int reseed); int bcmp(const void *, const void *, size_t); --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.000000000 +0300 +++ dev/random/randomdev_soft.c 2012-01-26 06:04:05.000000000 +0400 @@ -366,6 +366,7 @@ random_yarrow_unblock(void) selwakeuppri(&random_systat.rsel, PUSER); wakeup(&random_systat); } + arc4rand_iniseed_state(ARC4_ENTR_HAVE); } static int --- libkern/arc4random.c.old 2008-08-08 01:51:09.000000000 +0400 +++ libkern/arc4random.c 2012-01-26 07:27:06.000000000 +0400 @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 #define ARC4_RESEED_SECONDS 300 #define ARC4_KEYBYTES (256 / 8) +static volatile enum arc4_is iniseed_state = ARC4_ENTR_NONE; static u_int8_t arc4_i, arc4_j; static int arc4_numruns = 0; static u_int8_t arc4_sbox[256]; @@ -74,6 +75,7 @@ arc4_randomstir (void) /* Reset for next reseed cycle. */ arc4_t_reseed = tv_now.tv_sec + ARC4_RESEED_SECONDS; arc4_numruns = 0; + arc4rand_iniseed_state(ARC4_ENTR_DONE); /* * Throw away the first N words of output, as suggested in the @@ -103,6 +105,24 @@ arc4_init(void) SYSINIT(arc4_init, SI_SUB_LOCK, SI_ORDER_ANY, arc4_init, NULL); +void +arc4rand_iniseed_state(enum arc4_is state) +{ + switch (state) { + case ARC4_ENTR_NONE: + atomic_store_rel_int(&iniseed_state, state); + break; + case ARC4_ENTR_HAVE: + if (atomic_load_acq_int(&iniseed_state) == ARC4_ENTR_NONE) + atomic_store_rel_int(&iniseed_state, state); + break; + case ARC4_ENTR_DONE: + if (atomic_load_acq_int(&iniseed_state) == ARC4_ENTR_HAVE) + atomic_store_rel_int(&iniseed_state, state); + break; + } +} + /* * Generate a random byte. */ @@ -130,7 +150,7 @@ arc4rand(void *ptr, u_int len, int resee struct timeval tv; getmicrouptime(&tv); - if (reseed || + if (reseed || atomic_load_acq_int(&iniseed_state) == ARC4_ENTR_HAVE || (arc4_numruns > ARC4_RESEED_BYTES) || (tv.tv_sec > arc4_t_reseed)) arc4_randomstir(); -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 05:11:38 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86D5D1065670; Thu, 26 Jan 2012 05:11:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75DF28FC15; Thu, 26 Jan 2012 05:11:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q5BcAk063185; Thu, 26 Jan 2012 05:11:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q5BcKX063183; Thu, 26 Jan 2012 05:11:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201260511.q0Q5BcKX063183@svn.freebsd.org> From: Adrian Chadd Date: Thu, 26 Jan 2012 05:11:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230562 - head/sys/dev/wi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 05:11:38 -0000 Author: adrian Date: Thu Jan 26 05:11:37 2012 New Revision: 230562 URL: http://svn.freebsd.org/changeset/base/230562 Log: Include opt_wlan.h before net80211 includes; so IEEE80211_* configuration flags are correctly handled. This is required for this to load when IEEE80211_DEBUG_REFCNT is defined. Modified: head/sys/dev/wi/if_wi.c Modified: head/sys/dev/wi/if_wi.c ============================================================================== --- head/sys/dev/wi/if_wi.c Thu Jan 26 03:40:32 2012 (r230561) +++ head/sys/dev/wi/if_wi.c Thu Jan 26 05:11:37 2012 (r230562) @@ -62,6 +62,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_wlan.h" + #define WI_HERMES_STATS_WAR /* Work around stats counter bug. */ #include From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 06:57:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 100C6106564A; Thu, 26 Jan 2012 06:57:48 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE2828FC15; Thu, 26 Jan 2012 06:57:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q6vlIZ067066; Thu, 26 Jan 2012 06:57:47 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q6vlKX067064; Thu, 26 Jan 2012 06:57:47 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201201260657.q0Q6vlKX067064@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 26 Jan 2012 06:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230563 - stable/9/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 06:57:48 -0000 Author: ae Date: Thu Jan 26 06:57:47 2012 New Revision: 230563 URL: http://svn.freebsd.org/changeset/base/230563 Log: MFC r229916 (by eadler): Fix warning when compiling with gcc46: error: variable 'secsz' set but not used Modified: stable/9/sbin/geom/class/part/geom_part.c Directory Properties: stable/9/sbin/geom/class/part/ (props changed) Modified: stable/9/sbin/geom/class/part/geom_part.c ============================================================================== --- stable/9/sbin/geom/class/part/geom_part.c Thu Jan 26 05:11:37 2012 (r230562) +++ stable/9/sbin/geom/class/part/geom_part.c Thu Jan 26 06:57:47 2012 (r230563) @@ -718,7 +718,7 @@ gpart_backup(struct gctl_req *req, unsig struct ggeom *gp; const char *s, *scheme; off_t sector, end; - off_t length, secsz; + off_t length; int error, i, windex, wblocks, wtype; if (gctl_get_int(req, "nargs") != 1) @@ -744,7 +744,6 @@ gpart_backup(struct gctl_req *req, unsig if (scheme == NULL) abort(); pp = LIST_FIRST(&gp->lg_consumer)->lg_provider; - secsz = pp->lg_sectorsize; s = find_geomcfg(gp, "last"); wblocks = strlen(s); wtype = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 07:03:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 246CF106566C; Thu, 26 Jan 2012 07:03:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FFBE8FC0A; Thu, 26 Jan 2012 07:03:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q73UiL068126; Thu, 26 Jan 2012 07:03:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q73Upq068123; Thu, 26 Jan 2012 07:03:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201260703.q0Q73Upq068123@svn.freebsd.org> From: Adrian Chadd Date: Thu, 26 Jan 2012 07:03:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230564 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 07:03:31 -0000 Author: adrian Date: Thu Jan 26 07:03:30 2012 New Revision: 230564 URL: http://svn.freebsd.org/changeset/base/230564 Log: Add some node debugging which has helped me track down which particular concurrent vap->iv_bss free issues have been occuring. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Thu Jan 26 06:57:47 2012 (r230563) +++ head/sys/dev/ath/if_ath.c Thu Jan 26 07:03:30 2012 (r230564) @@ -2695,6 +2695,8 @@ ath_beacon_alloc(struct ath_softc *sc, s int error; bf = avp->av_bcbuf; + DPRINTF(sc, ATH_DEBUG_NODE, "%s: bf_m=%p, bf_node=%p\n", + __func__, bf->bf_m, bf->bf_node); if (bf->bf_m != NULL) { bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); m_freem(bf->bf_m); @@ -3152,6 +3154,8 @@ static void ath_beacon_return(struct ath_softc *sc, struct ath_buf *bf) { + DPRINTF(sc, ATH_DEBUG_NODE, "%s: free bf=%p, bf_m=%p, bf_node=%p\n", + __func__, bf, bf->bf_m, bf->bf_node); if (bf->bf_m != NULL) { bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); m_freem(bf->bf_m); @@ -3173,6 +3177,9 @@ ath_beacon_free(struct ath_softc *sc) struct ath_buf *bf; TAILQ_FOREACH(bf, &sc->sc_bbuf, bf_list) { + DPRINTF(sc, ATH_DEBUG_NODE, + "%s: free bf=%p, bf_m=%p, bf_node=%p\n", + __func__, bf, bf->bf_m, bf->bf_node); if (bf->bf_m != NULL) { bus_dmamap_unload(sc->sc_dmat, bf->bf_dmamap); m_freem(bf->bf_m); From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 07:42:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E36E6106564A; Thu, 26 Jan 2012 07:42:54 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E72E8FC0C; Thu, 26 Jan 2012 07:42:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q7gsOd070723; Thu, 26 Jan 2012 07:42:54 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q7gsJk070721; Thu, 26 Jan 2012 07:42:54 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201201260742.q0Q7gsJk070721@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 26 Jan 2012 07:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230565 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 07:42:55 -0000 Author: ae Date: Thu Jan 26 07:42:54 2012 New Revision: 230565 URL: http://svn.freebsd.org/changeset/base/230565 Log: MFC r215118: Move code for search of existing geom into g_part_find_geom function and use this function instead of g_part_parm_geom in g_part_ctl_create. Modified: stable/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Thu Jan 26 07:03:30 2012 (r230564) +++ stable/8/sys/geom/part/g_part.c Thu Jan 26 07:42:54 2012 (r230565) @@ -299,6 +299,17 @@ g_part_new_provider(struct g_geom *gp, s g_error_provider(entry->gpe_pp, 0); } +static struct g_geom* +g_part_find_geom(const char *name) +{ + struct g_geom *gp; + LIST_FOREACH(gp, &g_part_class.geom, geom) { + if (!strcmp(name, gp->name)) + break; + } + return (gp); +} + static int g_part_parm_geom(const char *name, struct g_geom **v) { @@ -306,10 +317,7 @@ g_part_parm_geom(const char *name, struc if (strncmp(name, _PATH_DEV, strlen(_PATH_DEV)) == 0) name += strlen(_PATH_DEV); - LIST_FOREACH(gp, &g_part_class.geom, geom) { - if (!strcmp(name, gp->name)) - break; - } + gp = g_part_find_geom(name); if (gp == NULL) return (EINVAL); *v = gp; @@ -682,8 +690,8 @@ g_part_ctl_create(struct gctl_req *req, g_topology_assert(); /* Check that there isn't already a g_part geom on the provider. */ - error = g_part_parm_geom(pp->name, &gp); - if (!error) { + gp = g_part_find_geom(pp->name); + if (gp != NULL) { null = gp->softc; if (null->gpt_scheme != &g_part_null_scheme) { gctl_error(req, "%d geom '%s'", EEXIST, pp->name); From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 07:51:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78F99106566B; Thu, 26 Jan 2012 07:51:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62D2B8FC12; Thu, 26 Jan 2012 07:51:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q7pqMi071047; Thu, 26 Jan 2012 07:51:52 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q7pqF1071045; Thu, 26 Jan 2012 07:51:52 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201201260751.q0Q7pqF1071045@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 26 Jan 2012 07:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230566 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 07:51:52 -0000 Author: ae Date: Thu Jan 26 07:51:51 2012 New Revision: 230566 URL: http://svn.freebsd.org/changeset/base/230566 Log: MFC r226880 (modified version): Our geom withering function could take some time before geom with its providers and consumers will be destroyed. Before take some actions with a geom, check that it is not destroyed at the moment. Modified: stable/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Thu Jan 26 07:42:54 2012 (r230565) +++ stable/8/sys/geom/part/g_part.c Thu Jan 26 07:51:51 2012 (r230566) @@ -320,6 +320,8 @@ g_part_parm_geom(const char *name, struc gp = g_part_find_geom(name); if (gp == NULL) return (EINVAL); + if ((gp->flags & G_GEOM_WITHER) != 0) + return (ENXIO); *v = gp; return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 08:47:31 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8CF8106566C; Thu, 26 Jan 2012 08:47:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 83F3F8FC08; Thu, 26 Jan 2012 08:47:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q8lUuL072939; Thu, 26 Jan 2012 08:47:30 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q8lUcm072937; Thu, 26 Jan 2012 08:47:30 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201201260847.q0Q8lUcm072937@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 26 Jan 2012 08:47:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230567 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 08:47:32 -0000 Author: ae Date: Thu Jan 26 08:47:29 2012 New Revision: 230567 URL: http://svn.freebsd.org/changeset/base/230567 Log: MFC r221788: Add basic metadata integrity check. In case when partition table was probed and read successfull, but it contains invalid values (e.g. overlapped partitions, offset or size is out of bounds), then table will be rejected. MFC r221972: Add a sysctl kern.geom.part.check_integrity for those who has corrupt partition tables and lost an ability to boot after r221788. Also unhide an error message from bootverbose, this would help to easier determine the problem. MFC r221984: Add diagnostic messages for integrity checks. MFC r221992: Make diagnostic messages more specific. With bootverbose print out all inconsistencies of integrity in the partition table, not first found only. MFC r222642: Add diagnostic message about not aligned partitions. Modified: stable/8/sys/geom/part/g_part.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Thu Jan 26 07:51:51 2012 (r230566) +++ stable/8/sys/geom/part/g_part.c Thu Jan 26 08:47:29 2012 (r230567) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -104,6 +105,13 @@ struct g_part_alias_list { { "netbsd-swap", G_PART_ALIAS_NETBSD_SWAP }, }; +SYSCTL_DECL(_kern_geom); +SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); +static u_int check_integrity = 1; +TUNABLE_INT("kern.geom.part.check_integrity", &check_integrity); +SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, CTLFLAG_RW, + &check_integrity, 1, "Enable integrity checking"); + /* * The GEOM partitioning class. */ @@ -231,6 +239,123 @@ g_part_geometry(struct g_part_table *tab } } +#define DPRINTF(...) if (bootverbose) { \ + printf("GEOM_PART: " __VA_ARGS__); \ +} + +static int +g_part_check_integrity(struct g_part_table *table, struct g_consumer *cp) +{ + struct g_part_entry *e1, *e2; + struct g_provider *pp; + off_t offset; + int failed; + + failed = 0; + pp = cp->provider; + if (table->gpt_last < table->gpt_first) { + DPRINTF("last LBA is below first LBA: %jd < %jd\n", + (intmax_t)table->gpt_last, (intmax_t)table->gpt_first); + failed++; + } + if (table->gpt_last > pp->mediasize / pp->sectorsize - 1) { + DPRINTF("last LBA extends beyond mediasize: " + "%jd > %jd\n", (intmax_t)table->gpt_last, + (intmax_t)pp->mediasize / pp->sectorsize - 1); + failed++; + } + LIST_FOREACH(e1, &table->gpt_entry, gpe_entry) { + if (e1->gpe_deleted || e1->gpe_internal) + continue; + if (e1->gpe_start < table->gpt_first) { + DPRINTF("partition %d has start offset below first " + "LBA: %jd < %jd\n", e1->gpe_index, + (intmax_t)e1->gpe_start, + (intmax_t)table->gpt_first); + failed++; + } + if (e1->gpe_start > table->gpt_last) { + DPRINTF("partition %d has start offset beyond last " + "LBA: %jd > %jd\n", e1->gpe_index, + (intmax_t)e1->gpe_start, + (intmax_t)table->gpt_last); + failed++; + } + if (e1->gpe_end < e1->gpe_start) { + DPRINTF("partition %d has end offset below start " + "offset: %jd < %jd\n", e1->gpe_index, + (intmax_t)e1->gpe_end, + (intmax_t)e1->gpe_start); + failed++; + } + if (e1->gpe_end > table->gpt_last) { + DPRINTF("partition %d has end offset beyond last " + "LBA: %jd > %jd\n", e1->gpe_index, + (intmax_t)e1->gpe_end, + (intmax_t)table->gpt_last); + failed++; + } + if (pp->stripesize > 0) { + offset = e1->gpe_start * pp->sectorsize; + if (e1->gpe_offset > offset) + offset = e1->gpe_offset; + if ((offset + pp->stripeoffset) % pp->stripesize) { + DPRINTF("partition %d is not aligned on %u " + "bytes\n", e1->gpe_index, pp->stripesize); + /* Don't treat this as a critical failure */ + } + } + e2 = e1; + while ((e2 = LIST_NEXT(e2, gpe_entry)) != NULL) { + if (e2->gpe_deleted || e2->gpe_internal) + continue; + if (e1->gpe_start >= e2->gpe_start && + e1->gpe_start <= e2->gpe_end) { + DPRINTF("partition %d has start offset inside " + "partition %d: start[%d] %jd >= start[%d] " + "%jd <= end[%d] %jd\n", + e1->gpe_index, e2->gpe_index, + e2->gpe_index, (intmax_t)e2->gpe_start, + e1->gpe_index, (intmax_t)e1->gpe_start, + e2->gpe_index, (intmax_t)e2->gpe_end); + failed++; + } + if (e1->gpe_end >= e2->gpe_start && + e1->gpe_end <= e2->gpe_end) { + DPRINTF("partition %d has end offset inside " + "partition %d: start[%d] %jd >= end[%d] " + "%jd <= end[%d] %jd\n", + e1->gpe_index, e2->gpe_index, + e2->gpe_index, (intmax_t)e2->gpe_start, + e1->gpe_index, (intmax_t)e1->gpe_end, + e2->gpe_index, (intmax_t)e2->gpe_end); + failed++; + } + if (e1->gpe_start < e2->gpe_start && + e1->gpe_end > e2->gpe_end) { + DPRINTF("partition %d contains partition %d: " + "start[%d] %jd > start[%d] %jd, end[%d] " + "%jd < end[%d] %jd\n", + e1->gpe_index, e2->gpe_index, + e1->gpe_index, (intmax_t)e1->gpe_start, + e2->gpe_index, (intmax_t)e2->gpe_start, + e2->gpe_index, (intmax_t)e2->gpe_end, + e1->gpe_index, (intmax_t)e1->gpe_end); + failed++; + } + } + } + if (failed != 0) { + printf("GEOM_PART: integrity check failed (%s, %s)\n", + pp->name, table->gpt_scheme->name); + if (check_integrity != 0) + return (EINVAL); + table->gpt_corrupt = 1; + } + return (0); +} +#undef DPRINTF + struct g_part_entry * g_part_new_entry(struct g_part_table *table, int index, quad_t start, quad_t end) @@ -542,7 +667,11 @@ g_part_ctl_add(struct gctl_req *req, str if (gpp->gpp_parms & G_PART_PARM_OUTPUT) { sb = sbuf_new_auto(); G_PART_FULLNAME(table, entry, sb, gp->name); - sbuf_cat(sb, " added\n"); + if (pp->stripesize > 0 && entry->gpe_pp->stripeoffset != 0) + sbuf_printf(sb, " added, but partition is not " + "aligned on %u bytes\n", pp->stripesize); + else + sbuf_cat(sb, " added\n"); sbuf_finish(sb); gctl_set_param(req, "output", sbuf_data(sb), sbuf_len(sb) + 1); sbuf_delete(sb); @@ -1243,9 +1372,11 @@ g_part_ctl_undo(struct gctl_req *req, st error = G_PART_READ(table, cp); if (error) goto fail; + error = g_part_check_integrity(table, cp); + if (error) + goto fail; g_topology_lock(); - LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { if (!entry->gpe_internal) g_part_new_provider(gp, table, entry); @@ -1711,6 +1842,9 @@ g_part_taste(struct g_class *mp, struct error = G_PART_READ(table, cp); if (error) goto fail; + error = g_part_check_integrity(table, cp); + if (error) + goto fail; g_topology_lock(); LIST_FOREACH(entry, &table->gpt_entry, gpe_entry) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 08:51:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97334106564A; Thu, 26 Jan 2012 08:51:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8194D8FC14; Thu, 26 Jan 2012 08:51:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q8pOZH073099; Thu, 26 Jan 2012 08:51:24 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q8pO3f073097; Thu, 26 Jan 2012 08:51:24 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201201260851.q0Q8pO3f073097@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 26 Jan 2012 08:51:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230568 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 08:51:24 -0000 Author: ae Date: Thu Jan 26 08:51:23 2012 New Revision: 230568 URL: http://svn.freebsd.org/changeset/base/230568 Log: Disable integrity checks by default. It will warn users about found problems, but will not reject partition tables. This is direct commit to stable/8. Modified: stable/8/sys/geom/part/g_part.c Modified: stable/8/sys/geom/part/g_part.c ============================================================================== --- stable/8/sys/geom/part/g_part.c Thu Jan 26 08:47:29 2012 (r230567) +++ stable/8/sys/geom/part/g_part.c Thu Jan 26 08:51:23 2012 (r230568) @@ -107,10 +107,10 @@ struct g_part_alias_list { SYSCTL_DECL(_kern_geom); SYSCTL_NODE(_kern_geom, OID_AUTO, part, CTLFLAG_RW, 0, "GEOM_PART stuff"); -static u_int check_integrity = 1; +static u_int check_integrity = 0; TUNABLE_INT("kern.geom.part.check_integrity", &check_integrity); SYSCTL_UINT(_kern_geom_part, OID_AUTO, check_integrity, CTLFLAG_RW, - &check_integrity, 1, "Enable integrity checking"); + &check_integrity, 0, "Enable integrity checking"); /* * The GEOM partitioning class. From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 09:13:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75EE7106566C; Thu, 26 Jan 2012 09:13:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mail.kirov.so-ups.ru (mail.kirov.so-ups.ru [178.74.170.1]) by mx1.freebsd.org (Postfix) with ESMTP id 104C68FC13; Thu, 26 Jan 2012 09:13:29 +0000 (UTC) Received: from kas30pipe.localhost (localhost.kirov.so-ups.ru [127.0.0.1]) by mail.kirov.so-ups.ru (Postfix) with SMTP id 8242FB8024; Thu, 26 Jan 2012 12:58:17 +0400 (MSK) Received: from kirov.so-ups.ru (unknown [172.21.81.1]) by mail.kirov.so-ups.ru (Postfix) with ESMTP id 78273B801F; Thu, 26 Jan 2012 12:58:17 +0400 (MSK) Received: by ns.kirov.so-ups.ru (Postfix, from userid 1010) id 6E0E9B8FA4; Thu, 26 Jan 2012 12:58:17 +0400 (MSK) Received: from [127.0.0.1] (elsukov.kirov.oduur.so [10.118.3.52]) by ns.kirov.so-ups.ru (Postfix) with ESMTP id 34493B8F9E; Thu, 26 Jan 2012 12:58:17 +0400 (MSK) Message-ID: <4F2115A2.2010803@FreeBSD.org> Date: Thu, 26 Jan 2012 12:58:10 +0400 From: "Andrey V. Elsukov" User-Agent: Mozilla Thunderbird 1.5 (FreeBSD/20051231) MIME-Version: 1.0 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org References: <201201260851.q0Q8pO3f073097@svn.freebsd.org> In-Reply-To: <201201260851.q0Q8pO3f073097@svn.freebsd.org> X-Enigmail-Version: 1.3.4 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigAC6D67F83E2C0D98DF02A2DC" X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0284], KAS30/Release X-SpamTest-Info: Not protected Cc: Subject: Re: svn commit: r230568 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 09:13:30 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAC6D67F83E2C0D98DF02A2DC Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: quoted-printable On 26.01.2012 12:51, Andrey V. Elsukov wrote: > Author: ae > Date: Thu Jan 26 08:51:23 2012 > New Revision: 230568 > URL: http://svn.freebsd.org/changeset/base/230568 >=20 > Log: > Disable integrity checks by default. It will warn users about found > problems, but will not reject partition tables. Users may discover that their partition tables marked as corrupted. This will prevent modifying tables and write boot code, but probably this behavior should be disabled in 8-STABLE. Any opinions are welcome. --=20 WBR, Andrey V. Elsukov --------------enigAC6D67F83E2C0D98DF02A2DC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) iQEcBAEBAgAGBQJPIRWpAAoJEAHF6gQQyKF6XGIH/2GiDk6veIiE0MYVKze6hXuo xNEQHfatazbEff9q+EJGv81oN/4WqJ3ugvx2d+l/r7Ed6U6mTTtlytbK2xAgRpna GE3kueF7j6Hvc3JkMcNVqGHZPynJRmQG3BdrC0LeqrNmqRtBHnSAn3LU8rneXX+f jJ8LMTj4sEaxwsYtsO3oMRyo2gMV1X9ayZ4944ibW5CPk+UpF5YSlhLdu75xgqWw aEhSZyHMVgdFk2NdEl9UleK4T0dKiVm8Bf3qHIGjWDmYhjbBoxs14U0ZdCQ211is T5WLnaQZTt/H0+zmvvzUfw/PhJmpezTlT5FbP8rp7ayum4Q4zCFi2QRKqbmIDFM= =2T7L -----END PGP SIGNATURE----- --------------enigAC6D67F83E2C0D98DF02A2DC-- From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 09:14:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D0001065673; Thu, 26 Jan 2012 09:14:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0D2428FC08; Thu, 26 Jan 2012 09:14:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q9Ep09073975; Thu, 26 Jan 2012 09:14:51 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q9Epj9073973; Thu, 26 Jan 2012 09:14:51 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201201260914.q0Q9Epj9073973@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 26 Jan 2012 09:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230569 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 09:14:52 -0000 Author: ae Date: Thu Jan 26 09:14:51 2012 New Revision: 230569 URL: http://svn.freebsd.org/changeset/base/230569 Log: MFC r216132 (by ivoras): Add a note about the magic number 20. Actually, 22.75 entries fit in a 512 byte sector but when choosing magic numbers, 20 looks nicer. MFC r223332: Change the way how we update bootcode for BSD scheme. Since the only parameter that we check is size of bootcode, then allow only two sizes: size of boot1 and size of /boot/boot. This partially protects users from losing ability to boot if incorrect bootcode is specified. Modified: stable/8/sys/geom/part/g_part_bsd.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part_bsd.c ============================================================================== --- stable/8/sys/geom/part/g_part_bsd.c Thu Jan 26 08:51:23 2012 (r230568) +++ stable/8/sys/geom/part/g_part_bsd.c Thu Jan 26 09:14:51 2012 (r230569) @@ -45,6 +45,11 @@ __FBSDID("$FreeBSD$"); #include "g_part_if.h" +#define BOOT1_SIZE 512 +#define LABEL_SIZE 512 +#define BOOT2_OFF (BOOT1_SIZE + LABEL_SIZE) +#define BOOT2_SIZE (BBSIZE - BOOT2_OFF) + struct g_part_bsd_table { struct g_part_table base; u_char *bbarea; @@ -99,7 +104,7 @@ static struct g_part_scheme g_part_bsd_s sizeof(struct g_part_bsd_table), .gps_entrysz = sizeof(struct g_part_bsd_entry), .gps_minent = 8, - .gps_maxent = 20, + .gps_maxent = 20, /* Only 22 entries fit in 512 byte sectors */ .gps_bootcodesz = BBSIZE, }; G_PART_SCHEME_DECLARE(g_part_bsd); @@ -167,22 +172,16 @@ g_part_bsd_bootcode(struct g_part_table { struct g_part_bsd_table *table; const u_char *codeptr; - size_t hdsz, tlsz; - size_t codesz, tlofs; - hdsz = 512; - tlofs = hdsz + 148 + basetable->gpt_entries * 16; - tlsz = BBSIZE - tlofs; + if (gpp->gpp_codesize != BOOT1_SIZE && gpp->gpp_codesize != BBSIZE) + return (ENODEV); + table = (struct g_part_bsd_table *)basetable; - bzero(table->bbarea, hdsz); - bzero(table->bbarea + tlofs, tlsz); codeptr = gpp->gpp_codeptr; - codesz = MIN(hdsz, gpp->gpp_codesize); - if (codesz > 0) - bcopy(codeptr, table->bbarea, codesz); - codesz = MIN(tlsz, gpp->gpp_codesize - tlofs); - if (codesz > 0) - bcopy(codeptr + tlofs, table->bbarea + tlofs, codesz); + bcopy(codeptr, table->bbarea, BOOT1_SIZE); + if (gpp->gpp_codesize == BBSIZE) + bcopy(codeptr + BOOT2_OFF, table->bbarea + BOOT2_OFF, + BOOT2_SIZE); return (0); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 09:28:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5686E106566B; Thu, 26 Jan 2012 09:28:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26D7A8FC17; Thu, 26 Jan 2012 09:28:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q9SAWG074444; Thu, 26 Jan 2012 09:28:10 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q9SAkJ074442; Thu, 26 Jan 2012 09:28:10 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201201260928.q0Q9SAkJ074442@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 26 Jan 2012 09:28:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230570 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 09:28:10 -0000 Author: ae Date: Thu Jan 26 09:28:09 2012 New Revision: 230570 URL: http://svn.freebsd.org/changeset/base/230570 Log: MFC r222279: Do not truncate available disk space to the closest track boundary. MFC r222341: Some partitioning tools may have a different opinion about disk geometry and partitions may start from withing the first track. If we found such partitions, then do not reserve space of the first track, only first sector. Modified: stable/8/sys/geom/part/g_part_mbr.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part_mbr.c ============================================================================== --- stable/8/sys/geom/part/g_part_mbr.c Thu Jan 26 09:14:51 2012 (r230569) +++ stable/8/sys/geom/part/g_part_mbr.c Thu Jan 26 09:28:09 2012 (r230570) @@ -252,15 +252,14 @@ g_part_mbr_create(struct g_part_table *b { struct g_provider *pp; struct g_part_mbr_table *table; - uint32_t msize; pp = gpp->gpp_provider; if (pp->sectorsize < MBRSIZE) return (ENOSPC); - msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); basetable->gpt_first = basetable->gpt_sectors; - basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; + basetable->gpt_last = MIN(pp->mediasize / pp->sectorsize, + UINT32_MAX) - 1; table = (struct g_part_mbr_table *)basetable; le16enc(table->mbr + DOSMAGICOFFSET, DOSMAGIC); @@ -423,12 +422,13 @@ g_part_mbr_read(struct g_part_table *bas struct g_part_mbr_table *table; struct g_part_mbr_entry *entry; u_char *buf, *p; - off_t chs, msize; + off_t chs, msize, first; u_int sectors, heads; int error, index; pp = cp->provider; table = (struct g_part_mbr_table *)basetable; + first = basetable->gpt_sectors; msize = MIN(pp->mediasize / pp->sectorsize, UINT32_MAX); buf = g_read_data(cp, 0L, pp->sectorsize, &error); @@ -461,7 +461,8 @@ g_part_mbr_read(struct g_part_table *bas basetable->gpt_heads = heads; } } - + if (ent.dp_start < first) + first = ent.dp_start; entry = (struct g_part_mbr_entry *)g_part_new_entry(basetable, index + 1, ent.dp_start, ent.dp_start + ent.dp_size - 1); entry->ent = ent; @@ -469,7 +470,10 @@ g_part_mbr_read(struct g_part_table *bas basetable->gpt_entries = NDOSPART; basetable->gpt_first = basetable->gpt_sectors; - basetable->gpt_last = msize - (msize % basetable->gpt_sectors) - 1; + basetable->gpt_last = msize - 1; + + if (first < basetable->gpt_first) + basetable->gpt_first = 1; g_free(buf); return (0); From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 09:45:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61C00106564A; Thu, 26 Jan 2012 09:45:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 412BF8FC1A; Thu, 26 Jan 2012 09:45:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q9jEKl075022; Thu, 26 Jan 2012 09:45:14 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q9jEQV075018; Thu, 26 Jan 2012 09:45:14 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201260945.q0Q9jEQV075018@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Jan 2012 09:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230571 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 09:45:14 -0000 Author: mav Date: Thu Jan 26 09:45:14 2012 New Revision: 230571 URL: http://svn.freebsd.org/changeset/base/230571 Log: Add another bunch of CODEC IDs. Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Thu Jan 26 09:28:09 2012 (r230570) +++ head/sys/dev/sound/pci/hda/hdac.c Thu Jan 26 09:45:14 2012 (r230571) @@ -46,7 +46,7 @@ #include #include -#define HDA_DRV_TEST_REV "20120111_0001" +#define HDA_DRV_TEST_REV "20120126_0002" SND_DECLARE_FILE("$FreeBSD$"); Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Thu Jan 26 09:28:09 2012 (r230570) +++ head/sys/dev/sound/pci/hda/hdac.h Thu Jan 26 09:45:14 2012 (r230571) @@ -305,6 +305,8 @@ #define HDA_CODEC_ALC662 HDA_CODEC_CONSTRUCT(REALTEK, 0x0662) #define HDA_CODEC_ALC663 HDA_CODEC_CONSTRUCT(REALTEK, 0x0663) #define HDA_CODEC_ALC665 HDA_CODEC_CONSTRUCT(REALTEK, 0x0665) +#define HDA_CODEC_ALC670 HDA_CODEC_CONSTRUCT(REALTEK, 0x0670) +#define HDA_CODEC_ALC680 HDA_CODEC_CONSTRUCT(REALTEK, 0x0680) #define HDA_CODEC_ALC861 HDA_CODEC_CONSTRUCT(REALTEK, 0x0861) #define HDA_CODEC_ALC861VD HDA_CODEC_CONSTRUCT(REALTEK, 0x0862) #define HDA_CODEC_ALC880 HDA_CODEC_CONSTRUCT(REALTEK, 0x0880) @@ -318,6 +320,18 @@ #define HDA_CODEC_ALC899 HDA_CODEC_CONSTRUCT(REALTEK, 0x0899) #define HDA_CODEC_ALCXXXX HDA_CODEC_CONSTRUCT(REALTEK, 0xffff) +/* Motorolla */ +#define MOTO_VENDORID 0x1057 +#define HDA_CODEC_MOTOXXXX HDA_CODEC_CONSTRUCT(MOTO, 0xffff) + +/* Creative */ +#define CREATIVE_VENDORID 0x1102 +#define HDA_CODEC_CA0110 HDA_CODEC_CONSTRUCT(CREATIVE, 0x000a) +#define HDA_CODEC_CA0110_2 HDA_CODEC_CONSTRUCT(CREATIVE, 0x000b) +#define HDA_CODEC_SB0880 HDA_CODEC_CONSTRUCT(CREATIVE, 0x000d) +#define HDA_CODEC_CA0132 HDA_CODEC_CONSTRUCT(CREATIVE, 0x0011) +#define HDA_CODEC_CAXXXX HDA_CODEC_CONSTRUCT(CREATIVE, 0xffff) + /* Analog Devices */ #define ANALOGDEVICES_VENDORID 0x11d4 #define HDA_CODEC_AD1884A HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0x184a) @@ -339,10 +353,14 @@ #define HDA_CODEC_ADXXXX HDA_CODEC_CONSTRUCT(ANALOGDEVICES, 0xffff) /* CMedia */ -#define CMEDIA_VENDORID 0x434d -#define HDA_CODEC_CMI9880 HDA_CODEC_CONSTRUCT(CMEDIA, 0x4980) +#define CMEDIA_VENDORID 0x13f6 +#define HDA_CODEC_CMI9880 HDA_CODEC_CONSTRUCT(CMEDIA, 0x9880) #define HDA_CODEC_CMIXXXX HDA_CODEC_CONSTRUCT(CMEDIA, 0xffff) +#define CMEDIA2_VENDORID 0x434d +#define HDA_CODEC_CMI98802 HDA_CODEC_CONSTRUCT(CMEDIA2, 0x4980) +#define HDA_CODEC_CMIXXXX2 HDA_CODEC_CONSTRUCT(CMEDIA2, 0xffff) + /* Sigmatel */ #define SIGMATEL_VENDORID 0x8384 #define HDA_CODEC_STAC9230X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7612) @@ -384,6 +402,10 @@ #define HDA_CODEC_STAC9205D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a1) #define HDA_CODEC_STAC9204X HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a2) #define HDA_CODEC_STAC9204D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a3) +#define HDA_CODEC_STAC9255 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a4) +#define HDA_CODEC_STAC9255D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a5) +#define HDA_CODEC_STAC9254 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a6) +#define HDA_CODEC_STAC9254D HDA_CODEC_CONSTRUCT(SIGMATEL, 0x76a7) #define HDA_CODEC_STAC9220_A2 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7880) #define HDA_CODEC_STAC9220_A1 HDA_CODEC_CONSTRUCT(SIGMATEL, 0x7882) #define HDA_CODEC_STACXXXX HDA_CODEC_CONSTRUCT(SIGMATEL, 0xffff) @@ -398,10 +420,49 @@ #define HDA_CODEC_IDT92HD73C1 HDA_CODEC_CONSTRUCT(IDT, 0x7675) #define HDA_CODEC_IDT92HD73E1 HDA_CODEC_CONSTRUCT(IDT, 0x7676) #define HDA_CODEC_IDT92HD71B8 HDA_CODEC_CONSTRUCT(IDT, 0x76b0) +#define HDA_CODEC_IDT92HD71B8_2 HDA_CODEC_CONSTRUCT(IDT, 0x76b1) #define HDA_CODEC_IDT92HD71B7 HDA_CODEC_CONSTRUCT(IDT, 0x76b2) +#define HDA_CODEC_IDT92HD71B7_2 HDA_CODEC_CONSTRUCT(IDT, 0x76b3) +#define HDA_CODEC_IDT92HD71B6 HDA_CODEC_CONSTRUCT(IDT, 0x76b4) +#define HDA_CODEC_IDT92HD71B6_2 HDA_CODEC_CONSTRUCT(IDT, 0x76b5) #define HDA_CODEC_IDT92HD71B5 HDA_CODEC_CONSTRUCT(IDT, 0x76b6) +#define HDA_CODEC_IDT92HD71B5_2 HDA_CODEC_CONSTRUCT(IDT, 0x76b7) +#define HDA_CODEC_IDT92HD89C3 HDA_CODEC_CONSTRUCT(IDT, 0x76c0) +#define HDA_CODEC_IDT92HD89C2 HDA_CODEC_CONSTRUCT(IDT, 0x76c1) +#define HDA_CODEC_IDT92HD89C1 HDA_CODEC_CONSTRUCT(IDT, 0x76c2) +#define HDA_CODEC_IDT92HD89B3 HDA_CODEC_CONSTRUCT(IDT, 0x76c3) +#define HDA_CODEC_IDT92HD89B2 HDA_CODEC_CONSTRUCT(IDT, 0x76c4) +#define HDA_CODEC_IDT92HD89B1 HDA_CODEC_CONSTRUCT(IDT, 0x76c5) +#define HDA_CODEC_IDT92HD89E3 HDA_CODEC_CONSTRUCT(IDT, 0x76c6) +#define HDA_CODEC_IDT92HD89E2 HDA_CODEC_CONSTRUCT(IDT, 0x76c7) +#define HDA_CODEC_IDT92HD89E1 HDA_CODEC_CONSTRUCT(IDT, 0x76c8) +#define HDA_CODEC_IDT92HD89D3 HDA_CODEC_CONSTRUCT(IDT, 0x76c9) +#define HDA_CODEC_IDT92HD89D2 HDA_CODEC_CONSTRUCT(IDT, 0x76ca) +#define HDA_CODEC_IDT92HD89D1 HDA_CODEC_CONSTRUCT(IDT, 0x76cb) +#define HDA_CODEC_IDT92HD89F3 HDA_CODEC_CONSTRUCT(IDT, 0x76cc) +#define HDA_CODEC_IDT92HD89F2 HDA_CODEC_CONSTRUCT(IDT, 0x76cd) +#define HDA_CODEC_IDT92HD89F1 HDA_CODEC_CONSTRUCT(IDT, 0x76ce) +#define HDA_CODEC_IDT92HD87B1_3 HDA_CODEC_CONSTRUCT(IDT, 0x76d1) #define HDA_CODEC_IDT92HD83C1C HDA_CODEC_CONSTRUCT(IDT, 0x76d4) #define HDA_CODEC_IDT92HD81B1C HDA_CODEC_CONSTRUCT(IDT, 0x76d5) +#define HDA_CODEC_IDT92HD87B2_4 HDA_CODEC_CONSTRUCT(IDT, 0x76d9) +#define HDA_CODEC_IDT92HD93BXX HDA_CODEC_CONSTRUCT(IDT, 0x76df) +#define HDA_CODEC_IDT92HD91BXX HDA_CODEC_CONSTRUCT(IDT, 0x76e0) +#define HDA_CODEC_IDT92HD98BXX HDA_CODEC_CONSTRUCT(IDT, 0x76e3) +#define HDA_CODEC_IDT92HD99BXX HDA_CODEC_CONSTRUCT(IDT, 0x76e5) +#define HDA_CODEC_IDT92HD90BXX HDA_CODEC_CONSTRUCT(IDT, 0x76e7) +#define HDA_CODEC_IDT92HD66B1X5 HDA_CODEC_CONSTRUCT(IDT, 0x76e8) +#define HDA_CODEC_IDT92HD66B2X5 HDA_CODEC_CONSTRUCT(IDT, 0x76e9) +#define HDA_CODEC_IDT92HD66B3X5 HDA_CODEC_CONSTRUCT(IDT, 0x76ea) +#define HDA_CODEC_IDT92HD66C1X5 HDA_CODEC_CONSTRUCT(IDT, 0x76eb) +#define HDA_CODEC_IDT92HD66C2X5 HDA_CODEC_CONSTRUCT(IDT, 0x76ec) +#define HDA_CODEC_IDT92HD66C3X5 HDA_CODEC_CONSTRUCT(IDT, 0x76ed) +#define HDA_CODEC_IDT92HD66B1X3 HDA_CODEC_CONSTRUCT(IDT, 0x76ee) +#define HDA_CODEC_IDT92HD66B2X3 HDA_CODEC_CONSTRUCT(IDT, 0x76ef) +#define HDA_CODEC_IDT92HD66B3X3 HDA_CODEC_CONSTRUCT(IDT, 0x76f0) +#define HDA_CODEC_IDT92HD66C1X3 HDA_CODEC_CONSTRUCT(IDT, 0x76f1) +#define HDA_CODEC_IDT92HD66C2X3 HDA_CODEC_CONSTRUCT(IDT, 0x76f2) +#define HDA_CODEC_IDT92HD66C3_65 HDA_CODEC_CONSTRUCT(IDT, 0x76f3) #define HDA_CODEC_IDTXXXX HDA_CODEC_CONSTRUCT(IDT, 0xffff) /* Silicon Image */ @@ -495,7 +556,9 @@ /* NVIDIA */ #define HDA_CODEC_NVIDIAMCP78 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0002) -#define HDA_CODEC_NVIDIAMCP78_2 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0006) +#define HDA_CODEC_NVIDIAMCP78_2 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0003) +#define HDA_CODEC_NVIDIAMCP78_3 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0005) +#define HDA_CODEC_NVIDIAMCP78_4 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0006) #define HDA_CODEC_NVIDIAMCP7A HDA_CODEC_CONSTRUCT(NVIDIA, 0x0007) #define HDA_CODEC_NVIDIAGT220 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000a) #define HDA_CODEC_NVIDIAGT21X HDA_CODEC_CONSTRUCT(NVIDIA, 0x000b) @@ -505,6 +568,10 @@ #define HDA_CODEC_NVIDIAMCP73 HDA_CODEC_CONSTRUCT(NVIDIA, 0x8001) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) +/* Chrontel */ +#define CHRONTEL_VENDORID 0x17e8 +#define HDA_CODEC_CHXXXX HDA_CODEC_CONSTRUCT(CHRONTEL, 0xffff) + /* INTEL */ #define HDA_CODEC_INTELIP HDA_CODEC_CONSTRUCT(INTEL, 0x0054) #define HDA_CODEC_INTELBL HDA_CODEC_CONSTRUCT(INTEL, 0x2801) Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Thu Jan 26 09:28:09 2012 (r230570) +++ head/sys/dev/sound/pci/hda/hdacc.c Thu Jan 26 09:45:14 2012 (r230571) @@ -92,6 +92,8 @@ static const struct { { HDA_CODEC_ALC662, 0, "Realtek ALC662" }, { HDA_CODEC_ALC663, 0, "Realtek ALC663" }, { HDA_CODEC_ALC665, 0, "Realtek ALC665" }, + { HDA_CODEC_ALC670, 0, "Realtek ALC670" }, + { HDA_CODEC_ALC680, 0, "Realtek ALC680" }, { HDA_CODEC_ALC861, 0x0340, "Realtek ALC660" }, { HDA_CODEC_ALC861, 0, "Realtek ALC861" }, { HDA_CODEC_ALC861VD, 0, "Realtek ALC861-VD" }, @@ -123,7 +125,12 @@ static const struct { { HDA_CODEC_AD1988B, 0, "Analog Devices AD1988B" }, { HDA_CODEC_AD1989A, 0, "Analog Devices AD1989A" }, { HDA_CODEC_AD1989B, 0, "Analog Devices AD1989B" }, + { HDA_CODEC_CA0110, 0, "Creative CA0110-IBG" }, + { HDA_CODEC_CA0110_2, 0, "Creative CA0110-IBG" }, + { HDA_CODEC_CA0132, 0, "Creative CA0132" }, + { HDA_CODEC_SB0880, 0, "Creative SB0880 X-Fi" }, { HDA_CODEC_CMI9880, 0, "CMedia CMI9880" }, + { HDA_CODEC_CMI98802, 0, "CMedia CMI9880" }, { HDA_CODEC_CXD9872RDK, 0, "Sigmatel CXD9872RD/K" }, { HDA_CODEC_CXD9872AKD, 0, "Sigmatel CXD9872AKD" }, { HDA_CODEC_STAC9200D, 0, "Sigmatel STAC9200D" }, @@ -148,6 +155,10 @@ static const struct { { HDA_CODEC_STAC9230D, 0, "Sigmatel STAC9230D" }, { HDA_CODEC_STAC9250, 0, "Sigmatel STAC9250" }, { HDA_CODEC_STAC9251, 0, "Sigmatel STAC9251" }, + { HDA_CODEC_STAC9255, 0, "Sigmatel STAC9255" }, + { HDA_CODEC_STAC9255D, 0, "Sigmatel STAC9255D" }, + { HDA_CODEC_STAC9254, 0, "Sigmatel STAC9254" }, + { HDA_CODEC_STAC9254D, 0, "Sigmatel STAC9254D" }, { HDA_CODEC_STAC9271X, 0, "Sigmatel STAC9271X" }, { HDA_CODEC_STAC9271D, 0, "Sigmatel STAC9271D" }, { HDA_CODEC_STAC9272X, 0, "Sigmatel STAC9272X" }, @@ -163,11 +174,28 @@ static const struct { { HDA_CODEC_IDT92HD005D, 0, "IDT 92HD005D" }, { HDA_CODEC_IDT92HD206X, 0, "IDT 92HD206X" }, { HDA_CODEC_IDT92HD206D, 0, "IDT 92HD206D" }, + { HDA_CODEC_IDT92HD66B1X5, 0, "IDT 92HD66B1X5" }, + { HDA_CODEC_IDT92HD66B2X5, 0, "IDT 92HD66B2X5" }, + { HDA_CODEC_IDT92HD66B3X5, 0, "IDT 92HD66B3X5" }, + { HDA_CODEC_IDT92HD66C1X5, 0, "IDT 92HD66C1X5" }, + { HDA_CODEC_IDT92HD66C2X5, 0, "IDT 92HD66C2X5" }, + { HDA_CODEC_IDT92HD66C3X5, 0, "IDT 92HD66C3X5" }, + { HDA_CODEC_IDT92HD66B1X3, 0, "IDT 92HD66B1X3" }, + { HDA_CODEC_IDT92HD66B2X3, 0, "IDT 92HD66B2X3" }, + { HDA_CODEC_IDT92HD66B3X3, 0, "IDT 92HD66B3X3" }, + { HDA_CODEC_IDT92HD66C1X3, 0, "IDT 92HD66C1X3" }, + { HDA_CODEC_IDT92HD66C2X3, 0, "IDT 92HD66C2X3" }, + { HDA_CODEC_IDT92HD66C3_65, 0, "IDT 92HD66C3_65" }, { HDA_CODEC_IDT92HD700X, 0, "IDT 92HD700X" }, { HDA_CODEC_IDT92HD700D, 0, "IDT 92HD700D" }, { HDA_CODEC_IDT92HD71B5, 0, "IDT 92HD71B5" }, + { HDA_CODEC_IDT92HD71B5_2, 0, "IDT 92HD71B5" }, + { HDA_CODEC_IDT92HD71B6, 0, "IDT 92HD71B6" }, + { HDA_CODEC_IDT92HD71B6_2, 0, "IDT 92HD71B6" }, { HDA_CODEC_IDT92HD71B7, 0, "IDT 92HD71B7" }, + { HDA_CODEC_IDT92HD71B7_2, 0, "IDT 92HD71B7" }, { HDA_CODEC_IDT92HD71B8, 0, "IDT 92HD71B8" }, + { HDA_CODEC_IDT92HD71B8_2, 0, "IDT 92HD71B8" }, { HDA_CODEC_IDT92HD73C1, 0, "IDT 92HD73C1" }, { HDA_CODEC_IDT92HD73D1, 0, "IDT 92HD73D1" }, { HDA_CODEC_IDT92HD73E1, 0, "IDT 92HD73E1" }, @@ -177,6 +205,28 @@ static const struct { { HDA_CODEC_IDT92HD81B1X, 0, "IDT 92HD81B1X" }, { HDA_CODEC_IDT92HD83C1C, 0, "IDT 92HD83C1C" }, { HDA_CODEC_IDT92HD83C1X, 0, "IDT 92HD83C1X" }, + { HDA_CODEC_IDT92HD87B1_3, 0, "IDT 92HD87B1/3" }, + { HDA_CODEC_IDT92HD87B2_4, 0, "IDT 92HD87B2/4" }, + { HDA_CODEC_IDT92HD89C3, 0, "IDT 92HD89C3" }, + { HDA_CODEC_IDT92HD89C2, 0, "IDT 92HD89C2" }, + { HDA_CODEC_IDT92HD89C1, 0, "IDT 92HD89C1" }, + { HDA_CODEC_IDT92HD89B3, 0, "IDT 92HD89B3" }, + { HDA_CODEC_IDT92HD89B2, 0, "IDT 92HD89B2" }, + { HDA_CODEC_IDT92HD89B1, 0, "IDT 92HD89B1" }, + { HDA_CODEC_IDT92HD89E3, 0, "IDT 92HD89E3" }, + { HDA_CODEC_IDT92HD89E2, 0, "IDT 92HD89E2" }, + { HDA_CODEC_IDT92HD89E1, 0, "IDT 92HD89E1" }, + { HDA_CODEC_IDT92HD89D3, 0, "IDT 92HD89D3" }, + { HDA_CODEC_IDT92HD89D2, 0, "IDT 92HD89D2" }, + { HDA_CODEC_IDT92HD89D1, 0, "IDT 92HD89D1" }, + { HDA_CODEC_IDT92HD89F3, 0, "IDT 92HD89F3" }, + { HDA_CODEC_IDT92HD89F2, 0, "IDT 92HD89F2" }, + { HDA_CODEC_IDT92HD89F1, 0, "IDT 92HD89F1" }, + { HDA_CODEC_IDT92HD90BXX, 0, "IDT 92HD90BXX" }, + { HDA_CODEC_IDT92HD91BXX, 0, "IDT 92HD91BXX" }, + { HDA_CODEC_IDT92HD93BXX, 0, "IDT 92HD93BXX" }, + { HDA_CODEC_IDT92HD98BXX, 0, "IDT 92HD98BXX" }, + { HDA_CODEC_IDT92HD99BXX, 0, "IDT 92HD99BXX" }, { HDA_CODEC_CX20549, 0, "Conexant CX20549 (Venice)" }, { HDA_CODEC_CX20551, 0, "Conexant CX20551 (Waikiki)" }, { HDA_CODEC_CX20561, 0, "Conexant CX20561 (Hermosa)" }, @@ -250,6 +300,8 @@ static const struct { { HDA_CODEC_NVIDIAMCP73, 0, "NVIDIA MCP73" }, { HDA_CODEC_NVIDIAMCP78, 0, "NVIDIA MCP78" }, { HDA_CODEC_NVIDIAMCP78_2, 0, "NVIDIA MCP78" }, + { HDA_CODEC_NVIDIAMCP78_3, 0, "NVIDIA MCP78" }, + { HDA_CODEC_NVIDIAMCP78_4, 0, "NVIDIA MCP78" }, { HDA_CODEC_NVIDIAMCP7A, 0, "NVIDIA MCP7A" }, { HDA_CODEC_NVIDIAGT220, 0, "NVIDIA GT220" }, { HDA_CODEC_NVIDIAGT21X, 0, "NVIDIA GT21x" }, @@ -266,19 +318,23 @@ static const struct { { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, /* Unknown CODECs */ - { HDA_CODEC_ALCXXXX, 0, "Realtek" }, { HDA_CODEC_ADXXXX, 0, "Analog Devices" }, - { HDA_CODEC_CSXXXX, 0, "Cirrus Logic" }, - { HDA_CODEC_CMIXXXX, 0, "CMedia" }, - { HDA_CODEC_STACXXXX, 0, "Sigmatel" }, - { HDA_CODEC_SIIXXXX, 0, "Silicon Image" }, { HDA_CODEC_AGEREXXXX, 0, "Lucent/Agere Systems" }, - { HDA_CODEC_CXXXXX, 0, "Conexant" }, - { HDA_CODEC_VTXXXX, 0, "VIA" }, + { HDA_CODEC_ALCXXXX, 0, "Realtek" }, { HDA_CODEC_ATIXXXX, 0, "ATI" }, - { HDA_CODEC_NVIDIAXXXX, 0, "NVIDIA" }, - { HDA_CODEC_INTELXXXX, 0, "Intel" }, + { HDA_CODEC_CAXXXX, 0, "Creative" }, + { HDA_CODEC_CMIXXXX, 0, "CMedia" }, + { HDA_CODEC_CMIXXXX2, 0, "CMedia" }, + { HDA_CODEC_CSXXXX, 0, "Cirrus Logic" }, + { HDA_CODEC_CXXXXX, 0, "Conexant" }, + { HDA_CODEC_CHXXXX, 0, "Chrontel" }, { HDA_CODEC_IDTXXXX, 0, "IDT" }, + { HDA_CODEC_INTELXXXX, 0, "Intel" }, + { HDA_CODEC_MOTOXXXX, 0, "Motorolla" }, + { HDA_CODEC_NVIDIAXXXX, 0, "NVIDIA" }, + { HDA_CODEC_SIIXXXX, 0, "Silicon Image" }, + { HDA_CODEC_STACXXXX, 0, "Sigmatel" }, + { HDA_CODEC_VTXXXX, 0, "VIA" }, }; #define HDACC_CODECS_LEN (sizeof(hdacc_codecs) / sizeof(hdacc_codecs[0])) From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 09:55:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 923DA1065670; Thu, 26 Jan 2012 09:55:16 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CAC48FC15; Thu, 26 Jan 2012 09:55:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q9tGPo075358; Thu, 26 Jan 2012 09:55:16 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q9tG1m075353; Thu, 26 Jan 2012 09:55:16 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201260955.q0Q9tG1m075353@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 26 Jan 2012 09:55:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230572 - in head/sys/dev: ixgbe netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 09:55:16 -0000 Author: luigi Date: Thu Jan 26 09:55:16 2012 New Revision: 230572 URL: http://svn.freebsd.org/changeset/base/230572 Log: ixgbe changes: - remove experimental code for disabling CRC - use the correct constant for conversion between interrupt rate and EITR values (the previous values were off by a factor of 2) - make dev.ix.N.queueM.interrupt_rate a RW sysctl variable. Changing individual values affects the queue immediately, and propagates to all interfaces at the next reinit. - add dev.ix.N.queueM.irqs rdonly sysctl, to export the actual interrupt counts Netmap-related changes for ixgbe: - use the "new" format for TX descriptors in netmap mode. - pass interrupt mitigation delays to the user process doing poll() on a netmap file descriptor. On the RX side this means we will not check the ring more than once per interrupt. This gives the process a chance to sleep and process packets in larger batches, thus reducing CPU usage. On the TX side we take this even further: completed transmissions are reclaimed every half ring even if the NIC interrupts more often. This saves even more CPU without any additional tx delays. Generic Netmap-related changes: - align the netmap_kring to cache lines so that there is no false sharing (possibly useful for multiqueue NICs and MSIX interrupts, which are handled by different cores). It's a minor improvement but it does not cost anything. Reviewed by: Jack Vogel Approved by: Jack Vogel Modified: head/sys/dev/ixgbe/ixgbe.c head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Thu Jan 26 09:45:14 2012 (r230571) +++ head/sys/dev/ixgbe/ixgbe.c Thu Jan 26 09:55:16 2012 (r230572) @@ -232,7 +232,7 @@ MODULE_DEPEND(ixgbe, ether, 1, 1, 1); static int ixgbe_enable_aim = TRUE; TUNABLE_INT("hw.ixgbe.enable_aim", &ixgbe_enable_aim); -static int ixgbe_max_interrupt_rate = (8000000 / IXGBE_LOW_LATENCY); +static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY); TUNABLE_INT("hw.ixgbe.max_interrupt_rate", &ixgbe_max_interrupt_rate); /* How many packets rxeof tries to clean at a time */ @@ -3385,22 +3385,41 @@ ixgbe_txeof(struct tx_ring *txr) #ifdef DEV_NETMAP if (ifp->if_capenable & IFCAP_NETMAP) { struct netmap_adapter *na = NA(ifp); + struct netmap_kring *kring = &na->tx_rings[txr->me]; + tx_desc = (struct ixgbe_legacy_tx_desc *)txr->tx_base; + + bus_dmamap_sync(txr->txdma.dma_tag, txr->txdma.dma_map, + BUS_DMASYNC_POSTREAD); /* * In netmap mode, all the work is done in the context * of the client thread. Interrupt handlers only wake up * clients, which may be sleeping on individual rings * or on a global resource for all rings. + * To implement tx interrupt mitigation, we wake up the client + * thread roughly every half ring, even if the NIC interrupts + * more frequently. This is implemented as follows: + * - ixgbe_txsync() sets kring->nr_kflags with the index of + * the slot that should wake up the thread (nkr_num_slots + * means the user thread should not be woken up); + * - the driver ignores tx interrupts unless netmap_mitigate=0 + * or the slot has the DD bit set. + * * When the driver has separate locks, we need to * release and re-acquire txlock to avoid deadlocks. * XXX see if we can find a better way. */ - selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); - IXGBE_TX_UNLOCK(txr); - IXGBE_CORE_LOCK(adapter); - selwakeuppri(&na->tx_rings[na->num_queues + 1].si, PI_NET); - IXGBE_CORE_UNLOCK(adapter); - IXGBE_TX_LOCK(txr); + if (!netmap_mitigate || + (kring->nr_kflags < kring->nkr_num_slots && + tx_desc[kring->nr_kflags].upper.fields.status & IXGBE_TXD_STAT_DD)) { + kring->nr_kflags = kring->nkr_num_slots; + selwakeuppri(&na->tx_rings[txr->me].si, PI_NET); + IXGBE_TX_UNLOCK(txr); + IXGBE_CORE_LOCK(adapter); + selwakeuppri(&na->tx_rings[na->num_queues + 1].si, PI_NET); + IXGBE_CORE_UNLOCK(adapter); + IXGBE_TX_LOCK(txr); + } return FALSE; } #endif /* DEV_NETMAP */ @@ -3928,21 +3947,6 @@ skip_head: lro->ifp = adapter->ifp; } -#ifdef DEV_NETMAP1 /* XXX experimental CRC strip */ - { - struct ixgbe_hw *hw = &adapter->hw; - u32 rdrxctl; - - rdrxctl = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); - rdrxctl &= ~IXGBE_RDRXCTL_RSCFRSTSIZE; - if (slot) - rdrxctl &= ~IXGBE_RDRXCTL_CRCSTRIP; - else - rdrxctl |= IXGBE_RDRXCTL_CRCSTRIP; - rdrxctl |= IXGBE_RDRXCTL_RSCACKC; - IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl); - } -#endif /* DEV_NETMAP1 */ IXGBE_RX_UNLOCK(rxr); return (0); @@ -4022,12 +4026,6 @@ ixgbe_initialize_receive_units(struct ad hlreg |= IXGBE_HLREG0_JUMBOEN; else hlreg &= ~IXGBE_HLREG0_JUMBOEN; -#ifdef DEV_NETMAP1 /* XXX experimental CRCSTRIP */ - if (ifp->if_capenable & IFCAP_NETMAP) - hlreg &= ~IXGBE_HLREG0_RXCRCSTRP; - else - hlreg |= IXGBE_HLREG0_RXCRCSTRP; -#endif /* DEV_NETMAP1 */ IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); bufsz = (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; @@ -4297,11 +4295,14 @@ ixgbe_rxeof(struct ix_queue *que, int co #ifdef DEV_NETMAP if (ifp->if_capenable & IFCAP_NETMAP) { /* - * Same as the txeof routine, only wakeup clients - * and make sure there are no deadlocks. + * Same as the txeof routine: only wakeup clients on intr. + * NKR_PENDINTR in nr_kflags is used to implement interrupt + * mitigation (ixgbe_rxsync() will not look for new packets + * unless NKR_PENDINTR is set). */ struct netmap_adapter *na = NA(ifp); + na->rx_rings[rxr->me].nr_kflags |= NKR_PENDINTR; selwakeuppri(&na->rx_rings[rxr->me].si, PI_NET); IXGBE_RX_UNLOCK(rxr); IXGBE_CORE_LOCK(adapter); @@ -4830,7 +4831,7 @@ ixgbe_configure_ivars(struct adapter *ad u32 newitr; if (ixgbe_max_interrupt_rate > 0) - newitr = (8000000 / ixgbe_max_interrupt_rate) & 0x0FF8; + newitr = (4000000 / ixgbe_max_interrupt_rate) & 0x0FF8; else newitr = 0; @@ -5193,12 +5194,21 @@ ixgbe_sysctl_interrupt_rate_handler(SYSC reg = IXGBE_READ_REG(&que->adapter->hw, IXGBE_EITR(que->msix)); usec = ((reg & 0x0FF8) >> 3); if (usec > 0) - rate = 1000000 / usec; + rate = 500000 / usec; else rate = 0; error = sysctl_handle_int(oidp, &rate, 0, req); if (error || !req->newptr) return error; + reg &= ~0xfff; /* default, no limitation */ + ixgbe_max_interrupt_rate = 0; + if (rate > 0 && rate < 500000) { + if (rate < 1000) + rate = 1000; + ixgbe_max_interrupt_rate = rate; + reg |= ((4000000/rate) & 0xff8 ); + } + IXGBE_WRITE_REG(&que->adapter->hw, IXGBE_EITR(que->msix), reg); return 0; } @@ -5252,10 +5262,13 @@ ixgbe_add_hw_stats(struct adapter *adapt queue_list = SYSCTL_CHILDREN(queue_node); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "interrupt_rate", - CTLTYPE_UINT | CTLFLAG_RD, &adapter->queues[i], + CTLTYPE_UINT | CTLFLAG_RW, &adapter->queues[i], sizeof(&adapter->queues[i]), ixgbe_sysctl_interrupt_rate_handler, "IU", "Interrupt Rate"); + SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "irqs", + CTLFLAG_RD, &(adapter->queues[i].irqs), + "irqs on this queue"); SYSCTL_ADD_PROC(ctx, queue_list, OID_AUTO, "txd_head", CTLTYPE_UINT | CTLFLAG_RD, txr, sizeof(txr), ixgbe_sysctl_tdh_handler, "IU", Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Thu Jan 26 09:45:14 2012 (r230571) +++ head/sys/dev/netmap/ixgbe_netmap.h Thu Jan 26 09:55:16 2012 (r230572) @@ -191,6 +191,10 @@ fail: * (this is also true for every use of ring in the kernel). * * ring->avail is never used, only checked for bogus values. + * + * do_lock is set iff the function is called from the ioctl handler. + * In this case, grab a lock around the body, and also reclaim transmitted + * buffers irrespective of interrupt mitigation. */ static int ixgbe_netmap_txsync(void *a, u_int ring_nr, int do_lock) @@ -292,10 +296,11 @@ ring_reset: * need this. */ curr->read.buffer_addr = htole64(paddr); - curr->read.olinfo_status = 0; + curr->read.olinfo_status = htole32(len << IXGBE_ADVTXD_PAYLEN_SHIFT); curr->read.cmd_type_len = htole32(txr->txd_cmd | len | (IXGBE_ADVTXD_DTYP_DATA | + IXGBE_ADVTXD_DCMD_DEXT | IXGBE_ADVTXD_DCMD_IFCS | IXGBE_TXD_CMD_EOP | flags) ); /* If the buffer has changed, unload and reload map @@ -328,15 +333,41 @@ ring_reset: } /* - * If no packets are sent, or there is no room in the tx ring, - * Check whether there are completed transmissions. - * Because this is expensive (we need a register etc.) - * we only do it if absolutely necessary, i.e. there is no room - * in the tx ring, or where were no completed transmissions - * (meaning that probably the caller really wanted to check - * for completed transmissions). + * Reclaim buffers for completed transmissions. + * Because this is expensive (we read a NIC register etc.) + * we only do it in specific cases (see below). + * In all cases kring->nr_kflags indicates which slot will be + * checked upon a tx interrupt (nkr_num_slots means none). */ - if (n == 0 || kring->nr_hwavail < 1) { + if (do_lock) { + j = 1; /* forced reclaim, ignore interrupts */ + kring->nr_kflags = kring->nkr_num_slots; + } else if (kring->nr_hwavail > 0) { + j = 0; /* buffers still available: no reclaim, ignore intr. */ + kring->nr_kflags = kring->nkr_num_slots; + } else { + /* + * no buffers available, locate a slot for which we request + * ReportStatus (approximately half ring after next_to_clean) + * and record it in kring->nr_kflags. + * If the slot has DD set, do the reclaim looking at TDH, + * otherwise we go to sleep (in netmap_poll()) and will be + * woken up when slot nr_kflags will be ready. + */ + struct ixgbe_legacy_tx_desc *txd = (struct ixgbe_legacy_tx_desc *)txr->tx_base; + + j = txr->next_to_clean + kring->nkr_num_slots/2; + if (j >= kring->nkr_num_slots) + j -= kring->nkr_num_slots; + // round to the closest with dd set + j= (j < kring->nkr_num_slots / 4 || j >= kring->nkr_num_slots*3/4) ? + 0 : report_frequency; + kring->nr_kflags = j; /* the slot to check */ + j = txd[j].upper.fields.status & IXGBE_TXD_STAT_DD; + } + if (!j) { + netmap_skip_txsync++; + } else { int delta; /* @@ -391,6 +422,8 @@ ring_reset: * We must subtract the newly consumed slots (cur - nr_hwcur) * from nr_hwavail, make the descriptors available for the next reads, * and set kring->nr_hwcur = ring->cur and ring->avail = kring->nr_hwavail. + * + * do_lock has a special meaning: please refer to txsync. */ static int ixgbe_netmap_rxsync(void *a, u_int ring_nr, int do_lock) @@ -401,6 +434,7 @@ ixgbe_netmap_rxsync(void *a, u_int ring_ struct netmap_kring *kring = &na->rx_rings[ring_nr]; struct netmap_ring *ring = kring->ring; int j, k, l, n, lim = kring->nkr_num_slots - 1; + int force_update = do_lock || kring->nr_kflags & NKR_PENDINTR; k = ring->cur; /* cache and check value, same as in txsync */ n = k - kring->nr_hwcur; @@ -437,6 +471,7 @@ ixgbe_netmap_rxsync(void *a, u_int ring_ if (j > lim) j -= lim + 1; + if (force_update) { for (n = 0; ; n++) { union ixgbe_adv_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->wb.upper.status_error); @@ -453,6 +488,8 @@ ixgbe_netmap_rxsync(void *a, u_int ring_ rxr->next_to_check = l; kring->nr_hwavail += n; } + kring->nr_kflags &= ~NKR_PENDINTR; + } /* * Skip past packets that userspace has already processed Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Thu Jan 26 09:45:14 2012 (r230571) +++ head/sys/dev/netmap/netmap.c Thu Jan 26 09:55:16 2012 (r230572) @@ -146,6 +146,12 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, total_ CTLFLAG_RD, &nm_buf_pool.total_buffers, 0, "total_buffers"); SYSCTL_INT(_dev_netmap, OID_AUTO, free_buffers, CTLFLAG_RD, &nm_buf_pool.free, 0, "free_buffers"); +int netmap_mitigate = 1; +SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); +int netmap_skip_txsync; +SYSCTL_INT(_dev_netmap, OID_AUTO, skip_txsync, CTLFLAG_RW, &netmap_skip_txsync, 0, ""); +int netmap_skip_rxsync; +SYSCTL_INT(_dev_netmap, OID_AUTO, skip_rxsync, CTLFLAG_RW, &netmap_skip_rxsync, 0, ""); /* * Allocate n buffers from the ring, and fill the slot. Modified: head/sys/dev/netmap/netmap_kern.h ============================================================================== --- head/sys/dev/netmap/netmap_kern.h Thu Jan 26 09:45:14 2012 (r230571) +++ head/sys/dev/netmap/netmap_kern.h Thu Jan 26 09:55:16 2012 (r230572) @@ -65,13 +65,14 @@ struct netmap_kring { struct netmap_ring *ring; u_int nr_hwcur; int nr_hwavail; - u_int nr_kflags; + u_int nr_kflags; /* private driver flags */ +#define NKR_PENDINTR 0x1 // Pending interrupt. u_int nkr_num_slots; int nkr_hwofs; /* offset between NIC and netmap ring */ struct netmap_adapter *na; // debugging struct selinfo si; /* poll/select wait queue */ -}; +} __attribute__((__aligned__(64))); /* * This struct is part of and extends the 'struct adapter' (or @@ -171,6 +172,8 @@ struct netmap_slot *netmap_reset(struct enum txrx tx, int n, u_int new_cur); int netmap_ring_reinit(struct netmap_kring *); +extern int netmap_mitigate; +extern int netmap_skip_txsync, netmap_skip_rxsync; extern u_int netmap_total_buffers; extern char *netmap_buffer_base; extern int netmap_verbose; // XXX debugging From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 09:56:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C482106566C; Thu, 26 Jan 2012 09:56:30 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 169C48FC13; Thu, 26 Jan 2012 09:56:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0Q9uTa9075427; Thu, 26 Jan 2012 09:56:29 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0Q9uT7c075425; Thu, 26 Jan 2012 09:56:29 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201201260956.q0Q9uT7c075425@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 26 Jan 2012 09:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230573 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 09:56:30 -0000 Author: ae Date: Thu Jan 26 09:56:29 2012 New Revision: 230573 URL: http://svn.freebsd.org/changeset/base/230573 Log: MFC r222281: Do not truncate available disk space to the closest track boundary. Modified: stable/8/sys/geom/part/g_part_pc98.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/geom/part/g_part_pc98.c ============================================================================== --- stable/8/sys/geom/part/g_part_pc98.c Thu Jan 26 09:55:16 2012 (r230572) +++ stable/8/sys/geom/part/g_part_pc98.c Thu Jan 26 09:56:29 2012 (r230573) @@ -220,7 +220,6 @@ g_part_pc98_create(struct g_part_table * { struct g_provider *pp; struct g_part_pc98_table *table; - uint32_t cyl, msize; pp = gpp->gpp_provider; if (pp->sectorsize < SECSIZE || pp->mediasize < 2 * SECSIZE) @@ -228,11 +227,8 @@ g_part_pc98_create(struct g_part_table * if (pp->sectorsize > SECSIZE) return (ENXIO); - cyl = basetable->gpt_heads * basetable->gpt_sectors; - - msize = MIN(pp->mediasize / SECSIZE, UINT32_MAX); - basetable->gpt_first = cyl; - basetable->gpt_last = msize - (msize % cyl) - 1; + basetable->gpt_first = basetable->gpt_heads * basetable->gpt_sectors; + basetable->gpt_last = MIN(pp->mediasize / SECSIZE, UINT32_MAX) - 1; table = (struct g_part_pc98_table *)basetable; le16enc(table->boot + DOSMAGICOFFSET, DOSMAGIC); @@ -453,7 +449,7 @@ g_part_pc98_read(struct g_part_table *ba basetable->gpt_entries = NDOSPART; basetable->gpt_first = cyl; - basetable->gpt_last = msize - (msize % cyl) - 1; + basetable->gpt_last = msize - 1; g_free(buf); return (0); From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 10:30:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0322106566B; Thu, 26 Jan 2012 10:30:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB3A38FC15; Thu, 26 Jan 2012 10:30:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QAUoxA076631; Thu, 26 Jan 2012 10:30:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QAUoAR076629; Thu, 26 Jan 2012 10:30:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201261030.q0QAUoAR076629@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Jan 2012 10:30:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230574 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 10:30:51 -0000 Author: mav Date: Thu Jan 26 10:30:50 2012 New Revision: 230574 URL: http://svn.freebsd.org/changeset/base/230574 Log: Fix typo in r230571. Submitted by: trasz Modified: head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Thu Jan 26 09:56:29 2012 (r230573) +++ head/sys/dev/sound/pci/hda/hdacc.c Thu Jan 26 10:30:50 2012 (r230574) @@ -330,7 +330,7 @@ static const struct { { HDA_CODEC_CHXXXX, 0, "Chrontel" }, { HDA_CODEC_IDTXXXX, 0, "IDT" }, { HDA_CODEC_INTELXXXX, 0, "Intel" }, - { HDA_CODEC_MOTOXXXX, 0, "Motorolla" }, + { HDA_CODEC_MOTOXXXX, 0, "Motorola" }, { HDA_CODEC_NVIDIAXXXX, 0, "NVIDIA" }, { HDA_CODEC_SIIXXXX, 0, "Silicon Image" }, { HDA_CODEC_STACXXXX, 0, "Sigmatel" }, From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 10:33:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28D1F106564A; Thu, 26 Jan 2012 10:33:20 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 06ED48FC14; Thu, 26 Jan 2012 10:33:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QAXJ4A076763; Thu, 26 Jan 2012 10:33:19 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QAXJSA076754; Thu, 26 Jan 2012 10:33:19 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201201261033.q0QAXJSA076754@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 26 Jan 2012 10:33:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230575 - in stable/8: sbin/ipfw sys/netinet sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 10:33:20 -0000 Author: ae Date: Thu Jan 26 10:33:19 2012 New Revision: 230575 URL: http://svn.freebsd.org/changeset/base/230575 Log: MFC r223666: Add new rule actions "call" and "return" to ipfw. They make possible to organize subroutines with rules. The "call" action saves the current rule number in the internal stack and rules processing continues from the first rule with specified number (similar to skipto action). If later a rule with "return" action is encountered, the processing returns to the first rule with number of "call" rule saved in the stack plus one or higher. Submitted by: Vadim Goncharov Modified: stable/8/sbin/ipfw/ipfw.8 stable/8/sbin/ipfw/ipfw2.c stable/8/sbin/ipfw/ipfw2.h stable/8/sys/netinet/ip_fw.h stable/8/sys/netinet/ip_var.h stable/8/sys/netinet/ipfw/ip_fw2.c stable/8/sys/netinet/ipfw/ip_fw_log.c stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Directory Properties: stable/8/sbin/ipfw/ (props changed) stable/8/sys/ (props changed) Modified: stable/8/sbin/ipfw/ipfw.8 ============================================================================== --- stable/8/sbin/ipfw/ipfw.8 Thu Jan 26 10:30:50 2012 (r230574) +++ stable/8/sbin/ipfw/ipfw.8 Thu Jan 26 10:33:19 2012 (r230575) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 14, 2011 +.Dd June 29, 2011 .Dt IPFW 8 .Os .Sh NAME @@ -818,6 +818,78 @@ skipto, but care should be used, as no d is possible in this case so the rules are always walked to find it, starting from the .Cm skipto . +.It Cm call Ar number | tablearg +The current rule number is saved in the internal stack and +ruleset processing continues with the first rule numbered +.Ar number +or higher. +If later a rule with the +.Cm return +action is encountered, the processing returns to the first rule +with number of this +.Cm call +rule plus one or higher +(the same behaviour as with packets returning from +.Xr divert 4 +socket after a +.Cm divert +action). +This could be used to make somewhat like an assembly language +.Dq subroutine +calls to rules with common checks for different interfaces, etc. +.Pp +Rule with any number could be called, not just forward jumps as with +.Cm skipto . +So, to prevent endless loops in case of mistakes, both +.Cm call +and +.Cm return +actions don't do any jumps and simply go to the next rule if memory +can't be allocated or stack overflowed/undeflowed. +.Pp +Internally stack for rule numbers is implemented using +.Xr mbuf_tags 9 +facility and currently has size of 16 entries. +As mbuf tags are lost when packet leaves the kernel, +.Cm divert +should not be used in subroutines to avoid endless loops +and other undesired effects. +.It Cm return +Takes rule number saved to internal stack by the last +.Cm call +action and returns ruleset processing to the first rule +with number greater than number of corresponding +.Cm call +rule. See description of the +.Cm call +action for more details. +.Pp +Note that +.Cm return +rules usually end a +.Dq subroutine +and thus are unconditional, but +.Nm +command-line utility currently requires every action except +.Cm check-state +to have body. +While it is sometimes useful to return only on some packets, +usually you want to print just +.Dq return +for readability. +A workaround for this is to use new syntax and +.Fl c +switch: +.Pp +.Bd -literal -offset indent +# Add a rule without actual body +ipfw add 2999 return via any + +# List rules without "from any to any" part +ipfw -c list +.Ed +.Pp +This cosmetic annoyance may be fixed in future releases. .It Cm tee Ar port Send a copy of packets matching this rule to the .Xr divert 4 @@ -3240,3 +3312,18 @@ for the respective conversations. To avoid failures of network error detection and path MTU discovery, ICMP error messages may need to be allowed explicitly through static rules. +.Pp +Rules using +.Cm call +and +.Cm return +actions may lead to confusing behaviour if ruleset has mistakes, +and/or interaction with other subsystems (netgraph, dummynet, etc.) is used. +One possible case for this is packet leaving +.Nm +in subroutine on the input pass, while later on output encountering unpaired +.Cm return +first. +As the call stack is kept intact after input pass, packet will suddenly +return to the rule number used on input pass, not on output one. +Order of processing should be checked carefully to avoid such mistakes. Modified: stable/8/sbin/ipfw/ipfw2.c ============================================================================== --- stable/8/sbin/ipfw/ipfw2.c Thu Jan 26 10:30:50 2012 (r230574) +++ stable/8/sbin/ipfw/ipfw2.c Thu Jan 26 10:33:19 2012 (r230575) @@ -213,6 +213,8 @@ static struct _s_x rule_actions[] = { { "nat", TOK_NAT }, { "reass", TOK_REASS }, { "setfib", TOK_SETFIB }, + { "call", TOK_CALL }, + { "return", TOK_RETURN }, { NULL, 0 } /* terminator */ }; @@ -1126,6 +1128,13 @@ show_ipfw(struct ip_fw *rule, int pcwidt printf("reass"); break; + case O_CALLRETURN: + if (cmd->len & F_NOT) + printf("return"); + else + PRINT_UINT_ARG("call ", cmd->arg1); + break; + default: printf("** unrecognized action %d len %d ", cmd->opcode, cmd->len); @@ -2762,6 +2771,9 @@ ipfw_add(char *av[]) goto chkarg; case TOK_TEE: action->opcode = O_TEE; + goto chkarg; + case TOK_CALL: + action->opcode = O_CALLRETURN; chkarg: if (!av[0]) errx(EX_USAGE, "missing argument for %s", *(av - 1)); @@ -2854,6 +2866,10 @@ chkarg: action->opcode = O_REASS; break; + case TOK_RETURN: + fill_cmd(action, O_CALLRETURN, F_NOT, 0); + break; + default: errx(EX_DATAERR, "invalid action %s\n", av[-1]); } Modified: stable/8/sbin/ipfw/ipfw2.h ============================================================================== --- stable/8/sbin/ipfw/ipfw2.h Thu Jan 26 10:30:50 2012 (r230574) +++ stable/8/sbin/ipfw/ipfw2.h Thu Jan 26 10:33:19 2012 (r230575) @@ -99,6 +99,8 @@ enum tokens { TOK_CHECKSTATE, TOK_NAT, TOK_REASS, + TOK_CALL, + TOK_RETURN, TOK_ALTQ, TOK_LOG, Modified: stable/8/sys/netinet/ip_fw.h ============================================================================== --- stable/8/sys/netinet/ip_fw.h Thu Jan 26 10:30:50 2012 (r230574) +++ stable/8/sys/netinet/ip_fw.h Thu Jan 26 10:33:19 2012 (r230575) @@ -57,6 +57,12 @@ #define IP_FW_TABLEARG 65535 /* XXX should use 0 */ /* + * Number of entries in the call stack of the call/return commands. + * Call stack currently is an uint16_t array with rule numbers. + */ +#define IPFW_CALLSTACK_SIZE 16 + +/* * The kernel representation of ipfw rules is made of a list of * 'instructions' (for all practical purposes equivalent to BPF * instructions), which specify which fields of the packet @@ -193,6 +199,8 @@ enum ipfw_opcodes { /* arguments (4 byt O_SETFIB, /* arg1=FIB number */ O_FIB, /* arg1=FIB desired fib number */ + O_CALLRETURN, /* arg1=called rule number */ + O_LAST_OPCODE /* not an opcode! */ }; Modified: stable/8/sys/netinet/ip_var.h ============================================================================== --- stable/8/sys/netinet/ip_var.h Thu Jan 26 10:30:50 2012 (r230574) +++ stable/8/sys/netinet/ip_var.h Thu Jan 26 10:33:19 2012 (r230575) @@ -287,6 +287,7 @@ enum { }; #define MTAG_IPFW 1148380143 /* IPFW-tagged cookie */ #define MTAG_IPFW_RULE 1262273568 /* rule reference */ +#define MTAG_IPFW_CALL 1308397630 /* call stack */ struct ip_fw_args; typedef int (*ip_fw_chk_ptr_t)(struct ip_fw_args *args); Modified: stable/8/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jan 26 10:30:50 2012 (r230574) +++ stable/8/sys/netinet/ipfw/ip_fw2.c Thu Jan 26 10:33:19 2012 (r230575) @@ -2030,6 +2030,123 @@ do { \ continue; break; /* not reached */ + case O_CALLRETURN: { + /* + * Implementation of `subroutine' call/return, + * in the stack carried in an mbuf tag. This + * is different from `skipto' in that any call + * address is possible (`skipto' must prevent + * backward jumps to avoid endless loops). + * We have `return' action when F_NOT flag is + * present. The `m_tag_id' field is used as + * stack pointer. + */ + struct m_tag *mtag; + uint16_t jmpto, *stack; + +#define IS_CALL ((cmd->len & F_NOT) == 0) +#define IS_RETURN ((cmd->len & F_NOT) != 0) + /* + * Hand-rolled version of m_tag_locate() with + * wildcard `type'. + * If not already tagged, allocate new tag. + */ + mtag = m_tag_first(m); + while (mtag != NULL) { + if (mtag->m_tag_cookie == + MTAG_IPFW_CALL) + break; + mtag = m_tag_next(m, mtag); + } + if (mtag == NULL && IS_CALL) { + mtag = m_tag_alloc(MTAG_IPFW_CALL, 0, + IPFW_CALLSTACK_SIZE * + sizeof(uint16_t), M_NOWAIT); + if (mtag != NULL) + m_tag_prepend(m, mtag); + } + + /* + * On error both `call' and `return' just + * continue with next rule. + */ + if (IS_RETURN && (mtag == NULL || + mtag->m_tag_id == 0)) { + l = 0; /* exit inner loop */ + break; + } + if (IS_CALL && (mtag == NULL || + mtag->m_tag_id >= IPFW_CALLSTACK_SIZE)) { + printf("ipfw: call stack error, " + "go to next rule\n"); + l = 0; /* exit inner loop */ + break; + } + + f->pcnt++; /* update stats */ + f->bcnt += pktlen; + f->timestamp = time_uptime; + stack = (uint16_t *)(mtag + 1); + + /* + * The `call' action may use cached f_pos + * (in f->next_rule), whose version is written + * in f->next_rule. + * The `return' action, however, doesn't have + * fixed jump address in cmd->arg1 and can't use + * cache. + */ + if (IS_CALL) { + stack[mtag->m_tag_id] = f->rulenum; + mtag->m_tag_id++; + if (cmd->arg1 != IP_FW_TABLEARG && + (uintptr_t)f->x_next == chain->id) { + f_pos = (uintptr_t)f->next_rule; + } else { + jmpto = (cmd->arg1 == + IP_FW_TABLEARG) ? tablearg: + cmd->arg1; + f_pos = ipfw_find_rule(chain, + jmpto, 0); + /* update the cache */ + if (cmd->arg1 != + IP_FW_TABLEARG) { + f->next_rule = + (void *)(uintptr_t) + f_pos; + f->x_next = + (void *)(uintptr_t) + chain->id; + } + } + } else { /* `return' action */ + mtag->m_tag_id--; + jmpto = stack[mtag->m_tag_id] + 1; + f_pos = ipfw_find_rule(chain, jmpto, 0); + } + + /* + * Skip disabled rules, and re-enter + * the inner loop with the correct + * f_pos, f, l and cmd. + * Also clear cmdlen and skip_or + */ + for (; f_pos < chain->n_rules - 1 && + (V_set_disable & + (1 << chain->map[f_pos]->set)); f_pos++) + ; + /* Re-enter the inner loop at the dest rule. */ + f = chain->map[f_pos]; + l = f->cmd_len; + cmd = f->cmd; + cmdlen = 0; + skip_or = 0; + continue; + break; /* NOTREACHED */ + } +#undef IS_CALL +#undef IS_RETURN + case O_REJECT: /* * Drop the packet and send a reject notice Modified: stable/8/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_log.c Thu Jan 26 10:30:50 2012 (r230574) +++ stable/8/sys/netinet/ipfw/ip_fw_log.c Thu Jan 26 10:33:19 2012 (r230575) @@ -299,6 +299,13 @@ ipfw_log(struct ip_fw *f, u_int hlen, st case O_REASS: action = "Reass"; break; + case O_CALLRETURN: + if (cmd->len & F_NOT) + action = "Return"; + else + snprintf(SNPARGS(action2, 0), "Call %d", + cmd->arg1); + break; default: action = "UNKNOWN"; break; Modified: stable/8/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Thu Jan 26 10:30:50 2012 (r230574) +++ stable/8/sys/netinet/ipfw/ip_fw_sockopt.c Thu Jan 26 10:33:19 2012 (r230575) @@ -746,6 +746,7 @@ check_ipfw_struct(struct ip_fw *rule, in #endif case O_SKIPTO: case O_REASS: + case O_CALLRETURN: check_size: if (cmdlen != F_INSN_SIZE(ipfw_insn)) goto bad_size; From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 10:42:26 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 472031065672; Thu, 26 Jan 2012 10:42:26 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1887E8FC12; Thu, 26 Jan 2012 10:42:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QAgP90077093; Thu, 26 Jan 2012 10:42:25 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QAgPsI077091; Thu, 26 Jan 2012 10:42:25 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261042.q0QAgPsI077091@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 10:42:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230576 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 10:42:26 -0000 Author: glebius Date: Thu Jan 26 10:42:25 2012 New Revision: 230576 URL: http://svn.freebsd.org/changeset/base/230576 Log: Update information on setting and retreiving inet4 addresses. Modified: head/share/man/man4/inet.4 Modified: head/share/man/man4/inet.4 ============================================================================== --- head/share/man/man4/inet.4 Thu Jan 26 10:33:19 2012 (r230575) +++ head/share/man/man4/inet.4 Thu Jan 26 10:42:25 2012 (r230576) @@ -32,7 +32,7 @@ .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd April 9, 2005 +.Dd January 26, 2012 .Dt INET 4 .Os .Sh NAME @@ -130,25 +130,37 @@ The .Tn ICMP message protocol is accessible from a raw socket. .Pp -The 32-bit Internet address contains both network and host parts. -However, direct examination of addresses is discouraged. -For those -programs which absolutely need to break addresses into their component -parts, the following +The +.Nm +address on an interface consist of the address itself, the +netmask, either broadcast address in case of a broadcast +interface or peers address in case of point-to-point interface. +The following .Xr ioctl 2 -commands are provided for a datagram socket in the Internet domain; -they have the same form as the -.Dv SIOCIFADDR -command (see -.Xr intro 4 ) . -.Bl -tag -width SIOCSIFNETMASK -.It Dv SIOCSIFNETMASK -Set interface network mask. -The network mask defines the network part of the address; -if it contains more of the address than the address type would indicate, -then subnets are in use. +commands are provided for a datagram socket in the Internet domain: +.Pp +.Bl -tag -width ".Dv SIOCGIFBRDADDR" -offset indent -compact +.It Dv SIOCAIFADDR +Add address to an interface. +The command requires +.Ft struct in_aliasreq +as argument. +.It Dv SIOCDIFADDR +Delete address from an interface. +The command requires +.Ft struct ifreq +as argument. +.It Dv SIOCGIFADDR +.It Dv SIOCGIFBRDADDR +.It Dv SIOCGIFDSTADDR .It Dv SIOCGIFNETMASK -Get interface network mask. +Return address information from interface. The returned value +is in +.Ft struct ifreq . +This way of address information retrieval is obsoleted, a +preferred way is to use +.Xr getifaddrs 3 +API. .El .Ss MIB Variables A number of variables are implemented in the net.inet branch of the @@ -260,6 +272,7 @@ in the reassembling queue for a packet. .Sh SEE ALSO .Xr ioctl 2 , .Xr socket 2 , +.Xr getifaddrs 3 , .Xr sysctl 3 , .Xr icmp 4 , .Xr intro 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 10:43:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9051A106564A; Thu, 26 Jan 2012 10:43:40 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B6748FC13; Thu, 26 Jan 2012 10:43:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QAheoL077168; Thu, 26 Jan 2012 10:43:40 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QAheGN077166; Thu, 26 Jan 2012 10:43:40 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261043.q0QAheGN077166@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 10:43:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230577 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 10:43:41 -0000 Author: glebius Date: Thu Jan 26 10:43:40 2012 New Revision: 230577 URL: http://svn.freebsd.org/changeset/base/230577 Log: - Remove no longer supported ioctl cmds. - Fix name of SIOCSIFADDR. Modified: head/share/man/man4/netintro.4 Modified: head/share/man/man4/netintro.4 ============================================================================== --- head/share/man/man4/netintro.4 Thu Jan 26 10:42:25 2012 (r230576) +++ head/share/man/man4/netintro.4 Thu Jan 26 10:43:40 2012 (r230577) @@ -32,7 +32,7 @@ .\" @(#)netintro.4 8.2 (Berkeley) 11/30/93 .\" $FreeBSD$ .\" -.Dd April 14, 2010 +.Dd January 26, 2012 .Dt NETINTRO 4 .Os .Sh NAME @@ -231,19 +231,6 @@ struct ifreq { }; .Ed .Pp -Calls which are now deprecated are: -.Bl -tag -width SIOCGIFBRDADDR -.It Dv SIOCSIFADDR -Set interface address for protocol family. -Following the address assignment, the -.Dq initialization -routine for the interface is called. -.It Dv SIOCSIFDSTADDR -Set point to point address for protocol family and interface. -.It Dv SIOCSIFBRDADDR -Set broadcast address for protocol family and interface. -.El -.Pp .Fn Ioctl requests to obtain addresses and requests both to set and retrieve other data are still fully supported @@ -400,7 +387,7 @@ boundaries. .El .Bd -literal /* -* Structure used in SIOCAIFCONF request. +* Structure used in SIOCAIFADDR request. */ struct ifaliasreq { char ifra_name[IFNAMSIZ]; /* if name, e.g. "en0" */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 10:48:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F917106566B; Thu, 26 Jan 2012 10:48:17 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2628FC1C; Thu, 26 Jan 2012 10:48:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QAmHUM077415; Thu, 26 Jan 2012 10:48:17 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QAmH2s077413; Thu, 26 Jan 2012 10:48:17 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261048.q0QAmH2s077413@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 10:48:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230578 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 10:48:17 -0000 Author: glebius Date: Thu Jan 26 10:48:17 2012 New Revision: 230578 URL: http://svn.freebsd.org/changeset/base/230578 Log: Remove a commented out old block inherited from inet.4. The text there was so much outdated that it required a complete rewrite even for inet.4, not mentioning inet6.4. There is no reason to keep it in the manual page. Modified: head/share/man/man4/inet6.4 Modified: head/share/man/man4/inet6.4 ============================================================================== --- head/share/man/man4/inet6.4 Thu Jan 26 10:43:40 2012 (r230577) +++ head/share/man/man4/inet6.4 Thu Jan 26 10:48:17 2012 (r230578) @@ -184,86 +184,6 @@ by creating an Internet socket of type The .Tn ICMPv6 message protocol is accessible from a raw socket. -.\" .Pp -.\" The 128-bit IPv6 address contains both network and host parts. -.\" However, direct examination of addresses is discouraged. -.\" For those programs which absolutely need to break addresses -.\" into their component parts, the following -.\" .Xr ioctl 2 -.\" commands are provided for a datagram socket in the -.\" .Nm -.\" domain; they have the same form as the -.\" .Dv SIOCIFADDR -.\" command (see -.\" .Xr intro 4 ) . -.\" .Pp -.\" .Bl -tag -width SIOCSIFNETMASK -.\" .It Dv SIOCSIFNETMASK -.\" Set interface network mask. -.\" The network mask defines the network part of the address; -.\" if it contains more of the address than the address type would indicate, -.\" then subnets are in use. -.\" .It Dv SIOCGIFNETMASK -.\" Get interface network mask. -.\" .El -.\" .Sh ROUTING -.\" The current implementation of Internet protocols includes some routing-table -.\" adaptations to provide enhanced caching of certain end-to-end -.\" information necessary for Transaction TCP and Path MTU Discovery. The -.\" following changes are the most significant: -.\" .Bl -enum -.\" .It -.\" All IP routes, except those with the -.\" .Dv RTF_CLONING -.\" flag and those to multicast destinations, have the -.\" .Dv RTF_PRCLONING -.\" flag forcibly enabled (they are thus said to be -.\" .Dq "protocol cloning" ). -.\" .It -.\" When the last reference to an IP route is dropped, the route is -.\" examined to determine if it was created by cloning such a route. If -.\" this is the case, the -.\" .Dv RTF_PROTO3 -.\" flag is turned on, and the expiration timer is initialized to go off -.\" in net.inet.ip.rtexpire seconds. If such a route is re-referenced, -.\" the flag and expiration timer are reset. -.\" .It -.\" A kernel timeout runs once every ten minutes, or sooner if there are -.\" soon-to-expire routes in the kernel routing table, and deletes the -.\" expired routes. -.\" .El -.\" .Pp -.\" A dynamic process is in place to modify the value of -.\" net.inet.ip.rtexpire if the number of cached routes grows too large. -.\" If after an expiration run there are still more than -.\" net.inet.ip.rtmaxcache unreferenced routes remaining, the rtexpire -.\" value is multiplied by 3/4, and any routes which have longer -.\" expiration times have those times adjusted. This process is damped -.\" somewhat by specification of a minimum rtexpire value -.\" (net.inet.ip.rtminexpire), and by restricting the reduction to once in -.\" a ten-minute period. -.\" .Pp -.\" If some external process deletes the original route from which a -.\" protocol-cloned route was generated, the ``child route'' is deleted. -.\" (This is actually a generic mechanism in the routing code support for -.\" protocol-requested cloning.) -.\" .Pp -.\" No attempt is made to manage routes which were not created by protocol -.\" cloning; these are assumed to be static, under the management of an -.\" external routing process, or under the management of a link layer -.\" (e.g., -.\" .Tn ARP -.\" for Ethernets). -.\" .Pp -.\" Only certain types of network activity will result in the cloning of a -.\" route using this mechanism. Specifically, those protocols (such as -.\" .Tn TCP -.\" and -.\" .Tn UDP ) -.\" which themselves cache a long-lasting reference to route for a destination -.\" will trigger the mechanism; whereas raw -.\" .Tn IP -.\" packets, whether locally-generated or forwarded, will not. .Ss MIB Variables A number of variables are implemented in the net.inet6 branch of the .Xr sysctl 3 From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 10:51:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id A65C7106566B; Thu, 26 Jan 2012 10:51:15 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 264641514C9; Thu, 26 Jan 2012 10:51:12 +0000 (UTC) Message-ID: <4F21301F.6030608@FreeBSD.org> Date: Thu, 26 Jan 2012 02:51:11 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120119 Thunderbird/9.0 MIME-Version: 1.0 To: Guy Helmer References: <201201251450.q0PEoCe8029243@svn.freebsd.org> In-Reply-To: <201201251450.q0PEoCe8029243@svn.freebsd.org> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230541 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 10:51:15 -0000 On 01/25/2012 06:50, Guy Helmer wrote: > Author: ghelmer > Date: Wed Jan 25 14:50:12 2012 > New Revision: 230541 > URL: http://svn.freebsd.org/changeset/base/230541 > > Log: > Revert 229667: After some discussion of this change, it seems it is > better to leave the pidfile open where it was. Add a note to the > man page describing pidfile strategies to use if the daemon is to > be run as a user other than root. Did you see the message I sent requesting that you mention the alternative of pre-creating the pidfile with the right permissions, and provided a proposed text to that effect? > Modified: > head/usr.sbin/daemon/daemon.8 > head/usr.sbin/daemon/daemon.c > > Modified: head/usr.sbin/daemon/daemon.8 > ============================================================================== > --- head/usr.sbin/daemon/daemon.8 Wed Jan 25 14:38:00 2012 (r230540) > +++ head/usr.sbin/daemon/daemon.8 Wed Jan 25 14:50:12 2012 (r230541) > @@ -59,6 +59,10 @@ Write the ID of the created process into > using the > .Xr pidfile 3 > functionality. > +If the > +.Fl u > +option is used, the directory to contain the pidfile must be writable > +by the specified user. > Note, that the file will be created shortly before the process is > actually executed, and will remain after the process exits (although > it will be removed if the execution fails). -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 10:51:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C0FCE106567A; Thu, 26 Jan 2012 10:51:41 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A648B8FC15; Thu, 26 Jan 2012 10:51:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QApfjO077559; Thu, 26 Jan 2012 10:51:41 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QApfbt077557; Thu, 26 Jan 2012 10:51:41 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261051.q0QApfbt077557@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 10:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230579 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 10:51:41 -0000 Author: glebius Date: Thu Jan 26 10:51:41 2012 New Revision: 230579 URL: http://svn.freebsd.org/changeset/base/230579 Log: Remove a block that contatined some outdated misinformation on how addresses are configured, as well as obviousness that Ethernet interface may run arp(4). Modified: head/share/man/man4/txp.4 Modified: head/share/man/man4/txp.4 ============================================================================== --- head/share/man/man4/txp.4 Thu Jan 26 10:48:17 2012 (r230578) +++ head/share/man/man4/txp.4 Thu Jan 26 10:51:41 2012 (r230579) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 12, 2009 +.Dd January 26, 2012 .Dt TXP 4 .Os .Sh NAME @@ -77,17 +77,6 @@ segmentation, nor .Xr ipsec 4 acceleration. .Pp -Each of the host's network addresses -is specified at boot time with an -.Dv SIOCSIFADDR -.Xr ioctl 2 . -The -.Nm -interface employs the address resolution protocol described in -.Xr arp 4 -to dynamically map between Internet and Ethernet addresses on the local -network. -.Pp When a .Nm interface is brought up, by default, it will attempt to auto-negotiate the From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 10:53:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8AEC1065680; Thu, 26 Jan 2012 10:53:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A38318FC24; Thu, 26 Jan 2012 10:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QArdBA083375; Thu, 26 Jan 2012 10:53:39 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QArd1g083373; Thu, 26 Jan 2012 10:53:39 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261053.q0QArd1g083373@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 10:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230580 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 10:53:39 -0000 Author: glebius Date: Thu Jan 26 10:53:39 2012 New Revision: 230580 URL: http://svn.freebsd.org/changeset/base/230580 Log: Don't mention no longer supported ioctl commands. Modified: head/share/man/man4/tap.4 Modified: head/share/man/man4/tap.4 ============================================================================== --- head/share/man/man4/tap.4 Thu Jan 26 10:51:41 2012 (r230579) +++ head/share/man/man4/tap.4 Thu Jan 26 10:53:39 2012 (r230580) @@ -1,7 +1,7 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd September 8, 2008 +.Dd January 26, 2012 .Dt TAP 4 .Os .Sh NAME @@ -89,11 +89,7 @@ Control devices (once successfully opene is unloaded or the interface is destroyed. .Pp Each interface supports the usual Ethernet network interface -.Xr ioctl 2 Ns s , -such as -.Dv SIOCSIFADDR -and -.Dv SIOCSIFNETMASK , +.Xr ioctl 2 Ns s and thus can be used with .Xr ifconfig 8 like any other Ethernet interface. From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 11:08:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34A2E106567C; Thu, 26 Jan 2012 11:08:56 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DFC08FC28; Thu, 26 Jan 2012 11:08:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QB8uYx083881; Thu, 26 Jan 2012 11:08:56 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QB8uoN083879; Thu, 26 Jan 2012 11:08:56 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261108.q0QB8uoN083879@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 11:08:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230581 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 11:08:58 -0000 Author: glebius Date: Thu Jan 26 11:08:55 2012 New Revision: 230581 URL: http://svn.freebsd.org/changeset/base/230581 Log: List supported ioctl commands instead of old one. Modified: head/share/man/man9/ifnet.9 Modified: head/share/man/man9/ifnet.9 ============================================================================== --- head/share/man/man9/ifnet.9 Thu Jan 26 10:53:39 2012 (r230580) +++ head/share/man/man9/ifnet.9 Thu Jan 26 11:08:55 2012 (r230581) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2011 +.Dd January 26, 2012 .Dt IFNET 9 .Os .Sh NAME @@ -1245,10 +1245,8 @@ or .Fn if_delmulti function is called to perform the operation; qq.v. .Pp -.It Dv SIOCSIFDSTADDR -.It Dv SIOCSIFADDR -.It Dv SIOCSIFBRDADDR -.It Dv SIOCSIFNETMASK +.It Dv SIOCAIFADDR +.It Dv SIOCDIFADDR The socket's protocol control routine is called to implement the requested action. .Pp From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 11:59:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C83B2106564A; Thu, 26 Jan 2012 11:59:48 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B32C08FC08; Thu, 26 Jan 2012 11:59:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QBxmui086164; Thu, 26 Jan 2012 11:59:48 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QBxma2086162; Thu, 26 Jan 2012 11:59:48 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261159.q0QBxma2086162@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 11:59:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 11:59:48 -0000 Author: glebius Date: Thu Jan 26 11:59:48 2012 New Revision: 230583 URL: http://svn.freebsd.org/changeset/base/230583 Log: Although aio_nbytes is size_t, later is is signed to casted types: to ssize_t in filesystem code and to int in buf code, thus supplying a negative argument leads to kernel panic later. To fix that check user supplied argument in the beginning of syscall. Submitted by: Maxim Dounin , maxim@ Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Thu Jan 26 11:15:12 2012 (r230582) +++ head/sys/kern/vfs_aio.c Thu Jan 26 11:59:48 2012 (r230583) @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio return (error); } + /* XXX: aio_nbytes is later casted to signed types. */ + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { + uma_zfree(aiocb_zone, aiocbe); + return (EINVAL); + } + if (aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_KEVENT && aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_SIGNAL && aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_THREAD_ID && From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 12:04:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4626C106566C; Thu, 26 Jan 2012 12:04:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 173BC8FC1D; Thu, 26 Jan 2012 12:04:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QC4JaQ086649; Thu, 26 Jan 2012 12:04:19 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QC4Jr5086647; Thu, 26 Jan 2012 12:04:19 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261204.q0QC4Jr5086647@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 12:04:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230584 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 12:04:20 -0000 Author: glebius Date: Thu Jan 26 12:04:19 2012 New Revision: 230584 URL: http://svn.freebsd.org/changeset/base/230584 Log: Remove casts from inet6 address testing macros, thus preserving qualifier from original argument. Obtained from: NetBSD, r. 1.67 Submitted by: maxim Modified: head/sys/netinet6/in6.h Modified: head/sys/netinet6/in6.h ============================================================================== --- head/sys/netinet6/in6.h Thu Jan 26 11:59:48 2012 (r230583) +++ head/sys/netinet6/in6.h Thu Jan 26 12:04:19 2012 (r230584) @@ -235,37 +235,37 @@ extern const struct in6_addr in6addr_lin * Unspecified */ #define IN6_IS_ADDR_UNSPECIFIED(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == 0)) + ((a)->__u6_addr.__u6_addr32[0] == 0 && \ + (a)->__u6_addr.__u6_addr32[1] == 0 && \ + (a)->__u6_addr.__u6_addr32[2] == 0 && \ + (a)->__u6_addr.__u6_addr32[3] == 0) /* * Loopback */ #define IN6_IS_ADDR_LOOPBACK(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) == ntohl(1))) + ((a)->__u6_addr.__u6_addr32[0] == 0 && \ + (a)->__u6_addr.__u6_addr32[1] == 0 && \ + (a)->__u6_addr.__u6_addr32[2] == 0 && \ + (a)->__u6_addr.__u6_addr32[3] == ntohl(1)) /* * IPv4 compatible */ #define IN6_IS_ADDR_V4COMPAT(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[12]) != ntohl(1))) + ((a)->__u6_addr.__u6_addr32[0] == 0 && \ + (a)->__u6_addr.__u6_addr32[1] == 0 && \ + (a)->__u6_addr.__u6_addr32[2] == 0 && \ + (a)->__u6_addr.__u6_addr32[3] != 0 && \ + (a)->__u6_addr.__u6_addr32[3] != ntohl(1)) /* * Mapped */ #define IN6_IS_ADDR_V4MAPPED(a) \ - ((*(const u_int32_t *)(const void *)(&(a)->s6_addr[0]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[4]) == 0) && \ - (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == ntohl(0x0000ffff))) + ((a)->__u6_addr.__u6_addr32[0] == 0 && \ + (a)->__u6_addr.__u6_addr32[1] == 0 && \ + (a)->__u6_addr.__u6_addr32[2] == ntohl(0x0000ffff)) /* * KAME Scope Values From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 12:07:58 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D539106566B; Thu, 26 Jan 2012 12:07:58 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 635C08FC08; Thu, 26 Jan 2012 12:07:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id q0QC7qEu098137; Thu, 26 Jan 2012 16:07:52 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Thu, 26 Jan 2012 16:07:52 +0400 (MSK) From: Maxim Konovalov To: Gleb Smirnoff In-Reply-To: <201201261204.q0QC4Jr5086647@svn.freebsd.org> Message-ID: References: <201201261204.q0QC4Jr5086647@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r230584 - head/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 12:07:58 -0000 On Thu, 26 Jan 2012, 12:04-0000, Gleb Smirnoff wrote: > Author: glebius > Date: Thu Jan 26 12:04:19 2012 > New Revision: 230584 > URL: http://svn.freebsd.org/changeset/base/230584 > > Log: > Remove casts from inet6 address testing macros, thus preserving > qualifier from original argument. > > Obtained from: NetBSD, r. 1.67 > Submitted by: maxim > Thanks! Just for the record: the patch was from Maxim Dounin. -- Maxim Konovalov From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 12:09:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF8161065673; Thu, 26 Jan 2012 12:09:04 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A02308FC1B; Thu, 26 Jan 2012 12:09:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QC9439087154; Thu, 26 Jan 2012 12:09:04 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QC94Zv087152; Thu, 26 Jan 2012 12:09:04 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201261209.q0QC94Zv087152@svn.freebsd.org> From: Alexander Motin Date: Thu, 26 Jan 2012 12:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230585 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 12:09:05 -0000 Author: mav Date: Thu Jan 26 12:09:04 2012 New Revision: 230585 URL: http://svn.freebsd.org/changeset/base/230585 Log: Press some more info into the PCM device name: - add "+HP" in case of headphones redirection; - add device type for analog devices, if all pins have the same. As result now it may look like "Analog 5.1+HP/2.0" or "Front Analog Mic". I hope it will be more useful than long and confusing. MFC after: 2 months Sponsored by: iXsystems, Inc. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Thu Jan 26 12:04:19 2012 (r230584) +++ head/sys/dev/sound/pci/hda/hdaa.c Thu Jan 26 12:09:04 2012 (r230585) @@ -6485,9 +6485,12 @@ hdaa_chan_formula(struct hdaa_devinfo *d c = devinfo->chans[as->chans[0]].channels; if (c == 1) snprintf(buf, buflen, "mono"); - else if (c == 2) - buf[0] = 0; - else if (as->pinset == 0x0003) + else if (c == 2) { + if (as->hpredir < 0) + buf[0] = 0; + else + snprintf(buf, buflen, "2.0"); + } else if (as->pinset == 0x0003) snprintf(buf, buflen, "3.1"); else if (as->pinset == 0x0005 || as->pinset == 0x0011) snprintf(buf, buflen, "4.0"); @@ -6497,6 +6500,32 @@ hdaa_chan_formula(struct hdaa_devinfo *d snprintf(buf, buflen, "7.1"); else snprintf(buf, buflen, "%dch", c); + if (as->hpredir >= 0) + strlcat(buf, "+HP", buflen); +} + +static int +hdaa_chan_type(struct hdaa_devinfo *devinfo, int asid) +{ + struct hdaa_audio_as *as; + struct hdaa_widget *w; + int i, t = -1, t1; + + as = &devinfo->as[asid]; + for (i = 0; i < 16; i++) { + w = hdaa_widget_get(devinfo, as->pins[i]); + if (w == NULL || w->enable == 0 || w->type != + HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) + continue; + t1 = HDA_CONFIG_DEFAULTCONF_DEVICE(w->wclass.pin.config); + if (t == -1) + t = t1; + else if (t != t1) { + t = -2; + break; + } + } + return (t); } static int @@ -6537,7 +6566,7 @@ hdaa_pcm_probe(device_t dev) struct hdaa_devinfo *devinfo = pdevinfo->devinfo; char chans1[8], chans2[8]; char buf[128]; - int loc1, loc2; + int loc1, loc2, t1, t2; if (pdevinfo->playas >= 0) loc1 = devinfo->as[pdevinfo->playas].location; @@ -6553,12 +6582,17 @@ hdaa_pcm_probe(device_t dev) loc1 = -2; chans1[0] = 0; chans2[0] = 0; - if (pdevinfo->playas >= 0) + t1 = t2 = -1; + if (pdevinfo->playas >= 0) { hdaa_chan_formula(devinfo, pdevinfo->playas, chans1, sizeof(chans1)); - if (pdevinfo->recas >= 0) + t1 = hdaa_chan_type(devinfo, pdevinfo->playas); + } + if (pdevinfo->recas >= 0) { hdaa_chan_formula(devinfo, pdevinfo->recas, chans2, sizeof(chans2)); + t2 = hdaa_chan_type(devinfo, pdevinfo->recas); + } if (chans1[0] != 0 || chans2[0] != 0) { if (chans1[0] == 0 && pdevinfo->playas >= 0) snprintf(chans1, sizeof(chans1), "2.0"); @@ -6567,7 +6601,15 @@ hdaa_pcm_probe(device_t dev) if (strcmp(chans1, chans2) == 0) chans2[0] = 0; } - snprintf(buf, sizeof(buf), "%s PCM (%s%s%s%s%s%s%s)", + if (t1 == -1) + t1 = t2; + else if (t2 == -1) + t2 = t1; + if (t1 != t2) + t1 = -2; + if (pdevinfo->digital) + t1 = -2; + snprintf(buf, sizeof(buf), "%s PCM (%s%s%s%s%s%s%s%s%s)", device_get_desc(device_get_parent(device_get_parent(dev))), loc1 >= 0 ? HDA_LOCS[loc1] : "", loc1 >= 0 ? " " : "", (pdevinfo->digital == 0x7)?"HDMI/DP": @@ -6575,7 +6617,8 @@ hdaa_pcm_probe(device_t dev) ((pdevinfo->digital == 0x3)?"HDMI": ((pdevinfo->digital)?"Digital":"Analog"))), chans1[0] ? " " : "", chans1, - chans2[0] ? "/" : "", chans2); + chans2[0] ? "/" : "", chans2, + t1 >= 0 ? " " : "", t1 >= 0 ? HDA_DEVS[t1] : ""); device_set_desc_copy(dev, buf); return (BUS_PROBE_SPECIFIC); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 12:54:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC701106566C; Thu, 26 Jan 2012 12:54:00 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 71C548FC14; Thu, 26 Jan 2012 12:54:00 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0QCrv3v030889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Jan 2012 23:53:58 +1100 Date: Thu, 26 Jan 2012 23:53:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff In-Reply-To: <201201261159.q0QBxma2086162@svn.freebsd.org> Message-ID: <20120126233110.C960@besplex.bde.org> References: <201201261159.q0QBxma2086162@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 12:54:01 -0000 On Thu, 26 Jan 2012, Gleb Smirnoff wrote: > Log: > Although aio_nbytes is size_t, later is is signed to > casted types: to ssize_t in filesystem code and to > int in buf code, thus supplying a negative argument > leads to kernel panic later. And supplying a large positive argument leads to undefined behaviour later in the buf case. > To fix that check user > supplied argument in the beginning of syscall. Now, supplying a large positive argument gives implementation- defined behaviour immediately. Sometimes the implementation- defined behaviour is to have no effect immediately and allow a panic later. > Modified: head/sys/kern/vfs_aio.c > ============================================================================== > --- head/sys/kern/vfs_aio.c Thu Jan 26 11:15:12 2012 (r230582) > +++ head/sys/kern/vfs_aio.c Thu Jan 26 11:59:48 2012 (r230583) > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio > return (error); > } > > + /* XXX: aio_nbytes is later casted to signed types. */ > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { This should avoid implementation-defined behaviour by checking if (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. It isn't clear what the effects of the implementation-defined behaviour are even when you know what it is. It certainly results in the check passing values that exceed INT_MAX. For example, with 32-bit int and 64-bit size_t, and everything 2's complement, and no perverse implementation-defined behaviour like "the result of converting to int when the argment exceeds INT_MAX is always 42", then (int)0x10000000 is 0. > + uma_zfree(aiocb_zone, aiocbe); > + return (EINVAL); > + } > + > if (aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_KEVENT && > aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_SIGNAL && > aiocbe->uaiocb.aio_sigevent.sigev_notify != SIGEV_THREAD_ID && Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 13:33:28 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81768106564A; Thu, 26 Jan 2012 13:33:28 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 15E908FC1B; Thu, 26 Jan 2012 13:33:27 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0QDXN5R022009 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jan 2012 00:33:26 +1100 Date: Fri, 27 Jan 2012 00:33:23 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem In-Reply-To: <919199278.155166.1327535363109.JavaMail.root@erie.cs.uoguelph.ca> Message-ID: <20120127000316.U1055@besplex.bde.org> References: <919199278.155166.1327535363109.JavaMail.root@erie.cs.uoguelph.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r230516 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 13:33:28 -0000 On Wed, 25 Jan 2012, Rick Macklem wrote: > Bruce Evans wrote: >> On Tue, 24 Jan 2012, Rick Macklem wrote: >> >>> Bruce Evans wrote: >>>> On Wed, 25 Jan 2012, Rick Macklem wrote: >>>> >>>>> Log: >>>>> If a mount -u is done to either NFS client that switches it >>>>> from TCP to UDP and the rsize/wsize/readdirsize is greater >>>>> than NFS_MAXDGRAMDATA, it is possible for a thread doing an >>>>> I/O RPC to get stuck repeatedly doing retries. This happens >>>>> ... >> >>>> Could it wait for the old i/o to complete (and not start any new >>>> i/o?). This is little different from having to wait when changing >>>> from rw to ro. The latter is not easy, and at least the old nfs >>>> client seems to not even dream of it. ffs has always called a >>>> ... >> >>> As you said above "not easy ... uses complicated suspension of i/o". >>> I have not tried to code this, but I think it would be non-trivial. >>> The code would need to block new I/O before RPCs are issued and wait >>> for all in-progress I/Os to complete. At this time, the kernel RPC >>> handles the in-progress RPCs and NFS doesn't "know" what is >>> outstanding. Of course, code could be added to keep track of >>> in-progress >>> I/O RPCs, but that would have to be written, as well. >> >> Hmm, this means that even when the i/o sizes are small, the mode >> switch >> from tcp to udp may be unsafe since there may still be i/o's with >> higher >> sizes outstanding. So to switch from tcp to udp, the user should first >> reduce the sizes, when wait a while before switching to udp. And what >> happens with retries after changing sizes up or down? Does it retry >> with the old sizes? >> >> Bruce > Good point. I think (assuming a TCP mount with large rsize): > # mount -u -o rsize=16384 /mnt > # mount -u -o udp /mnt > - could still result in a wedged thread trying to do a read that > is too large for UDP. > > I'll revert r230516, since it doesn't really fix the problem, it just > reduced its lieklyhood. That seems a regression. > I'll ask on freebsd-fs@ if anyone finds switching from TCP->UDP via a > "mount -u" is useful to them. If no one thinks it's necessary, the patch > could just disallow the switch, no matter what the old rsize/wsize/readdirsize > is. I use it a lot for performance testing. Of course it is unnecessary, since a least for performance testing it is possible to do a full unmount and re-mount, but mount -u is more convenient. > Otherwise, the fix is somewhat involved and difficult for a scenario > like this, where the NFS server is network partitioned or crashed: > - sysadmin notices NFS mount is "hung" and does > # mount -u -o udp /path > to try and fix it, but it doesn't help > - sysadmin tries "umount -f /path" to get rid of the "hung" mount. Now I wonder what makes a full unmount (without without -f) and re-mount work. > If "mount -u -o udp /path" is waiting for I/O ops to complete, > (which is what the somewhat involved patch would need to do) the > "umount -f /path" will get stuck waiting for the "mount -u" > which will be waiting for I/O RPCs to complete. This could I often misremember -f for umount is meaning don't wait. It actually means to forcibly close files before proceeding. > be partially fixed by making sure that the "mount -u -o udp /path" is > interruptible (via C), but I still don't like the idea that > "umount -f /path" won't work if "mount -u -o udp /path" is sitting in > the kernel waiting for RPCs to complete, which would need to be done > to make a TCP->UDP switch work. Doesn't umount -f have to wait for i/o anyway? When it closes files, it must wait for all in-progress i/o for the files, and for all new i/o's that result from closing. Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 13:44:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F8DD106564A; Thu, 26 Jan 2012 13:44:25 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id F40228FC08; Thu, 26 Jan 2012 13:44:24 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id A902546B0D; Thu, 26 Jan 2012 08:44:24 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 40AA6B93F; Thu, 26 Jan 2012 08:44:24 -0500 (EST) From: John Baldwin To: Andrey Chernov Date: Thu, 26 Jan 2012 08:39:07 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <20120126030305.GA80493@vniz.net> <20120126033950.GA80737@vniz.net> In-Reply-To: <20120126033950.GA80737@vniz.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201260839.07855.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 26 Jan 2012 08:44:24 -0500 (EST) Cc: svn-src-head@freebsd.org, David Schultz , src-committers@freebsd.org, Mark Murray , svn-src-all@freebsd.org Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 13:44:25 -0000 On Wednesday, January 25, 2012 10:39:50 pm Andrey Chernov wrote: > On Thu, Jan 26, 2012 at 07:03:05AM +0400, Andrey Chernov wrote: > > On Wed, Jan 25, 2012 at 07:16:41PM +0000, Mark Murray wrote: > > > I thought you were going to do this as a function? It would be > > > slightly neater to do it that way. > > > > > > Looks good! Are you sure this needs no locking or volatile > > > variables? > > > > Now with function, volatile, atomic and even enum: > > Sorry. Reading of state variable should be atomical too. Fixed version: What is the purpose of the atomics? Doing atomic_load/atomic_store is just as racy as if you had not used atomics at all. Should you be using atomic_cmpset instead, e.g.: case ARC4_ENTER_HAVE: /* XXX: What does it mean for this to fail? */ atomic_cmpset_int(&iniseed_state, ARC4_ENTER_NONE, ARC4_ENTER_HAVE); break; -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 13:58:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C62C41065672; Thu, 26 Jan 2012 13:58:59 +0000 (UTC) (envelope-from guy.helmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 79E498FC0A; Thu, 26 Jan 2012 13:58:59 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q0QDwiuQ065362; Thu, 26 Jan 2012 07:58:45 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q0QDwY9G011447 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 26 Jan 2012 07:58:35 -0600 (CST) (envelope-from guy.helmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q0QDwY9G011447 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1327586315; bh=IRuJHAOUnDU6xfzTWlHTF7Ykx+qD9VRSh9tTrxArEMQ=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=XyI3Rbg9jJ2xbtAQEcPfU+2pFEmReXZHQCMdNzsOcGlWeOrfb5GCbfL08lMclY7X1 ysIuh4inmiUhP/hwBODuBbPUbQJyHPC5ce3AH6cQSMhgifEMpZI/jJjsBq/2d0ZukW RrkuBiI39qcUZmMhvw6klJHiBfJ4wVA4tV792avI= Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=iso-8859-1 From: Guy Helmer In-Reply-To: <4F21301F.6030608@FreeBSD.org> Date: Thu, 26 Jan 2012 07:58:35 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <28849462-95FC-455B-8FAE-10B50C41D7ED@palisadesystems.com> References: <201201251450.q0PEoCe8029243@svn.freebsd.org> <4F21301F.6030608@FreeBSD.org> To: Doug Barton X-Mailer: Apple Mail (2.1251.1) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Thu, 26 Jan 2012 07:58:35 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q0QDwY9G011447 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.628, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.27) X-Palisade-MailScanner-From: guy.helmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230541 - head/usr.sbin/daemon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 13:59:00 -0000 On Jan 26, 2012, at 4:51 AM, Doug Barton wrote: > On 01/25/2012 06:50, Guy Helmer wrote: >> Author: ghelmer >> Date: Wed Jan 25 14:50:12 2012 >> New Revision: 230541 >> URL: http://svn.freebsd.org/changeset/base/230541 >>=20 >> Log: >> Revert 229667: After some discussion of this change, it seems it is >> better to leave the pidfile open where it was. Add a note to the >> man page describing pidfile strategies to use if the daemon is to >> be run as a user other than root. >=20 > Did you see the message I sent requesting that you mention the > alternative of pre-creating the pidfile with the right permissions, = and > provided a proposed text to that effect? Sorry, I did not find any concrete suggestion for the text in the = messages I've seen. Is this more suitable? Index: usr.sbin/daemon/daemon.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- usr.sbin/daemon/daemon.8 (revision 230585) +++ usr.sbin/daemon/daemon.8 (working copy) @@ -61,8 +61,9 @@ functionality. If the .Fl u -option is used, the directory to contain the pidfile must be writable -by the specified user. +option is used, either the pidfile needs to have been pre-created +with appropriate ownership and permissions, or the directory to contain +the pidfile must be writable by the specified user. Note, that the file will be created shortly before the process is actually executed, and will remain after the process exits (although it will be removed if the execution fails). -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 14:38:22 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D796D106564A; Thu, 26 Jan 2012 14:38:22 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 3F06E8FC1D; Thu, 26 Jan 2012 14:38:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0QEcKpx091676; Thu, 26 Jan 2012 18:38:20 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0QEcKZs091675; Thu, 26 Jan 2012 18:38:20 +0400 (MSK) (envelope-from ache) Date: Thu, 26 Jan 2012 18:38:20 +0400 From: Andrey Chernov To: John Baldwin Message-ID: <20120126143819.GA88677@vniz.net> Mail-Followup-To: Andrey Chernov , John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126030305.GA80493@vniz.net> <20120126033950.GA80737@vniz.net> <201201260839.07855.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201260839.07855.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, David Schultz , src-committers@FreeBSD.ORG, Mark Murray , svn-src-all@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 14:38:22 -0000 On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote: > What is the purpose of the atomics? Doing atomic_load/atomic_store > is just as racy as if you had not used atomics at all. Thanx for a hint. Protecting comparison itself isn't essential as protecting variable consitency because random_yarrow_unblock() which triggers operation isn't called concurrently, but arc4rand() is. I consider your suggested way a bit later. Yes, it seems acq/rel memory barriers are unneded, > Should you be > using atomic_cmpset instead, e.g.: > > case ARC4_ENTER_HAVE: > /* XXX: What does it mean for this to fail? */ It means "Request to have enough entropy, but already have or even already reseed". > atomic_cmpset_int(&iniseed_state, ARC4_ENTER_NONE, ARC4_ENTER_HAVE); > break; -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 15:36:43 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E6BD1065672; Thu, 26 Jan 2012 15:36:43 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id DDECD8FC18; Thu, 26 Jan 2012 15:36:42 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q0QFaf6o068488; Thu, 26 Jan 2012 19:36:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q0QFafwX068487; Thu, 26 Jan 2012 19:36:41 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 26 Jan 2012 19:36:41 +0400 From: Gleb Smirnoff To: Bruce Evans Message-ID: <20120126153641.GA68112@FreeBSD.org> References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Nq2Wo0NMKNjxTN9z" Content-Disposition: inline In-Reply-To: <20120126233110.C960@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 15:36:43 -0000 --Nq2Wo0NMKNjxTN9z Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Bruce, On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: B> > Log: B> > Although aio_nbytes is size_t, later is is signed to B> > casted types: to ssize_t in filesystem code and to B> > int in buf code, thus supplying a negative argument B> > leads to kernel panic later. B> B> And supplying a large positive argument leads to undefined B> behaviour later in the buf case. B> B> > To fix that check user B> > supplied argument in the beginning of syscall. B> B> Now, supplying a large positive argument gives implementation- B> defined behaviour immediately. Sometimes the implementation- B> defined behaviour is to have no effect immediately and allow B> a panic later. B> B> > Modified: head/sys/kern/vfs_aio.c B> > ============================================================================== B> > --- head/sys/kern/vfs_aio.c Thu Jan 26 11:15:12 2012 (r230582) B> > +++ head/sys/kern/vfs_aio.c Thu Jan 26 11:59:48 2012 (r230583) B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio B> > return (error); B> > } B> > B> > + /* XXX: aio_nbytes is later casted to signed types. */ B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { B> B> This should avoid implementation-defined behaviour by checking if B> B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. B> B> It isn't clear what the effects of the implementation-defined behaviour B> are even when you know what it is. It certainly results in the B> check passing values that exceed INT_MAX. For example, with 32-bit B> int and 64-bit size_t, and everything 2's complement, and no perverse B> implementation-defined behaviour like "the result of converting to B> int when the argment exceeds INT_MAX is always 42", then B> (int)0x10000000 is 0. Is the attached patch okay? -- Totus tuus, Glebius. --Nq2Wo0NMKNjxTN9z Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="vfs_aio.c.diff" Index: vfs_aio.c =================================================================== --- vfs_aio.c (revision 230585) +++ vfs_aio.c (working copy) @@ -1553,7 +1553,7 @@ } /* XXX: aio_nbytes is later casted to signed types. */ - if ((int)aiocbe->uaiocb.aio_nbytes < 0) { + if (aiocbe->uaiocb.aio_nbytes > INT_MAX) { uma_zfree(aiocb_zone, aiocbe); return (EINVAL); } --Nq2Wo0NMKNjxTN9z-- From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 15:42:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05259106566B; Thu, 26 Jan 2012 15:42:45 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 19B4E8FC20; Thu, 26 Jan 2012 15:42:43 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAMBzIU+DaFvO/2dsb2JhbABChQmqRoFyAQEEASMEUhsOCgICDRkCWQaID6YlkWGBL4dqAQUDHAQBCwEIAQYEAwMEEIJ7BQMDAQIHAxUBBQsHAgGBGwmCHoEWBIg/jGCSbw X-IronPort-AV: E=Sophos;i="4.71,574,1320642000"; d="scan'208";a="153825506" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 26 Jan 2012 10:42:42 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id 0503FB3F08; Thu, 26 Jan 2012 10:42:43 -0500 (EST) Date: Thu, 26 Jan 2012 10:42:43 -0500 (EST) From: Rick Macklem To: Bruce Evans Message-ID: <1513888354.186214.1327592563003.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20120127000316.U1055@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.203] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230516 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 15:42:45 -0000 Bruce Evans wrote: > On Wed, 25 Jan 2012, Rick Macklem wrote: > > > Bruce Evans wrote: > >> On Tue, 24 Jan 2012, Rick Macklem wrote: > >> > >>> Bruce Evans wrote: > >>>> On Wed, 25 Jan 2012, Rick Macklem wrote: > >>>> > >>>>> Log: > >>>>> If a mount -u is done to either NFS client that switches it > >>>>> from TCP to UDP and the rsize/wsize/readdirsize is greater > >>>>> than NFS_MAXDGRAMDATA, it is possible for a thread doing an > >>>>> I/O RPC to get stuck repeatedly doing retries. This happens > >>>>> ... > >> > >>>> Could it wait for the old i/o to complete (and not start any new > >>>> i/o?). This is little different from having to wait when changing > >>>> from rw to ro. The latter is not easy, and at least the old nfs > >>>> client seems to not even dream of it. ffs has always called a > >>>> ... > >> > >>> As you said above "not easy ... uses complicated suspension of > >>> i/o". > >>> I have not tried to code this, but I think it would be > >>> non-trivial. > >>> The code would need to block new I/O before RPCs are issued and > >>> wait > >>> for all in-progress I/Os to complete. At this time, the kernel RPC > >>> handles the in-progress RPCs and NFS doesn't "know" what is > >>> outstanding. Of course, code could be added to keep track of > >>> in-progress > >>> I/O RPCs, but that would have to be written, as well. > >> > >> Hmm, this means that even when the i/o sizes are small, the mode > >> switch > >> from tcp to udp may be unsafe since there may still be i/o's with > >> higher > >> sizes outstanding. So to switch from tcp to udp, the user should > >> first > >> reduce the sizes, when wait a while before switching to udp. And > >> what > >> happens with retries after changing sizes up or down? Does it retry > >> with the old sizes? > >> > >> Bruce > > Good point. I think (assuming a TCP mount with large rsize): > > # mount -u -o rsize=16384 /mnt > > # mount -u -o udp /mnt > > - could still result in a wedged thread trying to do a read that > > is too large for UDP. > > > > I'll revert r230516, since it doesn't really fix the problem, it > > just > > reduced its lieklyhood. > > That seems a regression. > > > I'll ask on freebsd-fs@ if anyone finds switching from TCP->UDP via > > a > > "mount -u" is useful to them. If no one thinks it's necessary, the > > patch > > could just disallow the switch, no matter what the old > > rsize/wsize/readdirsize > > is. > > I use it a lot for performance testing. Of course it is unnecessary, > since a least for performance testing it is possible to do a full > unmount and re-mount, but mount -u is more convenient. > > > Otherwise, the fix is somewhat involved and difficult for a scenario > > like this, where the NFS server is network partitioned or crashed: > > - sysadmin notices NFS mount is "hung" and does > > # mount -u -o udp /path > > to try and fix it, but it doesn't help > > - sysadmin tries "umount -f /path" to get rid of the "hung" mount. > > Now I wonder what makes a full unmount (without without -f) and > re-mount work. > If the server is unresponsive (network partitoned or crashed, which was the above scenario), the full unmount won't work if there are RPCs in progress. It will wait indefinitely for those RPCs to complete. > > If "mount -u -o udp /path" is waiting for I/O ops to complete, > > (which is what the somewhat involved patch would need to do) the > > "umount -f /path" will get stuck waiting for the "mount -u" > > which will be waiting for I/O RPCs to complete. This could > > I often misremember -f for umount is meaning don't wait. It actually > means to forcibly close files before proceeding. > > > be partially fixed by making sure that the "mount -u -o udp /path" > > is > > interruptible (via C), but I still don't like the idea that > > "umount -f /path" won't work if "mount -u -o udp /path" is sitting > > in > > the kernel waiting for RPCs to complete, which would need to be done > > to make a TCP->UDP switch work. > > Doesn't umount -f have to wait for i/o anyway? When it closes files, > it must wait for all in-progress i/o for the files, and for all new > i/o's that result from closing. > umount -f kills off RPCs in progress. There was an email discussion about this, where it seemed there was no advantage in defining a separate "hard forced dismount" for this case. So long as "umount -f" makes it as far as nfs_unmount(), I believe this works ok, at least for the new NFS client. If there is already a full "umount" stuck waiting for RPCs to complete, the "umount -f" never makes it as far as nfs_unmount(), so it is stuck, as well. rick From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 15:56:29 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8A51106566B; Thu, 26 Jan 2012 15:56:29 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 269E98FC13; Thu, 26 Jan 2012 15:56:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0QFuRw0092272; Thu, 26 Jan 2012 19:56:27 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0QFuRWe092271; Thu, 26 Jan 2012 19:56:27 +0400 (MSK) (envelope-from ache) Date: Thu, 26 Jan 2012 19:56:27 +0400 From: Andrey Chernov To: John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120126155626.GA92229@vniz.net> Mail-Followup-To: Andrey Chernov , John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126030305.GA80493@vniz.net> <20120126033950.GA80737@vniz.net> <201201260839.07855.jhb@freebsd.org> <20120126143819.GA88677@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120126143819.GA88677@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 15:56:29 -0000 > On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote: > > atomic_cmpset_int(&iniseed_state, ARC4_ENTER_NONE, ARC4_ENTER_HAVE); > > break; Updated version (I hope, final): --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 +++ sys/libkern.h 2012-01-26 19:38:06.000000000 +0400 @@ -72,6 +72,8 @@ static __inline quad_t qabs(quad_t a) { /* Prototypes for non-quad routines. */ struct malloc_type; +enum arc4_is { ARC4_ENTR_NONE, ARC4_ENTR_HAVE, ARC4_ENTR_DONE }; +extern volatile enum arc4_is arc4rand_iniseed_state; uint32_t arc4random(void); void arc4rand(void *ptr, u_int len, int reseed); int bcmp(const void *, const void *, size_t); --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.000000000 +0300 +++ dev/random/randomdev_soft.c 2012-01-26 19:35:12.000000000 +0400 @@ -366,6 +366,8 @@ random_yarrow_unblock(void) selwakeuppri(&random_systat.rsel, PUSER); wakeup(&random_systat); } + (void)atomic_cmpset_int(&arc4rand_iniseed_state, + ARC4_ENTR_NONE, ARC4_ENTR_HAVE); } static int --- libkern/arc4random.c.old 2008-08-08 01:51:09.000000000 +0400 +++ libkern/arc4random.c 2012-01-26 19:43:31.000000000 +0400 @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 #define ARC4_RESEED_SECONDS 300 #define ARC4_KEYBYTES (256 / 8) +volatile enum arc4_is arc4rand_iniseed_state = ARC4_ENTR_NONE; static u_int8_t arc4_i, arc4_j; static int arc4_numruns = 0; static u_int8_t arc4_sbox[256]; @@ -130,7 +131,9 @@ arc4rand(void *ptr, u_int len, int resee struct timeval tv; getmicrouptime(&tv); - if (reseed || + if (atomic_cmpset_int(&arc4rand_iniseed_state, + ARC4_ENTR_HAVE, ARC4_ENTR_DONE) || + reseed || (arc4_numruns > ARC4_RESEED_BYTES) || (tv.tv_sec > arc4_t_reseed)) arc4_randomstir(); -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 16:35:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7ADA106564A; Thu, 26 Jan 2012 16:35:09 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE5828FC0A; Thu, 26 Jan 2012 16:35:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QGZ96s096644; Thu, 26 Jan 2012 16:35:09 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QGZ9mR096638; Thu, 26 Jan 2012 16:35:09 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201261635.q0QGZ9mR096638@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 26 Jan 2012 16:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230587 - in head: share/man/man4 sys/dev/xen/blkback sys/dev/xen/netback sys/kern sys/xen/interface/io X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 16:35:09 -0000 Author: ken Date: Thu Jan 26 16:35:09 2012 New Revision: 230587 URL: http://svn.freebsd.org/changeset/base/230587 Log: Xen netback driver rewrite. share/man/man4/Makefile, share/man/man4/xnb.4, sys/dev/xen/netback/netback.c, sys/dev/xen/netback/netback_unit_tests.c: Rewrote the netback driver for xen to attach properly via newbus and work properly in both HVM and PVM mode (only HVM is tested). Works with the in-tree FreeBSD netfront driver or the Windows netfront driver from SuSE. Has not been extensively tested with a Linux netfront driver. Does not implement LRO, TSO, or polling. Includes unit tests that may be run through sysctl after compiling with XNB_DEBUG defined. sys/dev/xen/blkback/blkback.c, sys/xen/interface/io/netif.h: Comment elaboration. sys/kern/uipc_mbuf.c: Fix page fault in kernel mode when calling m_print() on a null mbuf. Since m_print() is only used for debugging, there are no performance concerns for extra error checking code. sys/kern/subr_scanf.c: Add the "hh" and "ll" width specifiers from C99 to scanf(). A few callers were already using "ll" even though scanf() was handling it as "l". Submitted by: Alan Somers Submitted by: John Suykerbuyk Sponsored by: Spectra Logic MFC after: 1 week Reviewed by: ken Added: head/share/man/man4/xnb.4 (contents, props changed) head/sys/dev/xen/netback/netback_unit_tests.c (contents, props changed) Modified: head/share/man/man4/Makefile head/sys/dev/xen/blkback/blkback.c head/sys/dev/xen/netback/netback.c head/sys/kern/subr_scanf.c head/sys/kern/uipc_mbuf.c head/sys/xen/interface/io/netif.h Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Jan 26 15:23:45 2012 (r230586) +++ head/share/man/man4/Makefile Thu Jan 26 16:35:09 2012 (r230587) @@ -531,6 +531,7 @@ MAN= aac.4 \ ${_xen.4} \ xhci.4 \ xl.4 \ + ${_xnb.4} \ xpt.4 \ zero.4 \ zyd.4 @@ -731,6 +732,7 @@ _urtw.4= urtw.4 _viawd.4= viawd.4 _wpi.4= wpi.4 _xen.4= xen.4 +_xnb.4= xnb.4 MLINKS+=lindev.4 full.4 .endif Added: head/share/man/man4/xnb.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/xnb.4 Thu Jan 26 16:35:09 2012 (r230587) @@ -0,0 +1,134 @@ +.\" Copyright (c) 2012 Spectra Logic Corporation +.\" All rights reserved. +.\" +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions, and the following disclaimer, +.\" without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\" substantially similar to the "NO WARRANTY" disclaimer below +.\" ("Disclaimer") and any redistribution must be conditioned upon +.\" including a substantially similar Disclaimer requirement for further +.\" binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. +.\" +.\" Authors: Alan Somers (Spectra Logic Corporation) +.\" +.\" $FreeBSD$ +.\" + +.Dd January 6, 2012 +.Dt XNB 4 +.Os +.Sh NAME +.Nm xnb +.Nd "Xen Paravirtualized Backend Ethernet Driver" +.Sh SYNOPSIS +To compile this driver into the kernel, place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "options XENHVM" +.Cd "device xenpci" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides the back half of a paravirtualized +.Xr xen 4 +network connection. The netback and netfront drivers appear to their +respective operating systems as Ethernet devices linked by a crossover cable. +Typically, +.Nm +will run on Domain 0 and the netfront driver will run on a guest domain. +However, it is also possible to run +.Nm +on a guest domain. It may be bridged or routed to provide the netfront's +domain access to other guest domains or to a physical network. +.Pp +In most respects, the +.Nm +device appears to the OS as an other Ethernet device. It can be configured at +runtime entirely with +.Xr ifconfig 8 +\&. In particular, it supports MAC changing, arbitrary MTU sizes, checksum +offload for IP, UDP, and TCP for both receive and transmit, and TSO. However, +see +.Sx CAVEATS +before enabling txcsum, rxcsum, or tso. +.Sh SYSCTL VARIABLES +The following read-only variables are available via +.Xr sysctl 8 : +.Bl -tag -width indent +.It Va dev.xnb.%d.dump_rings +Displays information about the ring buffers used to pass requests between the +netfront and netback. Mostly useful for debugging, but can also be used to +get traffic statistics. +.It Va dev.xnb.%d.unit_test_results +Runs a builtin suite of unit tests and displays the results. Does not affect +the operation of the driver in any way. Note that the test suite simulates +error conditions; this will result in error messages being printed to the +system system log. +.Sh CAVEATS +Packets sent through Xennet pass over shared memory, so the protocol includes +no form of link-layer checksum or CRC. Furthermore, Xennet drivers always +report to their hosts that they support receive and transmit checksum +offloading. They "offload" the checksum calculation by simply skipping it. +That works fine for packets that are exchanged between two domains on the same +machine. However, when a Xennet interface is bridged to a physical interface, +a correct checksum must be attached to any packets bound for that physical +interface. Currently, FreeBSD lacks any mechanism for an ethernet device to +inform the OS that newly received packets are valid even though their checksums +are not. So if the netfront driver is configured to offload checksum +calculations, it will pass non-checksumed packets to +.Nm +, which must then calculate the checksum in software before passing the packet +to the OS. +.Pp +For this reason, it is recommended that if +.Nm +is bridged to a physcal interface, then transmit checksum offloading should be +disabled on the netfront. The Xennet protocol does not have any mechanism for +the netback to request the netfront to do this; the operator must do it +manually. +.Sh SEE ALSO +.Xr arp 4 , +.Xr netintro 4 , +.Xr ng_ether 4 , +.Xr ifconfig 8 , +.Xr xen 4 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 10.0 +. +.Sh AUTHORS +The +.Nm +driver was written by +.An Alan Somers +.Aq alans@spectralogic.com +and +.An John Suykerbuyk +.Aq johns@spectralogic.com +.Sh BUGS +The +.Nm +driver does not properly checksum UDP datagrams that span more than one +Ethernet frame. Nor does it correctly checksum IPv6 packets. To workaround +that bug, disable transmit checksum offloading on the netfront driver. Modified: head/sys/dev/xen/blkback/blkback.c ============================================================================== --- head/sys/dev/xen/blkback/blkback.c Thu Jan 26 15:23:45 2012 (r230586) +++ head/sys/dev/xen/blkback/blkback.c Thu Jan 26 16:35:09 2012 (r230587) @@ -3434,6 +3434,10 @@ xbb_shutdown(struct xbb_softc *xbb) DPRINTF("\n"); + /* + * Before unlocking mutex, set this flag to prevent other threads from + * getting into this function + */ xbb->flags |= XBBF_IN_SHUTDOWN; mtx_unlock(&xbb->lock); Modified: head/sys/dev/xen/netback/netback.c ============================================================================== --- head/sys/dev/xen/netback/netback.c Thu Jan 26 15:23:45 2012 (r230586) +++ head/sys/dev/xen/netback/netback.c Thu Jan 26 16:35:09 2012 (r230587) @@ -1,1595 +1,2535 @@ -/* - * Copyright (c) 2006, Cisco Systems, Inc. +/*- + * Copyright (c) 2009-2011 Spectra Logic Corporation * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions + * 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, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Cisco Systems, Inc. nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR 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 DAMAGES. + * + * Authors: Justin T. Gibbs (Spectra Logic Corporation) + * Alan Somers (Spectra Logic Corporation) + * John Suykerbuyk (Spectra Logic Corporation) */ #include __FBSDID("$FreeBSD$"); + +/** + * \file netback.c + * + * \brief Device driver supporting the vending of network access + * from this FreeBSD domain to other domains. + */ +#include "opt_inet.h" +#include "opt_global.h" + #include "opt_sctp.h" #include -#include -#include -#include -#include #include -#include -#include -#include -#include #include +#include +#include +#include +#include #include #include #include -#include #include -#include +#include +#include +#include -#include #include -#include #include +#include +#if __FreeBSD_version >= 700000 #include -#include -#ifdef SCTP -#include -#include #endif +#include +#include +#include -#include -#include +#include +#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include + +#include +#include +#include +#include + +/*--------------------------- Compile-time Tunables --------------------------*/ +/*---------------------------------- Macros ----------------------------------*/ +/** + * Custom malloc type for all driver allocations. + */ +static MALLOC_DEFINE(M_XENNETBACK, "xnb", "Xen Net Back Driver Data"); -#ifdef XEN_NETBACK_DEBUG -#define DPRINTF(fmt, args...) \ - printf("netback (%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) +#define XNB_SG 1 /* netback driver supports feature-sg */ +#define XNB_GSO_TCPV4 1 /* netback driver supports feature-gso-tcpv4 */ +#define XNB_RX_COPY 1 /* netback driver supports feature-rx-copy */ +#define XNB_RX_FLIP 0 /* netback driver does not support feature-rx-flip */ + +#undef XNB_DEBUG +#define XNB_DEBUG /* hardcode on during development */ + +#ifdef XNB_DEBUG +#define DPRINTF(fmt, args...) \ + printf("xnb(%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) #else -#define DPRINTF(fmt, args...) ((void)0) +#define DPRINTF(fmt, args...) do {} while (0) #endif -#ifdef XEN_NETBACK_DEBUG_LOTS -#define DDPRINTF(fmt, args...) \ - printf("netback (%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) -#define DPRINTF_MBUF(_m) print_mbuf(_m, 0) -#define DPRINTF_MBUF_LEN(_m, _len) print_mbuf(_m, _len) -#else -#define DDPRINTF(fmt, args...) ((void)0) -#define DPRINTF_MBUF(_m) ((void)0) -#define DPRINTF_MBUF_LEN(_m, _len) ((void)0) +/* Default length for stack-allocated grant tables */ +#define GNTTAB_LEN (64) + +/* Features supported by all backends. TSO and LRO can be negotiated */ +#define XNB_CSUM_FEATURES (CSUM_TCP | CSUM_UDP) + +#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE) +#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE) + +/** + * Two argument version of the standard macro. Second argument is a tentative + * value of req_cons + */ +#define RING_HAS_UNCONSUMED_REQUESTS_2(_r, cons) ({ \ + unsigned int req = (_r)->sring->req_prod - cons; \ + unsigned int rsp = RING_SIZE(_r) - \ + (cons - (_r)->rsp_prod_pvt); \ + req < rsp ? req : rsp; \ +}) + +#define virt_to_mfn(x) (vtomach(x) >> PAGE_SHIFT) +#define virt_to_offset(x) ((x) & (PAGE_SIZE - 1)) + +/** + * Predefined array type of grant table copy descriptors. Used to pass around + * statically allocated memory structures. + */ +typedef struct gnttab_copy gnttab_copy_table[GNTTAB_LEN]; + +/*--------------------------- Forward Declarations ---------------------------*/ +struct xnb_softc; +struct xnb_pkt; + +static void xnb_attach_failed(struct xnb_softc *xnb, + int err, const char *fmt, ...) + __printflike(3,4); +static int xnb_shutdown(struct xnb_softc *xnb); +static int create_netdev(device_t dev); +static int xnb_detach(device_t dev); +static int xen_net_read_mac(device_t dev, uint8_t mac[]); +static int xnb_ifmedia_upd(struct ifnet *ifp); +static void xnb_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); +static void xnb_intr(void *arg); +static int xnb_send(netif_rx_back_ring_t *rxb, domid_t otherend, + const struct mbuf *mbufc, gnttab_copy_table gnttab); +static int xnb_recv(netif_tx_back_ring_t *txb, domid_t otherend, + struct mbuf **mbufc, struct ifnet *ifnet, + gnttab_copy_table gnttab); +static int xnb_ring2pkt(struct xnb_pkt *pkt, + const netif_tx_back_ring_t *tx_ring, + RING_IDX start); +static void xnb_txpkt2rsp(const struct xnb_pkt *pkt, + netif_tx_back_ring_t *ring, int error); +static struct mbuf *xnb_pkt2mbufc(const struct xnb_pkt *pkt, struct ifnet *ifp); +static int xnb_txpkt2gnttab(const struct xnb_pkt *pkt, + const struct mbuf *mbufc, + gnttab_copy_table gnttab, + const netif_tx_back_ring_t *txb, + domid_t otherend_id); +static void xnb_update_mbufc(struct mbuf *mbufc, + const gnttab_copy_table gnttab, int n_entries); +static int xnb_mbufc2pkt(const struct mbuf *mbufc, + struct xnb_pkt *pkt, + RING_IDX start, int space); +static int xnb_rxpkt2gnttab(const struct xnb_pkt *pkt, + const struct mbuf *mbufc, + gnttab_copy_table gnttab, + const netif_rx_back_ring_t *rxb, + domid_t otherend_id); +static int xnb_rxpkt2rsp(const struct xnb_pkt *pkt, + const gnttab_copy_table gnttab, int n_entries, + netif_rx_back_ring_t *ring); +static void xnb_add_mbuf_cksum(struct mbuf *mbufc); +static void xnb_stop(struct xnb_softc*); +static int xnb_ioctl(struct ifnet*, u_long, caddr_t); +static void xnb_start_locked(struct ifnet*); +static void xnb_start(struct ifnet*); +static void xnb_ifinit_locked(struct xnb_softc*); +static void xnb_ifinit(void*); +#ifdef XNB_DEBUG +static int xnb_unit_test_main(SYSCTL_HANDLER_ARGS); +static int xnb_dump_rings(SYSCTL_HANDLER_ARGS); #endif +/*------------------------------ Data Structures -----------------------------*/ + + +/** + * Representation of a xennet packet. Simplified version of a packet as + * stored in the Xen tx ring. Applicable to both RX and TX packets + */ +struct xnb_pkt{ + /** + * Array index of the first data-bearing (eg, not extra info) entry + * for this packet + */ + RING_IDX car; + + /** + * Array index of the second data-bearing entry for this packet. + * Invalid if the packet has only one data-bearing entry. If the + * packet has more than two data-bearing entries, then the second + * through the last will be sequential modulo the ring size + */ + RING_IDX cdr; -#define WPRINTF(fmt, args...) \ - printf("netback (%s:%d): " fmt, __FUNCTION__, __LINE__, ##args) + /** + * Optional extra info. Only valid if flags contains + * NETTXF_extra_info. Note that extra.type will always be + * XEN_NETIF_EXTRA_TYPE_GSO. Currently, no known netfront or netback + * driver will ever set XEN_NETIF_EXTRA_TYPE_MCAST_* + */ + netif_extra_info_t extra; + + /** Size of entire packet in bytes. */ + uint16_t size; -#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0])) -#define BUG_ON PANIC_IF + /** The size of the first entry's data in bytes */ + uint16_t car_size; -#define IFNAME(_np) (_np)->ifp->if_xname + /** + * Either NETTXF_ or NETRXF_ flags. Note that the flag values are + * not the same for TX and RX packets + */ + uint16_t flags; -#define NET_TX_RING_SIZE __RING_SIZE((netif_tx_sring_t *)0, PAGE_SIZE) -#define NET_RX_RING_SIZE __RING_SIZE((netif_rx_sring_t *)0, PAGE_SIZE) + /** + * The number of valid data-bearing entries (either netif_tx_request's + * or netif_rx_response's) in the packet. If this is 0, it means the + * entire packet is invalid. + */ + uint16_t list_len; -struct ring_ref { - vm_offset_t va; - grant_handle_t handle; - uint64_t bus_addr; + /** There was an error processing the packet */ + uint8_t error; }; -typedef struct netback_info { +/** xnb_pkt method: initialize it */ +static inline void +xnb_pkt_initialize(struct xnb_pkt *pxnb) +{ + bzero(pxnb, sizeof(*pxnb)); +} - /* Schedule lists */ - STAILQ_ENTRY(netback_info) next_tx; - STAILQ_ENTRY(netback_info) next_rx; - int on_tx_sched_list; - int on_rx_sched_list; - - struct xenbus_device *xdev; - XenbusState frontend_state; - - domid_t domid; - int handle; - char *bridge; - - int rings_connected; - struct ring_ref tx_ring_ref; - struct ring_ref rx_ring_ref; - netif_tx_back_ring_t tx; - netif_rx_back_ring_t rx; - evtchn_port_t evtchn; - int irq; - void *irq_cookie; +/** xnb_pkt method: mark the packet as valid */ +static inline void +xnb_pkt_validate(struct xnb_pkt *pxnb) +{ + pxnb->error = 0; +}; - struct ifnet *ifp; - int ref_cnt; +/** xnb_pkt method: mark the packet as invalid */ +static inline void +xnb_pkt_invalidate(struct xnb_pkt *pxnb) +{ + pxnb->error = 1; +}; - device_t ndev; - int attached; -} netif_t; - - -#define MAX_PENDING_REQS 256 -#define PKT_PROT_LEN 64 - -static struct { - netif_tx_request_t req; - netif_t *netif; -} pending_tx_info[MAX_PENDING_REQS]; -static uint16_t pending_ring[MAX_PENDING_REQS]; -typedef unsigned int PEND_RING_IDX; -#define MASK_PEND_IDX(_i) ((_i)&(MAX_PENDING_REQS-1)) -static PEND_RING_IDX pending_prod, pending_cons; -#define NR_PENDING_REQS (MAX_PENDING_REQS - pending_prod + pending_cons) - -static unsigned long mmap_vstart; -#define MMAP_VADDR(_req) (mmap_vstart + ((_req) * PAGE_SIZE)) - -/* Freed TX mbufs get batched on this ring before return to pending_ring. */ -static uint16_t dealloc_ring[MAX_PENDING_REQS]; -static PEND_RING_IDX dealloc_prod, dealloc_cons; - -static multicall_entry_t rx_mcl[NET_RX_RING_SIZE+1]; -static mmu_update_t rx_mmu[NET_RX_RING_SIZE]; -static gnttab_transfer_t grant_rx_op[NET_RX_RING_SIZE]; - -static grant_handle_t grant_tx_handle[MAX_PENDING_REQS]; -static gnttab_unmap_grant_ref_t tx_unmap_ops[MAX_PENDING_REQS]; -static gnttab_map_grant_ref_t tx_map_ops[MAX_PENDING_REQS]; - -static struct task net_tx_task, net_rx_task; -static struct callout rx_task_callout; - -static STAILQ_HEAD(netback_tx_sched_list, netback_info) tx_sched_list = - STAILQ_HEAD_INITIALIZER(tx_sched_list); -static STAILQ_HEAD(netback_rx_sched_list, netback_info) rx_sched_list = - STAILQ_HEAD_INITIALIZER(rx_sched_list); -static struct mtx tx_sched_list_lock; -static struct mtx rx_sched_list_lock; - -static int vif_unit_maker = 0; - -/* Protos */ -static void netback_start(struct ifnet *ifp); -static int netback_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data); -static int vif_add_dev(struct xenbus_device *xdev); -static void disconnect_rings(netif_t *netif); +/** xnb_pkt method: Check whether the packet is valid */ +static inline int +xnb_pkt_is_valid(const struct xnb_pkt *pxnb) +{ + return (! pxnb->error); +} + +#ifdef XNB_DEBUG +/** xnb_pkt method: print the packet's contents in human-readable format*/ +static void __unused +xnb_dump_pkt(const struct xnb_pkt *pkt) { + if (pkt == NULL) { + DPRINTF("Was passed a null pointer.\n"); + return; + } + DPRINTF("pkt address= %p\n", pkt); + DPRINTF("pkt->size=%d\n", pkt->size); + DPRINTF("pkt->car_size=%d\n", pkt->car_size); + DPRINTF("pkt->flags=0x%04x\n", pkt->flags); + DPRINTF("pkt->list_len=%d\n", pkt->list_len); + /* DPRINTF("pkt->extra"); TODO */ + DPRINTF("pkt->car=%d\n", pkt->car); + DPRINTF("pkt->cdr=%d\n", pkt->cdr); + DPRINTF("pkt->error=%d\n", pkt->error); +} +#endif /* XNB_DEBUG */ -#ifdef XEN_NETBACK_DEBUG_LOTS -/* Debug code to display the contents of an mbuf */ static void -print_mbuf(struct mbuf *m, int max) +xnb_dump_txreq(RING_IDX idx, const struct netif_tx_request *txreq) { - int i, j=0; - printf("mbuf %08x len = %d", (unsigned int)m, m->m_pkthdr.len); - for (; m; m = m->m_next) { - unsigned char *d = m->m_data; - for (i=0; i < m->m_len; i++) { - if (max && j == max) - break; - if ((j++ % 16) == 0) - printf("\n%04x:", j); - printf(" %02x", d[i]); - } + if (txreq != NULL) { + DPRINTF("netif_tx_request index =%u\n", idx); + DPRINTF("netif_tx_request.gref =%u\n", txreq->gref); + DPRINTF("netif_tx_request.offset=%hu\n", txreq->offset); + DPRINTF("netif_tx_request.flags =%hu\n", txreq->flags); + DPRINTF("netif_tx_request.id =%hu\n", txreq->id); + DPRINTF("netif_tx_request.size =%hu\n", txreq->size); } - printf("\n"); } -#endif -#define MAX_MFN_ALLOC 64 -static unsigned long mfn_list[MAX_MFN_ALLOC]; -static unsigned int alloc_index = 0; +/** + * \brief Configuration data for a shared memory request ring + * used to communicate with the front-end client of this + * this driver. + */ +struct xnb_ring_config { + /** + * Runtime structures for ring access. Unfortunately, TX and RX rings + * use different data structures, and that cannot be changed since it + * is part of the interdomain protocol. + */ + union{ + netif_rx_back_ring_t rx_ring; + netif_tx_back_ring_t tx_ring; + } back_ring; + + /** + * The device bus address returned by the hypervisor when + * mapping the ring and required to unmap it when a connection + * is torn down. + */ + uint64_t bus_addr; -static unsigned long -alloc_mfn(void) -{ - unsigned long mfn = 0; - struct xen_memory_reservation reservation = { - .extent_start = mfn_list, - .nr_extents = MAX_MFN_ALLOC, - .extent_order = 0, - .domid = DOMID_SELF - }; - if ( unlikely(alloc_index == 0) ) - alloc_index = HYPERVISOR_memory_op( - XENMEM_increase_reservation, &reservation); - if ( alloc_index != 0 ) - mfn = mfn_list[--alloc_index]; - return mfn; -} + /** The pseudo-physical address where ring memory is mapped.*/ + uint64_t gnt_addr; -static unsigned long -alloc_empty_page_range(unsigned long nr_pages) + /** KVA address where ring memory is mapped. */ + vm_offset_t va; + + /** + * Grant table handles, one per-ring page, returned by the + * hyperpervisor upon mapping of the ring and required to + * unmap it when a connection is torn down. + */ + grant_handle_t handle; + + /** The number of ring pages mapped for the current connection. */ + unsigned ring_pages; + + /** + * The grant references, one per-ring page, supplied by the + * front-end, allowing us to reference the ring pages in the + * front-end's domain and to map these pages into our own domain. + */ + grant_ref_t ring_ref; +}; + +/** + * Per-instance connection state flags. + */ +typedef enum { - void *pages; - int i = 0, j = 0; - multicall_entry_t mcl[17]; - unsigned long mfn_list[16]; - struct xen_memory_reservation reservation = { - .extent_start = mfn_list, - .nr_extents = 0, - .address_bits = 0, - .extent_order = 0, - .domid = DOMID_SELF - }; + /** Communication with the front-end has been established. */ + XNBF_RING_CONNECTED = 0x01, + + /** + * Front-end requests exist in the ring and are waiting for + * xnb_xen_req objects to free up. + */ + XNBF_RESOURCE_SHORTAGE = 0x02, - pages = malloc(nr_pages*PAGE_SIZE, M_DEVBUF, M_NOWAIT); - if (pages == NULL) - return 0; + /** Connection teardown has started. */ + XNBF_SHUTDOWN = 0x04, - memset(mcl, 0, sizeof(mcl)); + /** A thread is already performing shutdown processing. */ + XNBF_IN_SHUTDOWN = 0x08 +} xnb_flag_t; - while (i < nr_pages) { - unsigned long va = (unsigned long)pages + (i++ * PAGE_SIZE); +/** + * Types of rings. Used for array indices and to identify a ring's control + * data structure type + */ +typedef enum{ + XNB_RING_TYPE_TX = 0, /* ID of TX rings, used for array indices */ + XNB_RING_TYPE_RX = 1, /* ID of RX rings, used for array indices */ + XNB_NUM_RING_TYPES +} xnb_ring_type_t; - mcl[j].op = __HYPERVISOR_update_va_mapping; - mcl[j].args[0] = va; +/** + * Per-instance configuration data. + */ +struct xnb_softc { + /** NewBus device corresponding to this instance. */ + device_t dev; + + /* Media related fields */ + + /** Generic network media state */ + struct ifmedia sc_media; + + /** Media carrier info */ + struct ifnet *xnb_ifp; + + /** Our own private carrier state */ + unsigned carrier; + + /** Device MAC Address */ + uint8_t mac[ETHER_ADDR_LEN]; + + /* Xen related fields */ + + /** + * \brief The netif protocol abi in effect. + * + * There are situations where the back and front ends can + * have a different, native abi (e.g. intel x86_64 and + * 32bit x86 domains on the same machine). The back-end + * always accomodates the front-end's native abi. That + * value is pulled from the XenStore and recorded here. + */ + int abi; - mfn_list[j++] = vtomach(va) >> PAGE_SHIFT; + /** + * Name of the bridge to which this VIF is connected, if any + * This field is dynamically allocated by xenbus and must be free()ed + * when no longer needed + */ + char *bridge; - xen_phys_machine[(vtophys(va) >> PAGE_SHIFT)] = INVALID_P2M_ENTRY; + /** The interrupt driven even channel used to signal ring events. */ + evtchn_port_t evtchn; - if (j == 16 || i == nr_pages) { - mcl[j-1].args[MULTI_UVMFLAGS_INDEX] = UVMF_TLB_FLUSH|UVMF_LOCAL; + /** Xen device handle.*/ + long handle; - reservation.nr_extents = j; + /** IRQ mapping for the communication ring event channel. */ + int irq; + + /** + * \brief Cached value of the front-end's domain id. + * + * This value is used at once for each mapped page in + * a transaction. We cache it to avoid incuring the + * cost of an ivar access every time this is needed. + */ + domid_t otherend_id; - mcl[j].op = __HYPERVISOR_memory_op; - mcl[j].args[0] = XENMEM_decrease_reservation; - mcl[j].args[1] = (unsigned long)&reservation; - - (void)HYPERVISOR_multicall(mcl, j+1); + /** + * Undocumented frontend feature. Has something to do with + * scatter/gather IO + */ + uint8_t can_sg; + /** Undocumented frontend feature */ + uint8_t gso; + /** Undocumented frontend feature */ + uint8_t gso_prefix; + /** Can checksum TCP/UDP over IPv4 */ + uint8_t ip_csum; + + /* Implementation related fields */ + /** + * Preallocated grant table copy descriptor for RX operations. + * Access must be protected by rx_lock + */ + gnttab_copy_table rx_gnttab; - mcl[j-1].args[MULTI_UVMFLAGS_INDEX] = 0; - j = 0; - } - } + /** + * Preallocated grant table copy descriptor for TX operations. + * Access must be protected by tx_lock + */ + gnttab_copy_table tx_gnttab; - return (unsigned long)pages; -} +#ifdef XENHVM + /** + * Resource representing allocated physical address space + * associated with our per-instance kva region. + */ + struct resource *pseudo_phys_res; -#ifdef XEN_NETBACK_FIXUP_CSUM -static void -fixup_checksum(struct mbuf *m) -{ - struct ether_header *eh = mtod(m, struct ether_header *); - struct ip *ip = (struct ip *)(eh + 1); - int iphlen = ip->ip_hl << 2; - int iplen = ntohs(ip->ip_len); - - if ((m->m_pkthdr.csum_flags & CSUM_TCP)) { - struct tcphdr *th = (struct tcphdr *)((caddr_t)ip + iphlen); - th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(IPPROTO_TCP + (iplen - iphlen))); - th->th_sum = in_cksum_skip(m, iplen + sizeof(*eh), sizeof(*eh) + iphlen); - m->m_pkthdr.csum_flags &= ~CSUM_TCP; -#ifdef SCTP - } else if (sw_csum & CSUM_SCTP) { - sctp_delayed_cksum(m, iphlen); - sw_csum &= ~CSUM_SCTP; -#endif - } else { - u_short csum; - struct udphdr *uh = (struct udphdr *)((caddr_t)ip + iphlen); - uh->uh_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, - htons(IPPROTO_UDP + (iplen - iphlen))); - if ((csum = in_cksum_skip(m, iplen + sizeof(*eh), sizeof(*eh) + iphlen)) == 0) - csum = 0xffff; - uh->uh_sum = csum; - m->m_pkthdr.csum_flags &= ~CSUM_UDP; - } -} + /** Resource id for allocated physical address space. */ + int pseudo_phys_res_id; #endif -/* Add the interface to the specified bridge */ -static int -add_to_bridge(struct ifnet *ifp, char *bridge) -{ - struct ifdrv ifd; - struct ifbreq ifb; - struct ifnet *ifp_bridge = ifunit(bridge); + /** Ring mapping and interrupt configuration data. */ + struct xnb_ring_config ring_configs[XNB_NUM_RING_TYPES]; - if (!ifp_bridge) - return ENOENT; + /** + * Global pool of kva used for mapping remote domain ring + * and I/O transaction data. + */ + vm_offset_t kva; - bzero(&ifd, sizeof(ifd)); - bzero(&ifb, sizeof(ifb)); + /** Psuedo-physical address corresponding to kva. */ + uint64_t gnt_base_addr; - strcpy(ifb.ifbr_ifsname, ifp->if_xname); - strcpy(ifd.ifd_name, ifp->if_xname); - ifd.ifd_cmd = BRDGADD; - ifd.ifd_len = sizeof(ifb); - ifd.ifd_data = &ifb; + /** Various configuration and state bit flags. */ + xnb_flag_t flags; - return bridge_ioctl_kern(ifp_bridge, SIOCSDRVSPEC, &ifd); - -} + /** Mutex protecting per-instance data in the receive path. */ + struct mtx rx_lock; -static int -netif_create(int handle, struct xenbus_device *xdev, char *bridge) -{ - netif_t *netif; - struct ifnet *ifp; + /** Mutex protecting per-instance data in the softc structure. */ + struct mtx sc_lock; - netif = (netif_t *)malloc(sizeof(*netif), M_DEVBUF, M_NOWAIT | M_ZERO); - if (!netif) - return ENOMEM; + /** Mutex protecting per-instance data in the transmit path. */ + struct mtx tx_lock; - netif->ref_cnt = 1; - netif->handle = handle; - netif->domid = xdev->otherend_id; - netif->xdev = xdev; - netif->bridge = bridge; - xdev->data = netif; - - /* Set up ifnet structure */ - ifp = netif->ifp = if_alloc(IFT_ETHER); - if (!ifp) { - if (bridge) - free(bridge, M_DEVBUF); - free(netif, M_DEVBUF); - return ENOMEM; - } + /** The size of the global kva pool. */ + int kva_size; +}; - ifp->if_softc = netif; - if_initname(ifp, "vif", - atomic_fetchadd_int(&vif_unit_maker, 1) /* ifno */ ); - ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX; - ifp->if_output = ether_output; - ifp->if_start = netback_start; - ifp->if_ioctl = netback_ioctl; - ifp->if_snd.ifq_maxlen = NET_TX_RING_SIZE - 1; - - DPRINTF("Created %s for domid=%d handle=%d\n", IFNAME(netif), netif->domid, netif->handle); +/*---------------------------- Debugging functions ---------------------------*/ +#ifdef XNB_DEBUG +static void __unused +xnb_dump_gnttab_copy(const struct gnttab_copy *entry) +{ + if (entry == NULL) { + printf("NULL grant table pointer\n"); + return; + } - return 0; + if (entry->flags & GNTCOPY_dest_gref) + printf("gnttab dest ref=\t%u\n", entry->dest.u.ref); + else *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 16:40:52 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C47EF106564A; Thu, 26 Jan 2012 16:40:52 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 94ED38FC17; Thu, 26 Jan 2012 16:40:52 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 4B74146B37; Thu, 26 Jan 2012 11:40:52 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 9A019B940; Thu, 26 Jan 2012 11:40:51 -0500 (EST) From: John Baldwin To: Andrey Chernov Date: Thu, 26 Jan 2012 11:32:38 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> In-Reply-To: <20120126155626.GA92229@vniz.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201201261132.38320.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 26 Jan 2012 11:40:51 -0500 (EST) Cc: svn-src-head@freebsd.org, David Schultz , src-committers@freebsd.org, Mark Murray , svn-src-all@freebsd.org Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 16:40:52 -0000 On Thursday, January 26, 2012 10:56:27 am Andrey Chernov wrote: > > On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote: > > > atomic_cmpset_int(&iniseed_state, ARC4_ENTER_NONE, ARC4_ENTER_HAVE); > > > break; > > Updated version (I hope, final): > > --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 > +++ sys/libkern.h 2012-01-26 19:38:06.000000000 +0400 > @@ -72,6 +72,8 @@ static __inline quad_t qabs(quad_t a) { > > /* Prototypes for non-quad routines. */ > struct malloc_type; > +enum arc4_is { ARC4_ENTR_NONE, ARC4_ENTR_HAVE, ARC4_ENTR_DONE }; > +extern volatile enum arc4_is arc4rand_iniseed_state; Atomics don't operate on enums. You'll need to make it an int and just use #define's for the 3 states. > uint32_t arc4random(void); > void arc4rand(void *ptr, u_int len, int reseed); > int bcmp(const void *, const void *, size_t); > --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.000000000 +0300 > +++ dev/random/randomdev_soft.c 2012-01-26 19:35:12.000000000 +0400 > @@ -366,6 +366,8 @@ random_yarrow_unblock(void) > selwakeuppri(&random_systat.rsel, PUSER); > wakeup(&random_systat); > } > + (void)atomic_cmpset_int(&arc4rand_iniseed_state, > + ARC4_ENTR_NONE, ARC4_ENTR_HAVE); > } > > static int > --- libkern/arc4random.c.old 2008-08-08 01:51:09.000000000 +0400 > +++ libkern/arc4random.c 2012-01-26 19:43:31.000000000 +0400 > @@ -24,6 +24,7 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 > #define ARC4_RESEED_SECONDS 300 > #define ARC4_KEYBYTES (256 / 8) > > +volatile enum arc4_is arc4rand_iniseed_state = ARC4_ENTR_NONE; > static u_int8_t arc4_i, arc4_j; > static int arc4_numruns = 0; > static u_int8_t arc4_sbox[256]; > @@ -130,7 +131,9 @@ arc4rand(void *ptr, u_int len, int resee > struct timeval tv; > > getmicrouptime(&tv); > - if (reseed || > + if (atomic_cmpset_int(&arc4rand_iniseed_state, > + ARC4_ENTR_HAVE, ARC4_ENTR_DONE) || > + reseed || > (arc4_numruns > ARC4_RESEED_BYTES) || > (tv.tv_sec > arc4_t_reseed)) > arc4_randomstir(); I think the rest of this is fine. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 16:55:23 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEEC5106564A; Thu, 26 Jan 2012 16:55:23 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 492228FC13; Thu, 26 Jan 2012 16:55:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0QGtLOJ092677; Thu, 26 Jan 2012 20:55:21 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0QGtLwP092676; Thu, 26 Jan 2012 20:55:21 +0400 (MSK) (envelope-from ache) Date: Thu, 26 Jan 2012 20:55:21 +0400 From: Andrey Chernov To: John Baldwin Message-ID: <20120126165521.GA92622@vniz.net> Mail-Followup-To: Andrey Chernov , John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201261132.38320.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, David Schultz , src-committers@FreeBSD.ORG, Mark Murray , svn-src-all@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 16:55:24 -0000 On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote: > On Thursday, January 26, 2012 10:56:27 am Andrey Chernov wrote: > > > On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote: > > > > atomic_cmpset_int(&iniseed_state, ARC4_ENTER_NONE, > ARC4_ENTER_HAVE); > > > > break; > > > > Updated version (I hope, final): > > > > --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 > > +++ sys/libkern.h 2012-01-26 19:38:06.000000000 +0400 > > @@ -72,6 +72,8 @@ static __inline quad_t qabs(quad_t a) { > > > > /* Prototypes for non-quad routines. */ > > struct malloc_type; > > +enum arc4_is { ARC4_ENTR_NONE, ARC4_ENTR_HAVE, ARC4_ENTR_DONE }; > > +extern volatile enum arc4_is arc4rand_iniseed_state; > > Atomics don't operate on enums. You'll need to make it an int and just use > #define's for the 3 states. Although current version with current kernel flags works, I forget it is implementation defined in general and not always equal to sizeof(int), f.e. with gcc --short-enums. I'll remade it with #defines, thanx again. > I think the rest of this is fine. > > -- > John Baldwin -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 17:00:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 397511065670; Thu, 26 Jan 2012 17:00:09 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh7.mail.rice.edu (mh7.mail.rice.edu [128.42.199.46]) by mx1.freebsd.org (Postfix) with ESMTP id D8CF58FC08; Thu, 26 Jan 2012 17:00:08 +0000 (UTC) Received: from mh7.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh7.mail.rice.edu (Postfix) with ESMTP id D87EF292127; Thu, 26 Jan 2012 10:40:44 -0600 (CST) Received: from mh7.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh7.mail.rice.edu (Postfix) with ESMTP id BEF20292120; Thu, 26 Jan 2012 10:40:44 -0600 (CST) X-Virus-Scanned: by amavis-2.6.4 at mh7.mail.rice.edu, auth channel Received: from mh7.mail.rice.edu ([127.0.0.1]) by mh7.mail.rice.edu (mh7.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 0TSlnbk0wtfe; Thu, 26 Jan 2012 10:40:44 -0600 (CST) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh7.mail.rice.edu (Postfix) with ESMTPSA id 2B52029212E; Thu, 26 Jan 2012 10:40:44 -0600 (CST) Message-ID: <4F21820B.8040000@rice.edu> Date: Thu, 26 Jan 2012 10:40:43 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: Luigi Rizzo References: <201201260955.q0Q9tG1m075353@svn.freebsd.org> In-Reply-To: <201201260955.q0Q9tG1m075353@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230572 - in head/sys/dev: ixgbe netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 17:00:09 -0000 On 01/26/2012 03:55, Luigi Rizzo wrote: > Author: luigi > Date: Thu Jan 26 09:55:16 2012 > New Revision: 230572 > URL: http://svn.freebsd.org/changeset/base/230572 > > Log: > ixgbe changes: > - remove experimental code for disabling CRC > - use the correct constant for conversion between interrupt rate > and EITR values (the previous values were off by a factor of 2) > - make dev.ix.N.queueM.interrupt_rate a RW sysctl variable. > Changing individual values affects the queue immediately, > and propagates to all interfaces at the next reinit. > - add dev.ix.N.queueM.irqs rdonly sysctl, to export the actual > interrupt counts > > Netmap-related changes for ixgbe: > - use the "new" format for TX descriptors in netmap mode. > - pass interrupt mitigation delays to the user process doing poll() > on a netmap file descriptor. > On the RX side this means we will not check the ring more than once > per interrupt. This gives the process a chance to sleep and process > packets in larger batches, thus reducing CPU usage. > On the TX side we take this even further: completed transmissions are > reclaimed every half ring even if the NIC interrupts more often. > This saves even more CPU without any additional tx delays. > > Generic Netmap-related changes: > - align the netmap_kring to cache lines so that there is no false sharing > (possibly useful for multiqueue NICs and MSIX interrupts, which are > handled by different cores). It's a minor improvement but it does not > cost anything. > > Reviewed by: Jack Vogel > Approved by: Jack Vogel > > Modified: > head/sys/dev/ixgbe/ixgbe.c > head/sys/dev/netmap/ixgbe_netmap.h > head/sys/dev/netmap/netmap.c > head/sys/dev/netmap/netmap_kern.h *snip* > > Modified: head/sys/dev/netmap/netmap_kern.h > ============================================================================== > --- head/sys/dev/netmap/netmap_kern.h Thu Jan 26 09:45:14 2012 (r230571) > +++ head/sys/dev/netmap/netmap_kern.h Thu Jan 26 09:55:16 2012 (r230572) > @@ -65,13 +65,14 @@ struct netmap_kring { > struct netmap_ring *ring; > u_int nr_hwcur; > int nr_hwavail; > - u_int nr_kflags; > + u_int nr_kflags; /* private driver flags */ > +#define NKR_PENDINTR 0x1 // Pending interrupt. > u_int nkr_num_slots; > > int nkr_hwofs; /* offset between NIC and netmap ring */ > struct netmap_adapter *na; // debugging > struct selinfo si; /* poll/select wait queue */ > -}; > +} __attribute__((__aligned__(64))); The machine-dependent param.h defines CACHE_LINE_SIZE for use in situations like this. Alan From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 17:04:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15CC6106566C; Thu, 26 Jan 2012 17:04:18 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D9A3C8FC1B; Thu, 26 Jan 2012 17:04:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QH4HHx097611; Thu, 26 Jan 2012 17:04:17 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QH4Hna097608; Thu, 26 Jan 2012 17:04:17 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201201261704.q0QH4Hna097608@svn.freebsd.org> From: Sean Bruno Date: Thu, 26 Jan 2012 17:04:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230588 - in head: share/man/man4 sys/dev/ciss X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 17:04:18 -0000 Author: sbruno Date: Thu Jan 26 17:04:17 2012 New Revision: 230588 URL: http://svn.freebsd.org/changeset/base/230588 Log: Update PCI IDs for ciss controllers that are supported by this driver. Submitted by: scott.benesh@hp.com Obtained from: Yahoo! Inc and HP MFC after: 1 week Modified: head/share/man/man4/ciss.4 head/sys/dev/ciss/ciss.c Modified: head/share/man/man4/ciss.4 ============================================================================== --- head/share/man/man4/ciss.4 Thu Jan 26 16:35:09 2012 (r230587) +++ head/share/man/man4/ciss.4 Thu Jan 26 17:04:17 2012 (r230588) @@ -2,7 +2,7 @@ .\" Written by Tom Rhodes .\" This file is in the public domain. .\" -.Dd January 18, 2012 +.Dd January 26, 2012 .Dt CISS 4 .Os .Sh NAME @@ -121,6 +121,10 @@ HP Smart Array E200i .It HP Smart Array P212 .It +HP Smart Array P220i +.It +HP Smart Array P222 +.It HP Smart Array P400 .It HP Smart Array P400i @@ -133,8 +137,14 @@ HP Smart Array P411 .It HP Smart Array P420 .It +HP Smart Array P420i +.It +HP Smart Array P421 +.It HP Smart Array P600 .It +HP Smart Array P721m +.It HP Smart Array P800 .It HP Smart Array P812 Modified: head/sys/dev/ciss/ciss.c ============================================================================== --- head/sys/dev/ciss/ciss.c Thu Jan 26 16:35:09 2012 (r230587) +++ head/sys/dev/ciss/ciss.c Thu Jan 26 17:04:17 2012 (r230588) @@ -329,7 +329,13 @@ static struct { 0x103C, 0x3249, CISS_BOARD_SA5, "HP Smart Array P812" }, { 0x103C, 0x324A, CISS_BOARD_SA5, "HP Smart Array P712m" }, { 0x103C, 0x324B, CISS_BOARD_SA5, "HP Smart Array" }, - { 0x103C, 0x3351, CISS_BOARD_SA5, "HP Smart Array P420" }, + { 0x103C, 0x3350, CISS_BOARD_SA5, "HP Smart Array P222" }, + { 0x103C, 0x3351, CISS_BOARD_SA5, "HP Smart Array P420" }, + { 0x103C, 0x3352, CISS_BOARD_SA5, "HP Smart Array P421" }, + { 0x103C, 0x3353, CISS_BOARD_SA5, "HP Smart Array P822" }, + { 0x103C, 0x3354, CISS_BOARD_SA5, "HP Smart Array P420i" }, + { 0x103C, 0x3355, CISS_BOARD_SA5, "HP Smart Array P220i" }, + { 0x103C, 0x3356, CISS_BOARD_SA5, "HP Smart Array P721m" }, { 0, 0, 0, NULL } }; @@ -4536,7 +4542,8 @@ ciss_ioctl(struct cdev *dev, u_long cmd, pis->bus = pci_get_bus(sc->ciss_dev); pis->dev_fn = pci_get_slot(sc->ciss_dev); - pis->board_id = pci_get_devid(sc->ciss_dev); + pis->board_id = (pci_get_subvendor(sc->ciss_dev) << 16) | + pci_get_subdevice(sc->ciss_dev); break; } From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 17:28:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED024106566C; Thu, 26 Jan 2012 17:28:33 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D66B48FC14; Thu, 26 Jan 2012 17:28:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QHSXWb098361; Thu, 26 Jan 2012 17:28:33 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QHSXLS098359; Thu, 26 Jan 2012 17:28:33 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201261728.q0QHSXLS098359@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 26 Jan 2012 17:28:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230589 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 17:28:34 -0000 Author: ken Date: Thu Jan 26 17:28:33 2012 New Revision: 230589 URL: http://svn.freebsd.org/changeset/base/230589 Log: Start sentences on a new line, and fix a few other nits. Prompted by: gjb MFC after: 1 week Modified: head/share/man/man4/xnb.4 Modified: head/share/man/man4/xnb.4 ============================================================================== --- head/share/man/man4/xnb.4 Thu Jan 26 17:04:17 2012 (r230588) +++ head/share/man/man4/xnb.4 Thu Jan 26 17:28:33 2012 (r230589) @@ -1,6 +1,5 @@ .\" Copyright (c) 2012 Spectra Logic Corporation -.\" All rights reserved. -.\" +.\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -30,7 +29,7 @@ .\" Authors: Alan Somers (Spectra Logic Corporation) .\" .\" $FreeBSD$ -.\" +.\" .Dd January 6, 2012 .Dt XNB 4 @@ -50,24 +49,26 @@ The .Nm driver provides the back half of a paravirtualized .Xr xen 4 -network connection. The netback and netfront drivers appear to their -respective operating systems as Ethernet devices linked by a crossover cable. +network connection. +The netback and netfront drivers appear to their respective operating +systems as Ethernet devices linked by a crossover cable. Typically, .Nm will run on Domain 0 and the netfront driver will run on a guest domain. However, it is also possible to run .Nm -on a guest domain. It may be bridged or routed to provide the netfront's +on a guest domain. +It may be bridged or routed to provide the netfront's domain access to other guest domains or to a physical network. .Pp In most respects, the .Nm -device appears to the OS as an other Ethernet device. It can be configured at -runtime entirely with -.Xr ifconfig 8 -\&. In particular, it supports MAC changing, arbitrary MTU sizes, checksum -offload for IP, UDP, and TCP for both receive and transmit, and TSO. However, -see +device appears to the OS as an other Ethernet device. +It can be configured at runtime entirely with +.Xr ifconfig 8 . +In particular, it supports MAC changing, arbitrary MTU sizes, checksum +offload for IP, UDP, and TCP for both receive and transmit, and TSO. +However, see .Sx CAVEATS before enabling txcsum, rxcsum, or tso. .Sh SYSCTL VARIABLES @@ -76,47 +77,51 @@ The following read-only variables are av .Bl -tag -width indent .It Va dev.xnb.%d.dump_rings Displays information about the ring buffers used to pass requests between the -netfront and netback. Mostly useful for debugging, but can also be used to +netfront and netback. +Mostly useful for debugging, but can also be used to get traffic statistics. .It Va dev.xnb.%d.unit_test_results -Runs a builtin suite of unit tests and displays the results. Does not affect -the operation of the driver in any way. Note that the test suite simulates -error conditions; this will result in error messages being printed to the -system system log. +Runs a builtin suite of unit tests and displays the results. +Does not affect the operation of the driver in any way. +Note that the test suite simulates error conditions; this will result in +error messages being printed to the system system log. .Sh CAVEATS Packets sent through Xennet pass over shared memory, so the protocol includes -no form of link-layer checksum or CRC. Furthermore, Xennet drivers always -report to their hosts that they support receive and transmit checksum -offloading. They "offload" the checksum calculation by simply skipping it. +no form of link-layer checksum or CRC. +Furthermore, Xennet drivers always report to their hosts that they support +receive and transmit checksum offloading. +They "offload" the checksum calculation by simply skipping it. That works fine for packets that are exchanged between two domains on the same -machine. However, when a Xennet interface is bridged to a physical interface, +machine. +However, when a Xennet interface is bridged to a physical interface, a correct checksum must be attached to any packets bound for that physical -interface. Currently, FreeBSD lacks any mechanism for an ethernet device to +interface. +Currently, FreeBSD lacks any mechanism for an ethernet device to inform the OS that newly received packets are valid even though their checksums -are not. So if the netfront driver is configured to offload checksum -calculations, it will pass non-checksumed packets to -.Nm -, which must then calculate the checksum in software before passing the packet +are not. +So if the netfront driver is configured to offload checksum calculations, +it will pass non-checksumed packets to +.Nm , +which must then calculate the checksum in software before passing the packet to the OS. .Pp For this reason, it is recommended that if .Nm is bridged to a physcal interface, then transmit checksum offloading should be -disabled on the netfront. The Xennet protocol does not have any mechanism for -the netback to request the netfront to do this; the operator must do it -manually. +disabled on the netfront. +The Xennet protocol does not have any mechanism for the netback to request +the netfront to do this; the operator must do it manually. .Sh SEE ALSO .Xr arp 4 , .Xr netintro 4 , .Xr ng_ether 4 , -.Xr ifconfig 8 , -.Xr xen 4 +.Xr xen 4 , +.Xr ifconfig 8 .Sh HISTORY The .Nm device driver first appeared in -.Fx 10.0 -. +.Fx 10.0 . .Sh AUTHORS The .Nm @@ -130,5 +135,7 @@ and The .Nm driver does not properly checksum UDP datagrams that span more than one -Ethernet frame. Nor does it correctly checksum IPv6 packets. To workaround -that bug, disable transmit checksum offloading on the netfront driver. +Ethernet frame. +Nor does it correctly checksum IPv6 packets. +To workaround that bug, disable transmit checksum offloading on the +netfront driver. From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 17:50:23 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E55CC106566B; Thu, 26 Jan 2012 17:50:23 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 3939B8FC0C; Thu, 26 Jan 2012 17:50:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0QHoLrs093036; Thu, 26 Jan 2012 21:50:21 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0QHoLPX093035; Thu, 26 Jan 2012 21:50:21 +0400 (MSK) (envelope-from ache) Date: Thu, 26 Jan 2012 21:50:21 +0400 From: Andrey Chernov To: John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120126175021.GA93016@vniz.net> Mail-Followup-To: Andrey Chernov , John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120126165521.GA92622@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 17:50:24 -0000 > On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote: > > Atomics don't operate on enums. You'll need to make it an int and just use > > #define's for the 3 states. --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 +++ sys/libkern.h 2012-01-26 21:40:21.000000000 +0400 @@ -72,6 +72,10 @@ static __inline quad_t qabs(quad_t a) { /* Prototypes for non-quad routines. */ struct malloc_type; +#define ARC4_ENTR_NONE 0 /* Don't have entropy yet. */ +#define ARC4_ENTR_HAVE 1 /* Have entropy. */ +#define ARC4_ENTR_SEED 2 /* Reseeding. */ +extern volatile int arc4rand_iniseed_state; uint32_t arc4random(void); void arc4rand(void *ptr, u_int len, int reseed); int bcmp(const void *, const void *, size_t); --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.000000000 +0300 +++ dev/random/randomdev_soft.c 2012-01-26 19:35:12.000000000 +0400 @@ -366,6 +366,8 @@ random_yarrow_unblock(void) selwakeuppri(&random_systat.rsel, PUSER); wakeup(&random_systat); } + (void)atomic_cmpset_int(&arc4rand_iniseed_state, + ARC4_ENTR_NONE, ARC4_ENTR_HAVE); } static int --- libkern/arc4random.c.old 2008-08-08 01:51:09.000000000 +0400 +++ libkern/arc4random.c 2012-01-26 21:40:47.000000000 +0400 @@ -24,6 +24,8 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 #define ARC4_RESEED_SECONDS 300 #define ARC4_KEYBYTES (256 / 8) +volatile int arc4rand_iniseed_state = ARC4_ENTR_NONE; + static u_int8_t arc4_i, arc4_j; static int arc4_numruns = 0; static u_int8_t arc4_sbox[256]; @@ -130,7 +132,9 @@ arc4rand(void *ptr, u_int len, int resee struct timeval tv; getmicrouptime(&tv); - if (reseed || + if (atomic_cmpset_int(&arc4rand_iniseed_state, + ARC4_ENTR_HAVE, ARC4_ENTR_SEED) || + reseed || (arc4_numruns > ARC4_RESEED_BYTES) || (tv.tv_sec > arc4_t_reseed)) arc4_randomstir(); -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 17:52:44 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BD8E1065672; Thu, 26 Jan 2012 17:52:44 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id 32DF98FC0A; Thu, 26 Jan 2012 17:52:43 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0QHqhV4019352; Thu, 26 Jan 2012 12:52:43 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0QHqhil019351; Thu, 26 Jan 2012 12:52:43 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Thu, 26 Jan 2012 12:52:43 -0500 From: David Schultz To: Andrey Chernov , John Baldwin , Mark Murray , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120126175243.GA19199@zim.MIT.EDU> Mail-Followup-To: Andrey Chernov , John Baldwin , Mark Murray , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120126165521.GA92622@vniz.net> Cc: Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 17:52:44 -0000 On Thu, Jan 26, 2012, Andrey Chernov wrote: > On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote: > > On Thursday, January 26, 2012 10:56:27 am Andrey Chernov wrote: > > > > On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote: > > > > > atomic_cmpset_int(&iniseed_state, ARC4_ENTER_NONE, > > ARC4_ENTER_HAVE); > > > > > break; > > > > > > Updated version (I hope, final): > > > > > > --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 > > > +++ sys/libkern.h 2012-01-26 19:38:06.000000000 +0400 > > > @@ -72,6 +72,8 @@ static __inline quad_t qabs(quad_t a) { > > > > > > /* Prototypes for non-quad routines. */ > > > struct malloc_type; > > > +enum arc4_is { ARC4_ENTR_NONE, ARC4_ENTR_HAVE, ARC4_ENTR_DONE }; > > > +extern volatile enum arc4_is arc4rand_iniseed_state; > > > > Atomics don't operate on enums. You'll need to make it an int and just use > > #define's for the 3 states. > > Although current version with current kernel flags works, I forget it is > implementation defined in general and not always equal to sizeof(int), > f.e. with gcc --short-enums. I'll remade it with #defines, thanx again. Why complicate things with atomics at all? A race might result in arc4random(9) being seeded multiple times, but that's harmless. The race that worries me is that consumers that call arc4random() before it is properly seeded will get predictable numbers. To fix that robustly, we'd either have to move arc4random() into the random module (tricky given all the places where it's used), or make the random module a mandatory part of the kernel. OpenSSL addresses the issue by providing two APIs: RAND_bytes() requires a good entropy source and produces cryptographically strong pseudorandomness. RAND_pseudo_bytes() produces "good" (but not necessarily unpredictable) randomness, even in the absence of an entropy source. Applications call one interface or the other, depending on whether they require cryptographic- quality randomness. From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 17:55:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D535D106564A; Thu, 26 Jan 2012 17:55:34 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep33.mx.upcmail.net (fep33.mx.upcmail.net [62.179.121.51]) by mx1.freebsd.org (Postfix) with ESMTP id 17ED88FC17; Thu, 26 Jan 2012 17:55:32 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep23-int.chello.at (InterMail vM.8.01.05.04 201-2260-151-105-20111014) with ESMTP id <20120126173600.VRTM4167.viefep23-int.chello.at@edge04.upcmail.net>; Thu, 26 Jan 2012 18:36:00 +0100 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge04.upcmail.net with edge id SHbz1i02X0a5KZh04HbzYk; Thu, 26 Jan 2012 18:36:00 +0100 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id D71436D44A; Thu, 26 Jan 2012 18:35:59 +0100 (CET) Date: Thu, 26 Jan 2012 18:35:59 +0100 From: Stefan Farfeleder To: John Baldwin Message-ID: <20120126173559.GE1345@mole.fafoe.narf.at> References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126173413.GD1345@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120126173413.GD1345@mole.fafoe.narf.at> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org, svn-src-head@freebsd.org, David Schultz , Mark Murray Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 17:55:34 -0000 On Thu, Jan 26, 2012 at 06:34:13PM +0100, Stefan Farfeleder wrote: > > The type of an enumerator actually is `int', so it should be fine. Please ignore that, I misread the diff. Stefan From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 17:55:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D14C106566C; Thu, 26 Jan 2012 17:55:39 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep24.mx.upcmail.net (fep24.mx.upcmail.net [62.179.121.44]) by mx1.freebsd.org (Postfix) with ESMTP id 5CEBB8FC18; Thu, 26 Jan 2012 17:55:36 +0000 (UTC) Received: from edge04.upcmail.net ([192.168.13.239]) by viefep17-int.chello.at (InterMail vM.8.01.05.04 201-2260-151-105-20111014) with ESMTP id <20120126173414.PLWI25410.viefep17-int.chello.at@edge04.upcmail.net>; Thu, 26 Jan 2012 18:34:14 +0100 Received: from mole.fafoe.narf.at ([213.47.85.26]) by edge04.upcmail.net with edge id SHaD1i0150a5KZh04HaDPn; Thu, 26 Jan 2012 18:34:14 +0100 X-SourceIP: 213.47.85.26 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id 9BE666D44A; Thu, 26 Jan 2012 18:34:13 +0100 (CET) Date: Thu, 26 Jan 2012 18:34:13 +0100 From: Stefan Farfeleder To: John Baldwin Message-ID: <20120126173413.GD1345@mole.fafoe.narf.at> References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201201261132.38320.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, Andrey Chernov , svn-src-all@freebsd.org, svn-src-head@freebsd.org, David Schultz , Mark Murray Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 17:55:39 -0000 On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote: > On Thursday, January 26, 2012 10:56:27 am Andrey Chernov wrote: > > > On Thu, Jan 26, 2012 at 08:39:07AM -0500, John Baldwin wrote: > > > > atomic_cmpset_int(&iniseed_state, ARC4_ENTER_NONE, > ARC4_ENTER_HAVE); > > > > break; > > > > Updated version (I hope, final): > > > > --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 > > +++ sys/libkern.h 2012-01-26 19:38:06.000000000 +0400 > > @@ -72,6 +72,8 @@ static __inline quad_t qabs(quad_t a) { > > > > /* Prototypes for non-quad routines. */ > > struct malloc_type; > > +enum arc4_is { ARC4_ENTR_NONE, ARC4_ENTR_HAVE, ARC4_ENTR_DONE }; > > +extern volatile enum arc4_is arc4rand_iniseed_state; > > Atomics don't operate on enums. You'll need to make it an int and just use > #define's for the 3 states. The type of an enumerator actually is `int', so it should be fine. > > > uint32_t arc4random(void); > > void arc4rand(void *ptr, u_int len, int reseed); > > int bcmp(const void *, const void *, size_t); > > --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.000000000 +0300 > > +++ dev/random/randomdev_soft.c 2012-01-26 19:35:12.000000000 +0400 > > @@ -366,6 +366,8 @@ random_yarrow_unblock(void) > > selwakeuppri(&random_systat.rsel, PUSER); > > wakeup(&random_systat); > > } > > + (void)atomic_cmpset_int(&arc4rand_iniseed_state, > > + ARC4_ENTR_NONE, ARC4_ENTR_HAVE); > > } Stefan From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 18:09:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C43E106564A; Thu, 26 Jan 2012 18:09:29 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 34F598FC15; Thu, 26 Jan 2012 18:09:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QI9T6j099643; Thu, 26 Jan 2012 18:09:29 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QI9TI7099632; Thu, 26 Jan 2012 18:09:29 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201261809.q0QI9TI7099632@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 26 Jan 2012 18:09:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230590 - in head: sbin/camcontrol sys/cam sys/cam/scsi sys/sys usr.sbin/mptutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 18:09:29 -0000 Author: ken Date: Thu Jan 26 18:09:28 2012 New Revision: 230590 URL: http://svn.freebsd.org/changeset/base/230590 Log: Add CAM infrastructure to allow reporting when a drive's long read capacity data changes. cam_ccb.h: Add a new advanced information type, CDAI_TYPE_RCAPLONG, for long read capacity data. cam_xpt_internal.h: Add a read capacity data pointer and length to struct cam_ed. cam_xpt.c: Free the read capacity buffer when a device goes away. While we're here, make sure we don't leak memory for other malloced fields in struct cam_ed. scsi_all.c: Update the scsi_read_capacity_16() to take a uint8_t * and a length instead of just a pointer to the parameter data structure. This will hopefully make this function somewhat immune to future changes in the parameter data. scsi_all.h: Add some extra bit definitions to struct scsi_read_capacity_data_long, and bump up the structure size to the full size specified by SBC-3. Change the prototype for scsi_read_capacity_16(). scsi_da.c: Register changes in read capacity data with the transport layer. This allows the transport layer to send out an async notification to interested parties. Update the dasetgeom() API. Use scsi_extract_sense_len() instead of scsi_extract_sense(). scsi_xpt.c: Add support for the new CDAI_TYPE_RCAPLONG advanced information type. Make sure we set the physpath pointer to NULL after freeing it. This allows blindly freeing it in the struct cam_ed destructor. sys/param.h: Bump __FreeBSD_version from 1000005 to 1000006 to make it easier for third party drivers to determine that the read capacity data async notification is available. camcontrol.c, mptutil/mpt_cam.c: Update these for the new scsi_read_capacity_16() argument structure. Sponsored by: Spectra Logic Modified: head/sbin/camcontrol/camcontrol.c head/sys/cam/cam_ccb.h head/sys/cam/cam_xpt.c head/sys/cam/cam_xpt_internal.h head/sys/cam/scsi/scsi_all.c head/sys/cam/scsi/scsi_all.h head/sys/cam/scsi/scsi_da.c head/sys/cam/scsi/scsi_xpt.c head/sys/sys/param.h head/usr.sbin/mptutil/mpt_cam.c Modified: head/sbin/camcontrol/camcontrol.c ============================================================================== --- head/sbin/camcontrol/camcontrol.c Thu Jan 26 17:28:33 2012 (r230589) +++ head/sbin/camcontrol/camcontrol.c Thu Jan 26 18:09:28 2012 (r230590) @@ -4232,7 +4232,8 @@ scsireadcapacity(struct cam_device *devi /*lba*/ 0, /*reladdr*/ 0, /*pmi*/ 0, - &rcaplong, + /*rcap_buf*/ (uint8_t *)&rcaplong, + /*rcap_buf_len*/ sizeof(rcaplong), /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ timeout ? timeout : 5000); Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Thu Jan 26 17:28:33 2012 (r230589) +++ head/sys/cam/cam_ccb.h Thu Jan 26 18:09:28 2012 (r230590) @@ -1118,6 +1118,7 @@ struct ccb_dev_advinfo { #define CDAI_TYPE_SCSI_DEVID 1 #define CDAI_TYPE_SERIAL_NUM 2 #define CDAI_TYPE_PHYS_PATH 3 +#define CDAI_TYPE_RCAPLONG 4 off_t bufsiz; /* IN: Size of external buffer */ #define CAM_SCSI_DEVID_MAXLEN 65536 /* length in buffer is an uint16_t */ off_t provsiz; /* OUT: Size required/used */ Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Thu Jan 26 17:28:33 2012 (r230589) +++ head/sys/cam/cam_xpt.c Thu Jan 26 18:09:28 2012 (r230590) @@ -4588,6 +4588,17 @@ xpt_release_device(struct cam_ed *device cam_devq_resize(devq, devq->alloc_queue.array_size - 1); camq_fini(&device->drvq); cam_ccbq_fini(&device->ccbq); + /* + * Free allocated memory. free(9) does nothing if the + * supplied pointer is NULL, so it is safe to call without + * checking. + */ + free(device->supported_vpds, M_CAMXPT); + free(device->device_id, M_CAMXPT); + free(device->physpath, M_CAMXPT); + free(device->rcap_buf, M_CAMXPT); + free(device->serial_num, M_CAMXPT); + xpt_release_target(device->target); free(device, M_CAMXPT); } else Modified: head/sys/cam/cam_xpt_internal.h ============================================================================== --- head/sys/cam/cam_xpt_internal.h Thu Jan 26 17:28:33 2012 (r230589) +++ head/sys/cam/cam_xpt_internal.h Thu Jan 26 18:09:28 2012 (r230590) @@ -99,6 +99,8 @@ struct cam_ed { uint8_t *device_id; uint8_t physpath_len; uint8_t *physpath; /* physical path string form */ + uint32_t rcap_len; + uint8_t *rcap_buf; struct ata_params ident_data; u_int8_t inq_flags; /* * Current settings for inquiry flags. Modified: head/sys/cam/scsi/scsi_all.c ============================================================================== --- head/sys/cam/scsi/scsi_all.c Thu Jan 26 17:28:33 2012 (r230589) +++ head/sys/cam/scsi/scsi_all.c Thu Jan 26 18:09:28 2012 (r230590) @@ -5325,8 +5325,8 @@ void scsi_read_capacity_16(struct ccb_scsiio *csio, uint32_t retries, void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint64_t lba, int reladr, int pmi, - struct scsi_read_capacity_data_long *rcap_buf, - uint8_t sense_len, uint32_t timeout) + uint8_t *rcap_buf, int rcap_buf_len, uint8_t sense_len, + uint32_t timeout) { struct scsi_read_capacity_16 *scsi_cmd; @@ -5337,7 +5337,7 @@ scsi_read_capacity_16(struct ccb_scsiio /*flags*/CAM_DIR_IN, tag_action, /*data_ptr*/(u_int8_t *)rcap_buf, - /*dxfer_len*/sizeof(*rcap_buf), + /*dxfer_len*/rcap_buf_len, sense_len, sizeof(*scsi_cmd), timeout); @@ -5346,7 +5346,7 @@ scsi_read_capacity_16(struct ccb_scsiio scsi_cmd->opcode = SERVICE_ACTION_IN; scsi_cmd->service_action = SRC16_SERVICE_ACTION; scsi_u64to8b(lba, scsi_cmd->addr); - scsi_ulto4b(sizeof(*rcap_buf), scsi_cmd->alloc_len); + scsi_ulto4b(rcap_buf_len, scsi_cmd->alloc_len); if (pmi) reladr |= SRC16_PMI; if (reladr) Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu Jan 26 17:28:33 2012 (r230589) +++ head/sys/cam/scsi/scsi_all.h Thu Jan 26 18:09:28 2012 (r230590) @@ -1437,15 +1437,26 @@ struct scsi_read_capacity_data_long uint8_t length[4]; #define SRC16_PROT_EN 0x01 #define SRC16_P_TYPE 0x0e +#define SRC16_PTYPE_1 0x00 +#define SRC16_PTYPE_2 0x02 +#define SRC16_PTYPE_3 0x04 uint8_t prot; #define SRC16_LBPPBE 0x0f #define SRC16_PI_EXPONENT 0xf0 #define SRC16_PI_EXPONENT_SHIFT 4 uint8_t prot_lbppbe; -#define SRC16_LALBA 0x3fff -#define SRC16_LBPRZ 0x4000 -#define SRC16_LBPME 0x8000 +#define SRC16_LALBA 0x3f +#define SRC16_LBPRZ 0x40 +#define SRC16_LBPME 0x80 +/* + * Alternate versions of these macros that are intended for use on a 16-bit + * version of the lalba_lbp field instead of the array of 2 8 bit numbers. + */ +#define SRC16_LALBA_A 0x3fff +#define SRC16_LBPRZ_A 0x4000 +#define SRC16_LBPME_A 0x8000 uint8_t lalba_lbp[2]; + uint8_t reserved[16]; }; struct scsi_report_luns @@ -2293,9 +2304,8 @@ void scsi_read_capacity_16(struct ccb_s void (*cbfcnp)(struct cam_periph *, union ccb *), uint8_t tag_action, uint64_t lba, int reladr, int pmi, - struct scsi_read_capacity_data_long - *rcap_buf, uint8_t sense_len, - uint32_t timeout); + uint8_t *rcap_buf, int rcap_buf_len, + uint8_t sense_len, uint32_t timeout); void scsi_report_luns(struct ccb_scsiio *csio, u_int32_t retries, void (*cbfcnp)(struct cam_periph *, Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Jan 26 17:28:33 2012 (r230589) +++ head/sys/cam/scsi/scsi_da.c Thu Jan 26 18:09:28 2012 (r230590) @@ -160,6 +160,7 @@ struct da_softc { struct callout sendordered_c; uint64_t wwpn; uint8_t unmap_buf[UNMAP_MAX_RANGES * 16 + 8]; + struct scsi_read_capacity_data_long rcaplong; }; struct da_quirk_entry { @@ -830,7 +831,9 @@ static int daerror(union ccb *ccb, u_i static void daprevent(struct cam_periph *periph, int action); static int dagetcapacity(struct cam_periph *periph); static void dasetgeom(struct cam_periph *periph, uint32_t block_len, - uint64_t maxsector, u_int lbppbe, u_int lalba); + uint64_t maxsector, + struct scsi_read_capacity_data_long *rcaplong, + size_t rcap_size); static timeout_t dasendorderedtag; static void dashutdown(void *arg, int howto); @@ -1948,7 +1951,8 @@ out: /*lba*/ 0, /*reladr*/ 0, /*pmi*/ 0, - rcaplong, + /*rcap_buf*/ (uint8_t *)rcaplong, + /*rcap_buf_len*/ sizeof(*rcaplong), /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ 60000); start_ccb->ccb_h.ccb_bp = NULL; @@ -2227,10 +2231,15 @@ dadone(struct cam_periph *periph, union announce_buf[0] = '\0'; cam_periph_invalidate(periph); } else { + /* + * We pass rcaplong into dasetgeom(), + * because it will only use it if it is + * non-NULL. + */ dasetgeom(periph, block_size, maxsector, - lbppbe, lalba & SRC16_LALBA); - if ((lalba & SRC16_LBPME) && - softc->delete_method == DA_DELETE_NONE) + rcaplong, sizeof(*rcaplong)); + if ((lalba & SRC16_LBPME_A) + && softc->delete_method == DA_DELETE_NONE) softc->delete_method = DA_DELETE_UNMAP; dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), @@ -2504,6 +2513,7 @@ dagetcapacity(struct cam_periph *periph) lalba = 0; error = 0; rc16failed = 0; + rcaplong = NULL; sense_flags = SF_RETRY_UA; if (softc->flags & DA_FLAG_PACK_REMOVABLE) sense_flags |= SF_NO_PRINT; @@ -2521,39 +2531,47 @@ dagetcapacity(struct cam_periph *periph) /* Try READ CAPACITY(16) first if we think it should work. */ if (softc->flags & DA_FLAG_CAN_RC16) { scsi_read_capacity_16(&ccb->csio, - /*retries*/ 4, - /*cbfcnp*/ dadone, - /*tag_action*/ MSG_SIMPLE_Q_TAG, - /*lba*/ 0, - /*reladr*/ 0, - /*pmi*/ 0, - rcaplong, - /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ 60000); + /*retries*/ 4, + /*cbfcnp*/ dadone, + /*tag_action*/ MSG_SIMPLE_Q_TAG, + /*lba*/ 0, + /*reladr*/ 0, + /*pmi*/ 0, + /*rcap_buf*/ (uint8_t *)rcaplong, + /*rcap_buf_len*/ sizeof(*rcaplong), + /*sense_len*/ SSD_FULL_SIZE, + /*timeout*/ 60000); ccb->ccb_h.ccb_bp = NULL; error = cam_periph_runccb(ccb, daerror, - /*cam_flags*/CAM_RETRY_SELTO, - sense_flags, - softc->disk->d_devstat); + /*cam_flags*/CAM_RETRY_SELTO, + sense_flags, softc->disk->d_devstat); if (error == 0) goto rc16ok; /* If we got ILLEGAL REQUEST, do not prefer RC16 any more. */ - if ((ccb->ccb_h.status & CAM_STATUS_MASK) == - CAM_REQ_INVALID) { + if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) { softc->flags &= ~DA_FLAG_CAN_RC16; } else if (((ccb->ccb_h.status & CAM_STATUS_MASK) == - CAM_SCSI_STATUS_ERROR) && - (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) && - (ccb->ccb_h.status & CAM_AUTOSNS_VALID) && - ((ccb->ccb_h.flags & CAM_SENSE_PHYS) == 0) && - ((ccb->ccb_h.flags & CAM_SENSE_PTR) == 0)) { + CAM_SCSI_STATUS_ERROR) + && (ccb->csio.scsi_status == SCSI_STATUS_CHECK_COND) + && (ccb->ccb_h.status & CAM_AUTOSNS_VALID) + && ((ccb->ccb_h.flags & CAM_SENSE_PHYS) == 0) + && ((ccb->ccb_h.flags & CAM_SENSE_PTR) == 0)) { int sense_key, error_code, asc, ascq; - scsi_extract_sense(&ccb->csio.sense_data, - &error_code, &sense_key, &asc, &ascq); - if (sense_key == SSD_KEY_ILLEGAL_REQUEST) + scsi_extract_sense_len(&ccb->csio.sense_data, + ccb->csio.sense_len - + ccb->csio.sense_resid, + &error_code, &sense_key, + &asc, &ascq, /*show_errors*/1); + /* + * If we don't have enough sense to get the sense + * key, or if it's illegal request, turn off + * READ CAPACITY (16). + */ + if ((sense_key == -1) + || (sense_key == SSD_KEY_ILLEGAL_REQUEST)) softc->flags &= ~DA_FLAG_CAN_RC16; } rc16failed = 1; @@ -2590,7 +2608,8 @@ dagetcapacity(struct cam_periph *periph) /*lba*/ 0, /*reladr*/ 0, /*pmi*/ 0, - rcaplong, + /*rcap_buf*/ (uint8_t *)rcaplong, + /*rcap_buf_len*/ sizeof(*rcaplong), /*sense_len*/ SSD_FULL_SIZE, /*timeout*/ 60000); ccb->ccb_h.ccb_bp = NULL; @@ -2617,9 +2636,9 @@ done: error = EINVAL; } else { dasetgeom(periph, block_len, maxsector, - lbppbe, lalba & SRC16_LALBA); - if ((lalba & SRC16_LBPME) && - softc->delete_method == DA_DELETE_NONE) + rcaplong, sizeof(*rcaplong)); + if ((lalba & SRC16_LBPME) + && softc->delete_method == DA_DELETE_NONE) softc->delete_method = DA_DELETE_UNMAP; } } @@ -2633,17 +2652,27 @@ done: static void dasetgeom(struct cam_periph *periph, uint32_t block_len, uint64_t maxsector, - u_int lbppbe, u_int lalba) + struct scsi_read_capacity_data_long *rcaplong, size_t rcap_len) { struct ccb_calc_geometry ccg; struct da_softc *softc; struct disk_params *dp; + u_int lbppbe, lalba; softc = (struct da_softc *)periph->softc; dp = &softc->params; dp->secsize = block_len; dp->sectors = maxsector + 1; + if (rcaplong != NULL) { + lbppbe = rcaplong->prot_lbppbe & SRC16_LBPPBE; + lalba = scsi_2btoul(rcaplong->lalba_lbp); + lalba &= SRC16_LALBA_A; + } else { + lbppbe = 0; + lalba = 0; + } + if (lbppbe > 0) { dp->stripesize = block_len << lbppbe; dp->stripeoffset = (dp->stripesize - block_len * lalba) % @@ -2688,6 +2717,38 @@ dasetgeom(struct cam_periph *periph, uin dp->secs_per_track = ccg.secs_per_track; dp->cylinders = ccg.cylinders; } + + /* + * If the user supplied a read capacity buffer, and if it is + * different than the previous buffer, update the data in the EDT. + * If it's the same, we don't bother. This avoids sending an + * update every time someone opens this device. + */ + if ((rcaplong != NULL) + && (bcmp(rcaplong, &softc->rcaplong, + min(sizeof(softc->rcaplong), rcap_len)) != 0)) { + struct ccb_dev_advinfo cdai; + + xpt_setup_ccb(&cdai.ccb_h, periph->path, CAM_PRIORITY_NORMAL); + cdai.ccb_h.func_code = XPT_DEV_ADVINFO; + cdai.buftype = CDAI_TYPE_RCAPLONG; + cdai.flags |= CDAI_FLAG_STORE; + cdai.bufsiz = rcap_len; + cdai.buf = (uint8_t *)rcaplong; + xpt_action((union ccb *)&cdai); + if ((cdai.ccb_h.status & CAM_DEV_QFRZN) != 0) + cam_release_devq(cdai.ccb_h.path, 0, 0, 0, FALSE); + if (cdai.ccb_h.status != CAM_REQ_CMP) { + xpt_print(periph->path, "%s: failed to set read " + "capacity advinfo\n", __func__); + /* Use cam_error_print() to decode the status */ + cam_error_print((union ccb *)&cdai, CAM_ESF_CAM_STATUS, + CAM_EPF_ALL); + } else { + bcopy(rcaplong, &softc->rcaplong, + min(sizeof(softc->rcaplong), rcap_len)); + } + } } static void Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Thu Jan 26 17:28:33 2012 (r230589) +++ head/sys/cam/scsi/scsi_xpt.c Thu Jan 26 18:09:28 2012 (r230590) @@ -2468,8 +2468,10 @@ scsi_dev_advinfo(union ccb *start_ccb) break; case CDAI_TYPE_PHYS_PATH: if (cdai->flags & CDAI_FLAG_STORE) { - if (device->physpath != NULL) + if (device->physpath != NULL) { free(device->physpath, M_CAMXPT); + device->physpath = NULL; + } device->physpath_len = cdai->bufsiz; /* Clear existing buffer if zero length */ if (cdai->bufsiz == 0) @@ -2490,6 +2492,36 @@ scsi_dev_advinfo(union ccb *start_ccb) memcpy(cdai->buf, device->physpath, amt); } break; + case CDAI_TYPE_RCAPLONG: + if (cdai->flags & CDAI_FLAG_STORE) { + if (device->rcap_buf != NULL) { + free(device->rcap_buf, M_CAMXPT); + device->rcap_buf = NULL; + } + + device->rcap_len = cdai->bufsiz; + /* Clear existing buffer if zero length */ + if (cdai->bufsiz == 0) + break; + + device->rcap_buf = malloc(cdai->bufsiz, M_CAMXPT, + M_NOWAIT); + if (device->rcap_buf == NULL) { + start_ccb->ccb_h.status = CAM_REQ_ABORTED; + return; + } + + memcpy(device->rcap_buf, cdai->buf, cdai->bufsiz); + } else { + cdai->provsiz = device->rcap_len; + if (device->rcap_len == 0) + break; + amt = device->rcap_len; + if (cdai->provsiz > cdai->bufsiz) + amt = cdai->bufsiz; + memcpy(cdai->buf, device->rcap_buf, amt); + } + break; default: return; } Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Jan 26 17:28:33 2012 (r230589) +++ head/sys/sys/param.h Thu Jan 26 18:09:28 2012 (r230590) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000005 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000006 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/usr.sbin/mptutil/mpt_cam.c ============================================================================== --- head/usr.sbin/mptutil/mpt_cam.c Thu Jan 26 17:28:33 2012 (r230589) +++ head/usr.sbin/mptutil/mpt_cam.c Thu Jan 26 18:09:28 2012 (r230590) @@ -277,7 +277,7 @@ fetch_scsi_capacity(struct cam_device *d sizeof(struct ccb_hdr)); scsi_read_capacity_16(&ccb->csio, 1, NULL, MSG_SIMPLE_Q_TAG, 0, 0, 0, - &rcaplong, SSD_FULL_SIZE, 5000); + (uint8_t *)&rcaplong, sizeof(rcaplong), SSD_FULL_SIZE, 5000); /* Disable freezing the device queue */ ccb->ccb_h.flags |= CAM_DEV_QFRZDIS; From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 18:13:44 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C62EA106566B; Thu, 26 Jan 2012 18:13:44 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 324B58FC13; Thu, 26 Jan 2012 18:13:43 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0QIDgJ5093231; Thu, 26 Jan 2012 22:13:42 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0QIDgOx093229; Thu, 26 Jan 2012 22:13:42 +0400 (MSK) (envelope-from ache) Date: Thu, 26 Jan 2012 22:13:41 +0400 From: Andrey Chernov To: John Baldwin , Mark Murray , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120126181340.GA93157@vniz.net> Mail-Followup-To: Andrey Chernov , John Baldwin , Mark Murray , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175243.GA19199@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120126175243.GA19199@zim.MIT.EDU> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 18:13:44 -0000 On Thu, Jan 26, 2012 at 12:52:43PM -0500, David Schultz wrote: > Why complicate things with atomics at all? A race might result in > arc4random(9) being seeded multiple times, but that's harmless. Multiply seeding in line is harmless, just waste of time and resources. Other case is one missing seeding when variable is set concurrently with its read. I see no complication using atomic. Latest version is even shorter than previous ones. > The race that worries me is that consumers that call arc4random() > before it is properly seeded will get predictable numbers. To fix > that robustly, we'd either have to move arc4random() into the > random module (tricky given all the places where it's used), or > make the random module a mandatory part of the kernel. I already vote for second option for various reasons. The problem still is more complicated, because arc4random() used very early in the net code and can't wait until yarrow harvests enough entropy, especially for net boot cases. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 18:16:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54BA4106564A; Thu, 26 Jan 2012 18:16:17 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E4EF8FC08; Thu, 26 Jan 2012 18:16:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QIGHM7099910; Thu, 26 Jan 2012 18:16:17 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QIGHaV099908; Thu, 26 Jan 2012 18:16:17 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201201261816.q0QIGHaV099908@svn.freebsd.org> From: Edward Tomasz Napierala Date: Thu, 26 Jan 2012 18:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230591 - head/tools/regression/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 18:16:17 -0000 Author: trasz Date: Thu Jan 26 18:16:16 2012 New Revision: 230591 URL: http://svn.freebsd.org/changeset/base/230591 Log: More mdconfig(8) tests. Modified: head/tools/regression/sbin/mdconfig/mdconfig.test Modified: head/tools/regression/sbin/mdconfig/mdconfig.test ============================================================================== --- head/tools/regression/sbin/mdconfig/mdconfig.test Thu Jan 26 18:09:28 2012 (r230590) +++ head/tools/regression/sbin/mdconfig/mdconfig.test Thu Jan 26 18:16:16 2012 (r230591) @@ -189,4 +189,43 @@ $ diskinfo -v /dev/md0 | expand $ mdconfig -du 0 +# Attaching with a specific unit number. + +$ mdconfig -as 1g -u 42 + +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md42 swap 1024M + +$ diskinfo -v /dev/md42 | expand +> /dev/md42 +> 512 # sectorsize +> 1073741824 # mediasize in bytes (1.0G) +> 2097152 # mediasize in sectors +> 0 # stripesize +> 0 # stripeoffset +> + +$ mdconfig -du 42 + +# Querying. + +$ mdconfig -as 1g +> md0 +$ mdconfig -as 2g -u 42 + +$ mdconfig -lv | awk '{ print $1, $2, $3 }' +> md0 swap 1024M +> md42 swap 2048M + +$ mdconfig -lvu 0 | awk '{ print $1, $2, $3 }' +> md0 swap 1024M + +$ mdconfig -lvu 42 | awk '{ print $1, $2, $3 }' +> md42 swap 2048M + +$ mdconfig -lvu 24 | awk '{ print $1, $2, $3 }' + +$ mdconfig -du 42 +$ mdconfig -du 0 + $ rm xxx From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 18:17:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77324106566C; Thu, 26 Jan 2012 18:17:22 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F4068FC08; Thu, 26 Jan 2012 18:17:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QIHMhN099982; Thu, 26 Jan 2012 18:17:22 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QIHM0t099975; Thu, 26 Jan 2012 18:17:22 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201261817.q0QIHM0t099975@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 26 Jan 2012 18:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230592 - in head/sys: conf dev/mps dev/mps/mpi modules/mps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 18:17:22 -0000 Author: ken Date: Thu Jan 26 18:17:21 2012 New Revision: 230592 URL: http://svn.freebsd.org/changeset/base/230592 Log: Bring in the LSI-supported version of the mps(4) driver. This involves significant changes to the mps(4) driver, but is not a complete rewrite. Some of the changes in this version of the driver: - Integrated RAID (IR) support. - Support for WarpDrive controllers. - Support for SCSI protection information (EEDP). - Support for TLR (Transport Level Retries), needed for tape drives. - Improved error recovery code. - ioctl interface compatible with LSI utilities. mps.4: Update the mps(4) driver man page somewhat for the driver changes. The list of supported hardware still needs to be updated to reflect the full list of supported cards. conf/files: Add the new driver files. mps/mpi/*: Updated version of the MPI header files, with a BSD style copyright. mps/*: See above for a description of the new driver features. modules/mps/Makefile: Add the new mps(4) driver files. Submitted by: Kashyap Desai Reviewed by: ken MFC after: 1 week Added: head/sys/dev/mps/mps_config.c (contents, props changed) head/sys/dev/mps/mps_mapping.c (contents, props changed) head/sys/dev/mps/mps_mapping.h (contents, props changed) head/sys/dev/mps/mps_sas.h (contents, props changed) head/sys/dev/mps/mps_sas_lsi.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/mps/mpi/mpi2.h head/sys/dev/mps/mpi/mpi2_cnfg.h head/sys/dev/mps/mpi/mpi2_hbd.h head/sys/dev/mps/mpi/mpi2_history.txt head/sys/dev/mps/mpi/mpi2_init.h head/sys/dev/mps/mpi/mpi2_ioc.h head/sys/dev/mps/mpi/mpi2_ra.h head/sys/dev/mps/mpi/mpi2_raid.h head/sys/dev/mps/mpi/mpi2_sas.h head/sys/dev/mps/mpi/mpi2_targ.h head/sys/dev/mps/mpi/mpi2_tool.h head/sys/dev/mps/mpi/mpi2_type.h head/sys/dev/mps/mps.c head/sys/dev/mps/mps_ioctl.h head/sys/dev/mps/mps_pci.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_table.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h head/sys/modules/mps/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Thu Jan 26 18:16:16 2012 (r230591) +++ head/sys/conf/files Thu Jan 26 18:17:21 2012 (r230592) @@ -1469,8 +1469,11 @@ dev/mmc/mmcbus_if.m standard dev/mmc/mmcsd.c optional mmcsd dev/mn/if_mn.c optional mn pci dev/mps/mps.c optional mps +dev/mps/mps_config.c optional mps +dev/mps/mps_mapping.c optional mps dev/mps/mps_pci.c optional mps pci dev/mps/mps_sas.c optional mps +dev/mps/mps_sas_lsi.c optional mps dev/mps/mps_table.c optional mps dev/mps/mps_user.c optional mps dev/mpt/mpt.c optional mpt Modified: head/sys/dev/mps/mpi/mpi2.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2.h Thu Jan 26 18:16:16 2012 (r230591) +++ head/sys/dev/mps/mpi/mpi2.h Thu Jan 26 18:17:21 2012 (r230592) @@ -1,6 +1,35 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + /* - * Copyright (c) 2000-2009 LSI Corporation. + * Copyright (c) 2000-2011 LSI Corporation. * * * Name: mpi2.h @@ -9,7 +38,7 @@ * scatter/gather formats. * Creation Date: June 21, 2006 * - * mpi2.h Version: 02.00.14 + * mpi2.h Version: 02.00.18 * * Version History * --------------- @@ -58,6 +87,15 @@ * Added MSI-x index mask and shift for Reply Post Host * Index register. * Added function code for Host Based Discovery Action. + * 02-10-10 02.00.15 Bumped MPI2_HEADER_VERSION_UNIT. + * Added define for MPI2_FUNCTION_PWR_MGMT_CONTROL. + * Added defines for product-specific range of message + * function codes, 0xF0 to 0xFF. + * 05-12-10 02.00.16 Bumped MPI2_HEADER_VERSION_UNIT. + * Added alternative defines for the SGE Direction bit. + * 08-11-10 02.00.17 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-10-10 02.00.18 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR define. * -------------------------------------------------------------------------- */ @@ -83,7 +121,7 @@ #define MPI2_VERSION_02_00 (0x0200) /* versioning for this MPI header set */ -#define MPI2_HEADER_VERSION_UNIT (0x0E) +#define MPI2_HEADER_VERSION_UNIT (0x12) #define MPI2_HEADER_VERSION_DEV (0x00) #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) @@ -476,8 +514,6 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN /***************************************************************************** * * Message Functions -* 0x80 -> 0x8F reserved for private message use per product -* * *****************************************************************************/ @@ -508,6 +544,9 @@ typedef union _MPI2_REPLY_DESCRIPTORS_UN #define MPI2_FUNCTION_TARGET_CMD_BUF_LIST_POST (0x25) /* Target Command Buffer Post List */ #define MPI2_FUNCTION_RAID_ACCELERATOR (0x2C) /* RAID Accelerator */ #define MPI2_FUNCTION_HOST_BASED_DISCOVERY_ACTION (0x2F) /* Host Based Discovery Action */ +#define MPI2_FUNCTION_PWR_MGMT_CONTROL (0x30) /* Power Management Control */ +#define MPI2_FUNCTION_MIN_PRODUCT_SPECIFIC (0xF0) /* beginning of product-specific range */ +#define MPI2_FUNCTION_MAX_PRODUCT_SPECIFIC (0xFF) /* end of product-specific range */ @@ -922,6 +961,9 @@ typedef struct _MPI2_MPI_SGE_UNION #define MPI2_SGE_FLAGS_IOC_TO_HOST (0x00) #define MPI2_SGE_FLAGS_HOST_TO_IOC (0x04) +#define MPI2_SGE_FLAGS_DEST (MPI2_SGE_FLAGS_IOC_TO_HOST) +#define MPI2_SGE_FLAGS_SOURCE (MPI2_SGE_FLAGS_HOST_TO_IOC) + /* Address Size */ #define MPI2_SGE_FLAGS_32_BIT_ADDRESSING (0x00) @@ -1046,11 +1088,11 @@ typedef struct _MPI2_IEEE_SGE_UNION /* Data Location Address Space */ #define MPI2_IEEE_SGE_FLAGS_ADDR_MASK (0x03) -#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) -#define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01) +#define MPI2_IEEE_SGE_FLAGS_SYSTEM_ADDR (0x00) /* IEEE Simple Element only */ +#define MPI2_IEEE_SGE_FLAGS_IOCDDR_ADDR (0x01) /* IEEE Simple Element only */ #define MPI2_IEEE_SGE_FLAGS_IOCPLB_ADDR (0x02) -#define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03) - +#define MPI2_IEEE_SGE_FLAGS_IOCPLBNTA_ADDR (0x03) /* IEEE Simple Element only */ +#define MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR (0x03) /* IEEE Chain Element only */ /**************************************************************************** * IEEE SGE operation Macros Modified: head/sys/dev/mps/mpi/mpi2_cnfg.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_cnfg.h Thu Jan 26 18:16:16 2012 (r230591) +++ head/sys/dev/mps/mpi/mpi2_cnfg.h Thu Jan 26 18:17:21 2012 (r230592) @@ -1,13 +1,42 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + /* - * Copyright (c) 2000-2009 LSI Corporation. + * Copyright (c) 2000-2011 LSI Corporation. * * * Name: mpi2_cnfg.h * Title: MPI Configuration messages and pages * Creation Date: November 10, 2006 * - * mpi2_cnfg.h Version: 02.00.13 + * mpi2_cnfg.h Version: 02.00.17 * * Version History * --------------- @@ -110,6 +139,31 @@ * Added Ethernet configuration pages. * 10-28-09 02.00.13 Added MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY. * Added SAS PHY Page 4 structure and defines. + * 02-10-10 02.00.14 Modified the comments for the configuration page + * structures that contain an array of data. The host + * should use the "count" field in the page data (e.g. the + * NumPhys field) to determine the number of valid elements + * in the array. + * Added/modified some MPI2_MFGPAGE_DEVID_SAS defines. + * Added PowerManagementCapabilities to IO Unit Page 7. + * Added PortWidthModGroup field to + * MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_6 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_7 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_8 and related defines. + * 05-12-10 02.00.15 Added MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT + * define. + * Added MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE define. + * Added MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY define. + * 08-11-10 02.00.16 Removed IO Unit Page 1 device path (multi-pathing) + * defines. + * 11-10-10 02.00.17 Added ReceptacleID field (replacing Reserved1) to + * MPI2_MANPAGE7_CONNECTOR_INFO and reworked defines for + * the Pinout field. + * Added BoardTemperature and BoardTemperatureUnits fields + * to MPI2_CONFIG_PAGE_IO_UNIT_7. + * Added MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING define + * and MPI2_CONFIG_PAGE_EXT_MAN_PS structure. * -------------------------------------------------------------------------- */ @@ -193,6 +247,7 @@ typedef union _MPI2_CONFIG_EXT_PAGE_HEAD #define MPI2_CONFIG_EXTPAGETYPE_DRIVER_MAPPING (0x17) #define MPI2_CONFIG_EXTPAGETYPE_SAS_PORT (0x18) #define MPI2_CONFIG_EXTPAGETYPE_ETHERNET (0x19) +#define MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING (0x1A) /***************************************************************************** @@ -322,7 +377,7 @@ typedef struct _MPI2_CONFIG_REQUEST #define MPI2_CONFIG_ACTION_PAGE_READ_NVRAM (0x06) #define MPI2_CONFIG_ACTION_PAGE_GET_CHANGEABLE (0x07) -/* values for SGLFlags field are in the SGL section of mpi2.h */ +/* use MPI2_SGLFLAGS_ defines from mpi2.h for the SGLFlags field */ /* Config Reply Message */ @@ -368,14 +423,19 @@ typedef struct _MPI2_CONFIG_REPLY #define MPI2_MFGPAGE_DEVID_SAS2116_1 (0x0064) #define MPI2_MFGPAGE_DEVID_SAS2116_2 (0x0065) +#define MPI2_MFGPAGE_DEVID_SSS6200 (0x007E) + #define MPI2_MFGPAGE_DEVID_SAS2208_1 (0x0080) #define MPI2_MFGPAGE_DEVID_SAS2208_2 (0x0081) #define MPI2_MFGPAGE_DEVID_SAS2208_3 (0x0082) #define MPI2_MFGPAGE_DEVID_SAS2208_4 (0x0083) #define MPI2_MFGPAGE_DEVID_SAS2208_5 (0x0084) #define MPI2_MFGPAGE_DEVID_SAS2208_6 (0x0085) -#define MPI2_MFGPAGE_DEVID_SAS2208_7 (0x0086) -#define MPI2_MFGPAGE_DEVID_SAS2208_8 (0x0087) +#define MPI2_MFGPAGE_DEVID_SAS2308_1 (0x0086) +#define MPI2_MFGPAGE_DEVID_SAS2308_2 (0x0087) +#define MPI2_MFGPAGE_DEVID_SAS2308_3 (0x006E) + + /* Manufacturing Page 0 */ @@ -541,7 +601,7 @@ typedef struct _MPI2_CONFIG_PAGE_MAN_4 /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_MAN_PAGE_5_PHY_ENTRIES #define MPI2_MAN_PAGE_5_PHY_ENTRIES (1) @@ -590,23 +650,31 @@ typedef struct _MPI2_MANPAGE7_CONNECTOR_ U32 Pinout; /* 0x00 */ U8 Connector[16]; /* 0x04 */ U8 Location; /* 0x14 */ - U8 Reserved1; /* 0x15 */ + U8 ReceptacleID; /* 0x15 */ U16 Slot; /* 0x16 */ U32 Reserved2; /* 0x18 */ } MPI2_MANPAGE7_CONNECTOR_INFO, MPI2_POINTER PTR_MPI2_MANPAGE7_CONNECTOR_INFO, Mpi2ManPage7ConnectorInfo_t, MPI2_POINTER pMpi2ManPage7ConnectorInfo_t; /* defines for the Pinout field */ -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L4 (0x00080000) -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L3 (0x00040000) -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L2 (0x00020000) -#define MPI2_MANPAGE7_PINOUT_SFF_8484_L1 (0x00010000) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L4 (0x00000800) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L3 (0x00000400) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L2 (0x00000200) -#define MPI2_MANPAGE7_PINOUT_SFF_8470_L1 (0x00000100) -#define MPI2_MANPAGE7_PINOUT_SFF_8482 (0x00000002) -#define MPI2_MANPAGE7_PINOUT_CONNECTION_UNKNOWN (0x00000001) +#define MPI2_MANPAGE7_PINOUT_LANE_MASK (0x0000FF00) +#define MPI2_MANPAGE7_PINOUT_LANE_SHIFT (8) + +#define MPI2_MANPAGE7_PINOUT_TYPE_MASK (0x000000FF) +#define MPI2_MANPAGE7_PINOUT_TYPE_UNKNOWN (0x00) +#define MPI2_MANPAGE7_PINOUT_SATA_SINGLE (0x01) +#define MPI2_MANPAGE7_PINOUT_SFF_8482 (0x02) +#define MPI2_MANPAGE7_PINOUT_SFF_8486 (0x03) +#define MPI2_MANPAGE7_PINOUT_SFF_8484 (0x04) +#define MPI2_MANPAGE7_PINOUT_SFF_8087 (0x05) +#define MPI2_MANPAGE7_PINOUT_SFF_8643_4I (0x06) +#define MPI2_MANPAGE7_PINOUT_SFF_8643_8I (0x07) +#define MPI2_MANPAGE7_PINOUT_SFF_8470 (0x08) +#define MPI2_MANPAGE7_PINOUT_SFF_8088 (0x09) +#define MPI2_MANPAGE7_PINOUT_SFF_8644_4X (0x0A) +#define MPI2_MANPAGE7_PINOUT_SFF_8644_8X (0x0B) +#define MPI2_MANPAGE7_PINOUT_SFF_8644_16X (0x0C) +#define MPI2_MANPAGE7_PINOUT_SFF_8436 (0x0D) /* defines for the Location field */ #define MPI2_MANPAGE7_LOCATION_UNKNOWN (0x01) @@ -619,7 +687,7 @@ typedef struct _MPI2_MANPAGE7_CONNECTOR_ /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_MANPAGE7_CONNECTOR_INFO_MAX #define MPI2_MANPAGE7_CONNECTOR_INFO_MAX (1) @@ -640,7 +708,7 @@ typedef struct _MPI2_CONFIG_PAGE_MAN_7 MPI2_POINTER PTR_MPI2_CONFIG_PAGE_MAN_7, Mpi2ManufacturingPage7_t, MPI2_POINTER pMpi2ManufacturingPage7_t; -#define MPI2_MANUFACTURING7_PAGEVERSION (0x00) +#define MPI2_MANUFACTURING7_PAGEVERSION (0x01) /* defines for the Flags field */ #define MPI2_MANPAGE7_FLAG_USE_SLOT_INFO (0x00000001) @@ -717,6 +785,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT /* IO Unit Page 1 Flags defines */ #define MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY (0x00000800) #define MPI2_IOUNITPAGE1_MASK_SATA_WRITE_CACHE (0x00000600) +#define MPI2_IOUNITPAGE1_SATA_WRITE_CACHE_SHIFT (9) #define MPI2_IOUNITPAGE1_ENABLE_SATA_WRITE_CACHE (0x00000000) #define MPI2_IOUNITPAGE1_DISABLE_SATA_WRITE_CACHE (0x00000200) #define MPI2_IOUNITPAGE1_UNCHANGED_SATA_WRITE_CACHE (0x00000400) @@ -724,15 +793,13 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE1_DISABLE_IR (0x00000040) #define MPI2_IOUNITPAGE1_DISABLE_TASK_SET_FULL_HANDLING (0x00000020) #define MPI2_IOUNITPAGE1_IR_USE_STATIC_VOLUME_ID (0x00000004) -#define MPI2_IOUNITPAGE1_MULTI_PATHING (0x00000002) -#define MPI2_IOUNITPAGE1_SINGLE_PATHING (0x00000000) /* IO Unit Page 3 */ /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength at runtime. + * one and check the value returned for GPIOCount at runtime. */ #ifndef MPI2_IO_UNIT_PAGE_3_GPIO_VAL_MAX #define MPI2_IO_UNIT_PAGE_3_GPIO_VAL_MAX (1) @@ -761,7 +828,7 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT /* * Upper layer code (drivers, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumDmaEngines at runtime. + * one and check the value returned for NumDmaEngines at runtime. */ #ifndef MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES #define MPI2_IOUNITPAGE5_DMAENGINE_ENTRIES (1) @@ -826,15 +893,17 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT U8 PCIeWidth; /* 0x06 */ U8 PCIeSpeed; /* 0x07 */ U32 ProcessorState; /* 0x08 */ - U32 Reserved2; /* 0x0C */ + U32 PowerManagementCapabilities; /* 0x0C */ U16 IOCTemperature; /* 0x10 */ U8 IOCTemperatureUnits; /* 0x12 */ U8 IOCSpeed; /* 0x13 */ - U32 Reserved3; /* 0x14 */ + U16 BoardTemperature; /* 0x14 */ + U8 BoardTemperatureUnits; /* 0x16 */ + U8 Reserved3; /* 0x17 */ } MPI2_CONFIG_PAGE_IO_UNIT_7, MPI2_POINTER PTR_MPI2_CONFIG_PAGE_IO_UNIT_7, Mpi2IOUnitPage7_t, MPI2_POINTER pMpi2IOUnitPage7_t; -#define MPI2_IOUNITPAGE7_PAGEVERSION (0x00) +#define MPI2_IOUNITPAGE7_PAGEVERSION (0x02) /* defines for IO Unit Page 7 PCIeWidth field */ #define MPI2_IOUNITPAGE7_PCIE_WIDTH_X1 (0x01) @@ -855,6 +924,13 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE7_PSTATE_DISABLED (0x01) #define MPI2_IOUNITPAGE7_PSTATE_ENABLED (0x02) +/* defines for IO Unit Page 7 PowerManagementCapabilities field */ +#define MPI2_IOUNITPAGE7_PMCAP_12_5_PCT_IOCSPEED (0x00000400) +#define MPI2_IOUNITPAGE7_PMCAP_25_0_PCT_IOCSPEED (0x00000200) +#define MPI2_IOUNITPAGE7_PMCAP_50_0_PCT_IOCSPEED (0x00000100) +#define MPI2_IOUNITPAGE7_PMCAP_PCIE_WIDTH_CHANGE (0x00000008) +#define MPI2_IOUNITPAGE7_PMCAP_PCIE_SPEED_CHANGE (0x00000004) + /* defines for IO Unit Page 7 IOCTemperatureUnits field */ #define MPI2_IOUNITPAGE7_IOC_TEMP_NOT_PRESENT (0x00) #define MPI2_IOUNITPAGE7_IOC_TEMP_FAHRENHEIT (0x01) @@ -866,6 +942,11 @@ typedef struct _MPI2_CONFIG_PAGE_IO_UNIT #define MPI2_IOUNITPAGE7_IOC_SPEED_QUARTER (0x04) #define MPI2_IOUNITPAGE7_IOC_SPEED_EIGHTH (0x08) +/* defines for IO Unit Page 7 BoardTemperatureUnits field */ +#define MPI2_IOUNITPAGE7_BOARD_TEMP_NOT_PRESENT (0x00) +#define MPI2_IOUNITPAGE7_BOARD_TEMP_FAHRENHEIT (0x01) +#define MPI2_IOUNITPAGE7_BOARD_TEMP_CELSIUS (0x02) + /**************************************************************************** @@ -1198,7 +1279,7 @@ typedef struct _MPI2_CONFIG_PAGE_BIOS_3 /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_BIOS_PAGE_4_PHY_ENTRIES #define MPI2_BIOS_PAGE_4_PHY_ENTRIES (1) @@ -1272,7 +1353,7 @@ typedef struct _MPI2_RAIDVOL0_SETTINGS /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength at runtime. + * one and check the value returned for NumPhysDisks at runtime. */ #ifndef MPI2_RAID_VOL_PAGE_0_PHYSDISK_MAX #define MPI2_RAID_VOL_PAGE_0_PHYSDISK_MAX (1) @@ -1329,6 +1410,7 @@ typedef struct _MPI2_CONFIG_PAGE_RAID_VO #define MPI2_RAIDVOL0_STATUS_FLAG_CAPACITY_EXPANSION (0x00040000) #define MPI2_RAIDVOL0_STATUS_FLAG_BACKGROUND_INIT (0x00020000) #define MPI2_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS (0x00010000) +#define MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT (0x00000080) #define MPI2_RAIDVOL0_STATUS_FLAG_OCE_ALLOWED (0x00000040) #define MPI2_RAIDVOL0_STATUS_FLAG_BGI_COMPLETE (0x00000020) #define MPI2_RAIDVOL0_STATUS_FLAG_1E_OFFSET_MIRROR (0x00000000) @@ -1451,11 +1533,15 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS #define MPI2_PHYSDISK0_INCOMPATIBLE_MAX_LBA (0x03) #define MPI2_PHYSDISK0_INCOMPATIBLE_SATA_EXTENDED_CMD (0x04) #define MPI2_PHYSDISK0_INCOMPATIBLE_REMOVEABLE_MEDIA (0x05) +#define MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE (0x06) #define MPI2_PHYSDISK0_INCOMPATIBLE_UNKNOWN (0xFF) /* PhysDiskAttributes defines */ +#define MPI2_PHYSDISK0_ATTRIB_MEDIA_MASK (0x0C) #define MPI2_PHYSDISK0_ATTRIB_SOLID_STATE_DRIVE (0x08) #define MPI2_PHYSDISK0_ATTRIB_HARD_DISK_DRIVE (0x04) + +#define MPI2_PHYSDISK0_ATTRIB_PROTOCOL_MASK (0x03) #define MPI2_PHYSDISK0_ATTRIB_SAS_PROTOCOL (0x02) #define MPI2_PHYSDISK0_ATTRIB_SATA_PROTOCOL (0x01) @@ -1474,7 +1560,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.PageLength or NumPhysDiskPaths at runtime. + * one and check the value returned for NumPhysDiskPaths at runtime. */ #ifndef MPI2_RAID_PHYS_DISK1_PATH_MAX #define MPI2_RAID_PHYS_DISK1_PATH_MAX (1) @@ -1527,6 +1613,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS #define MPI2_SAS_NEG_LINK_RATE_SATA_OOB_COMPLETE (0x03) #define MPI2_SAS_NEG_LINK_RATE_PORT_SELECTOR (0x04) #define MPI2_SAS_NEG_LINK_RATE_SMP_RESET_IN_PROGRESS (0x05) +#define MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY (0x06) #define MPI2_SAS_NEG_LINK_RATE_1_5 (0x08) #define MPI2_SAS_NEG_LINK_RATE_3_0 (0x09) #define MPI2_SAS_NEG_LINK_RATE_6_0 (0x0A) @@ -1553,6 +1640,7 @@ typedef struct _MPI2_CONFIG_PAGE_RD_PDIS #define MPI2_SAS_PHYINFO_PHY_VACANT (0x80000000) #define MPI2_SAS_PHYINFO_PHY_POWER_CONDITION_MASK (0x18000000) +#define MPI2_SAS_PHYINFO_SHIFT_PHY_POWER_CONDITION (27) #define MPI2_SAS_PHYINFO_PHY_POWER_ACTIVE (0x00000000) #define MPI2_SAS_PHYINFO_PHY_POWER_PARTIAL (0x08000000) #define MPI2_SAS_PHYINFO_PHY_POWER_SLUMBER (0x10000000) @@ -1636,7 +1724,7 @@ typedef struct _MPI2_SAS_IO_UNIT0_PHY_DA /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT0_PHY_MAX #define MPI2_SAS_IOUNIT0_PHY_MAX (1) @@ -1707,7 +1795,7 @@ typedef struct _MPI2_SAS_IO_UNIT1_PHY_DA /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT1_PHY_MAX #define MPI2_SAS_IOUNIT1_PHY_MAX (1) @@ -1798,7 +1886,7 @@ typedef struct _MPI2_SAS_IOUNIT4_SPINUP_ /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * four and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT4_PHY_MAX #define MPI2_SAS_IOUNIT4_PHY_MAX (4) @@ -1837,7 +1925,7 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS { U8 ControlFlags; /* 0x00 */ - U8 Reserved1; /* 0x01 */ + U8 PortWidthModGroup; /* 0x01 */ U16 InactivityTimerExponent; /* 0x02 */ U8 SATAPartialTimeout; /* 0x04 */ U8 Reserved2; /* 0x05 */ @@ -1857,6 +1945,9 @@ typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM #define MPI2_SASIOUNIT5_CONTROL_SATA_SLUMBER_ENABLE (0x02) #define MPI2_SASIOUNIT5_CONTROL_SATA_PARTIAL_ENABLE (0x01) +/* defines for PortWidthModeGroup field */ +#define MPI2_SASIOUNIT5_PWMG_DISABLE (0xFF) + /* defines for InactivityTimerExponent field */ #define MPI2_SASIOUNIT5_ITE_MASK_SAS_SLUMBER (0x7000) #define MPI2_SASIOUNIT5_ITE_SHIFT_SAS_SLUMBER (12) @@ -1878,7 +1969,7 @@ typedef struct _MPI2_SAS_IO_UNIT5_PHY_PM /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumPhys at runtime. */ #ifndef MPI2_SAS_IOUNIT5_PHY_MAX #define MPI2_SAS_IOUNIT5_PHY_MAX (1) @@ -1896,7 +1987,137 @@ typedef struct _MPI2_CONFIG_PAGE_SASIOUN MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_5, Mpi2SasIOUnitPage5_t, MPI2_POINTER pMpi2SasIOUnitPage5_t; -#define MPI2_SASIOUNITPAGE5_PAGEVERSION (0x00) +#define MPI2_SASIOUNITPAGE5_PAGEVERSION (0x01) + + +/* SAS IO Unit Page 6 */ + +typedef struct _MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS +{ + U8 CurrentStatus; /* 0x00 */ + U8 CurrentModulation; /* 0x01 */ + U8 CurrentUtilization; /* 0x02 */ + U8 Reserved1; /* 0x03 */ + U32 Reserved2; /* 0x04 */ +} MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS, + MPI2_POINTER PTR_MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS, + Mpi2SasIOUnit6PortWidthModGroupStatus_t, + MPI2_POINTER pMpi2SasIOUnit6PortWidthModGroupStatus_t; + +/* defines for CurrentStatus field */ +#define MPI2_SASIOUNIT6_STATUS_UNAVAILABLE (0x00) +#define MPI2_SASIOUNIT6_STATUS_UNCONFIGURED (0x01) +#define MPI2_SASIOUNIT6_STATUS_INVALID_CONFIG (0x02) +#define MPI2_SASIOUNIT6_STATUS_LINK_DOWN (0x03) +#define MPI2_SASIOUNIT6_STATUS_OBSERVATION_ONLY (0x04) +#define MPI2_SASIOUNIT6_STATUS_INACTIVE (0x05) +#define MPI2_SASIOUNIT6_STATUS_ACTIVE_IOUNIT (0x06) +#define MPI2_SASIOUNIT6_STATUS_ACTIVE_HOST (0x07) + +/* defines for CurrentModulation field */ +#define MPI2_SASIOUNIT6_MODULATION_25_PERCENT (0x00) +#define MPI2_SASIOUNIT6_MODULATION_50_PERCENT (0x01) +#define MPI2_SASIOUNIT6_MODULATION_75_PERCENT (0x02) +#define MPI2_SASIOUNIT6_MODULATION_100_PERCENT (0x03) + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check the value returned for NumGroups at runtime. + */ +#ifndef MPI2_SAS_IOUNIT6_GROUP_MAX +#define MPI2_SAS_IOUNIT6_GROUP_MAX (1) +#endif + +typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_6 +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U32 Reserved1; /* 0x08 */ + U32 Reserved2; /* 0x0C */ + U8 NumGroups; /* 0x10 */ + U8 Reserved3; /* 0x11 */ + U16 Reserved4; /* 0x12 */ + MPI2_SAS_IO_UNIT6_PORT_WIDTH_MOD_GROUP_STATUS + PortWidthModulationGroupStatus[MPI2_SAS_IOUNIT6_GROUP_MAX]; /* 0x14 */ +} MPI2_CONFIG_PAGE_SASIOUNIT_6, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_6, + Mpi2SasIOUnitPage6_t, MPI2_POINTER pMpi2SasIOUnitPage6_t; + +#define MPI2_SASIOUNITPAGE6_PAGEVERSION (0x00) + + +/* SAS IO Unit Page 7 */ + +typedef struct _MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS +{ + U8 Flags; /* 0x00 */ + U8 Reserved1; /* 0x01 */ + U16 Reserved2; /* 0x02 */ + U8 Threshold75Pct; /* 0x04 */ + U8 Threshold50Pct; /* 0x05 */ + U8 Threshold25Pct; /* 0x06 */ + U8 Reserved3; /* 0x07 */ +} MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS, + MPI2_POINTER PTR_MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS, + Mpi2SasIOUnit7PortWidthModGroupSettings_t, + MPI2_POINTER pMpi2SasIOUnit7PortWidthModGroupSettings_t; + +/* defines for Flags field */ +#define MPI2_SASIOUNIT7_FLAGS_ENABLE_PORT_WIDTH_MODULATION (0x01) + + +/* + * Host code (drivers, BIOS, utilities, etc.) should leave this define set to + * one and check the value returned for NumGroups at runtime. + */ +#ifndef MPI2_SAS_IOUNIT7_GROUP_MAX +#define MPI2_SAS_IOUNIT7_GROUP_MAX (1) +#endif + +typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_7 +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U8 SamplingInterval; /* 0x08 */ + U8 WindowLength; /* 0x09 */ + U16 Reserved1; /* 0x0A */ + U32 Reserved2; /* 0x0C */ + U32 Reserved3; /* 0x10 */ + U8 NumGroups; /* 0x14 */ + U8 Reserved4; /* 0x15 */ + U16 Reserved5; /* 0x16 */ + MPI2_SAS_IO_UNIT7_PORT_WIDTH_MOD_GROUP_SETTINGS + PortWidthModulationGroupSettings[MPI2_SAS_IOUNIT7_GROUP_MAX]; /* 0x18 */ +} MPI2_CONFIG_PAGE_SASIOUNIT_7, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_7, + Mpi2SasIOUnitPage7_t, MPI2_POINTER pMpi2SasIOUnitPage7_t; + +#define MPI2_SASIOUNITPAGE7_PAGEVERSION (0x00) + + +/* SAS IO Unit Page 8 */ + +typedef struct _MPI2_CONFIG_PAGE_SASIOUNIT_8 +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U32 Reserved1; /* 0x08 */ + U32 PowerManagementCapabilities; /* 0x0C */ + U32 Reserved2; /* 0x10 */ +} MPI2_CONFIG_PAGE_SASIOUNIT_8, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_SASIOUNIT_8, + Mpi2SasIOUnitPage8_t, MPI2_POINTER pMpi2SasIOUnitPage8_t; + +#define MPI2_SASIOUNITPAGE8_PAGEVERSION (0x00) + +/* defines for PowerManagementCapabilities field */ +#define MPI2_SASIOUNIT8_PM_HOST_PORT_WIDTH_MOD (0x000001000) +#define MPI2_SASIOUNIT8_PM_HOST_SAS_SLUMBER_MODE (0x000000800) +#define MPI2_SASIOUNIT8_PM_HOST_SAS_PARTIAL_MODE (0x000000400) +#define MPI2_SASIOUNIT8_PM_HOST_SATA_SLUMBER_MODE (0x000000200) +#define MPI2_SASIOUNIT8_PM_HOST_SATA_PARTIAL_MODE (0x000000100) +#define MPI2_SASIOUNIT8_PM_IOUNIT_PORT_WIDTH_MOD (0x000000010) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SAS_SLUMBER_MODE (0x000000008) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SAS_PARTIAL_MODE (0x000000004) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SATA_SLUMBER_MODE (0x000000002) +#define MPI2_SASIOUNIT8_PM_IOUNIT_SATA_PARTIAL_MODE (0x000000001) @@ -2187,7 +2408,7 @@ typedef struct _MPI2_SASPHY2_PHY_EVENT /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhyEvents at runtime. + * one and check the value returned for NumPhyEvents at runtime. */ #ifndef MPI2_SASPHY2_PHY_EVENT_MAX #define MPI2_SASPHY2_PHY_EVENT_MAX (1) @@ -2280,7 +2501,7 @@ typedef struct _MPI2_SASPHY3_PHY_EVENT_C /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhyEvents at runtime. + * one and check the value returned for NumPhyEvents at runtime. */ #ifndef MPI2_SASPHY3_PHY_EVENT_MAX #define MPI2_SASPHY3_PHY_EVENT_MAX (1) @@ -2392,7 +2613,7 @@ typedef struct _MPI2_CONFIG_PAGE_SAS_ENC /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumLogEntries at runtime. */ #ifndef MPI2_LOG_0_NUM_LOG_ENTRIES #define MPI2_LOG_0_NUM_LOG_ENTRIES (1) @@ -2442,7 +2663,7 @@ typedef struct _MPI2_CONFIG_PAGE_LOG_0 /* * Host code (drivers, BIOS, utilities, etc.) should leave this define set to - * one and check Header.ExtPageLength or NumPhys at runtime. + * one and check the value returned for NumElements at runtime. */ #ifndef MPI2_RAIDCONFIG0_MAX_ELEMENTS #define MPI2_RAIDCONFIG0_MAX_ELEMENTS (1) @@ -2642,5 +2863,25 @@ typedef struct _MPI2_CONFIG_PAGE_ETHERNE #define MPI2_ETHPG1_MS_DATA_RATE_1GBIT (0x03) +/**************************************************************************** +* Extended Manufacturing Config Pages +****************************************************************************/ + +/* + * Generic structure to use for product-specific extended manufacturing pages + * (currently Extended Manufacturing Page 40 through Extended Manufacturing + * Page 60). + */ + +typedef struct _MPI2_CONFIG_PAGE_EXT_MAN_PS +{ + MPI2_CONFIG_EXTENDED_PAGE_HEADER Header; /* 0x00 */ + U32 ProductSpecificInfo; /* 0x08 */ +} MPI2_CONFIG_PAGE_EXT_MAN_PS, + MPI2_POINTER PTR_MPI2_CONFIG_PAGE_EXT_MAN_PS, + Mpi2ExtManufacturingPagePS_t, MPI2_POINTER pMpi2ExtManufacturingPagePS_t; + +/* PageVersion should be provided by product-specific code */ + #endif Modified: head/sys/dev/mps/mpi/mpi2_hbd.h ============================================================================== --- head/sys/dev/mps/mpi/mpi2_hbd.h Thu Jan 26 18:16:16 2012 (r230591) +++ head/sys/dev/mps/mpi/mpi2_hbd.h Thu Jan 26 18:17:21 2012 (r230592) @@ -1,13 +1,42 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + /* - * Copyright (c) 2009 LSI Corporation. + * Copyright (c) 2009-2011 LSI Corporation. * * * Name: mpi2_hbd.h * Title: MPI Host Based Discovery messages and structures * Creation Date: October 21, 2009 * - * mpi2_hbd.h Version: 02.00.00 + * mpi2_hbd.h Version: 02.00.01 * * Version History * --------------- @@ -15,6 +44,8 @@ * Date Version Description * -------- -------- ------------------------------------------------------ * 10-28-09 02.00.00 Initial version. + * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from + * HBD Action request, replaced by AdditionalInfo field. * -------------------------------------------------------------------------- */ @@ -48,10 +79,7 @@ typedef struct _MPI2_HBD_ACTION_REQUEST U8 Port; /* 0x25 */ U8 MaxConnections; /* 0x26 */ U8 MaxRate; /* 0x27 */ - U8 PortGroups; /* 0x28 */ - U8 DmaGroup; /* 0x29 */ - U8 ControlGroup; /* 0x2A */ - U8 Reserved6; /* 0x2B */ + U32 AdditionalInfo; /* 0x28 */ U16 InitialAWT; /* 0x2C */ U16 Reserved7; /* 0x2E */ U32 Reserved8; /* 0x30 */ Modified: head/sys/dev/mps/mpi/mpi2_history.txt ============================================================================== --- head/sys/dev/mps/mpi/mpi2_history.txt Thu Jan 26 18:16:16 2012 (r230591) +++ head/sys/dev/mps/mpi/mpi2_history.txt Thu Jan 26 18:17:21 2012 (r230592) @@ -1,29 +1,58 @@ -/* $FreeBSD$ */ +/*- + * Copyright (c) 2011 LSI Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, 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. + * + * LSI MPT-Fusion Host Adapter FreeBSD + * + * $FreeBSD$ + */ + ============================== Fusion-MPT MPI 2.0 Header File Change History ============================== - Copyright (c) 2000-2009 LSI Corporation. + Copyright (c) 2000-2011 LSI Corporation. --------------------------------------- - Header Set Release Version: 02.00.14 - Header Set Release Date: 10-28-09 + Header Set Release Version: 02.00.18 + Header Set Release Date: 11-10-10 --------------------------------------- Filename Current version Prior version ---------- --------------- ------------- - mpi2.h 02.00.14 02.00.13 - mpi2_cnfg.h 02.00.13 02.00.12 - mpi2_init.h 02.00.08 02.00.07 - mpi2_ioc.h 02.00.13 02.00.12 - mpi2_raid.h 02.00.04 02.00.04 - mpi2_sas.h 02.00.03 02.00.02 - mpi2_targ.h 02.00.03 02.00.03 - mpi2_tool.h 02.00.04 02.00.04 + mpi2.h 02.00.18 02.00.17 + mpi2_cnfg.h 02.00.17 02.00.16 + mpi2_init.h 02.00.11 02.00.10 + mpi2_ioc.h 02.00.16 02.00.15 + mpi2_raid.h 02.00.05 02.00.05 + mpi2_sas.h 02.00.05 02.00.05 + mpi2_targ.h 02.00.04 02.00.04 + mpi2_tool.h 02.00.06 02.00.06 mpi2_type.h 02.00.00 02.00.00 mpi2_ra.h 02.00.00 02.00.00 - mpi2_hbd.h 02.00.00 - mpi2_history.txt 02.00.14 02.00.13 + mpi2_hbd.h 02.00.01 02.00.01 + mpi2_history.txt 02.00.18 02.00.17 * Date Version Description @@ -72,6 +101,15 @@ mpi2.h * Added MSI-x index mask and shift for Reply Post Host * Index register. * Added function code for Host Based Discovery Action. + * 02-10-10 02.00.15 Bumped MPI2_HEADER_VERSION_UNIT. + * Added define for MPI2_FUNCTION_PWR_MGMT_CONTROL. + * Added defines for product-specific range of message + * function codes, 0xF0 to 0xFF. + * 05-12-10 02.00.16 Bumped MPI2_HEADER_VERSION_UNIT. + * Added alternative defines for the SGE Direction bit. + * 08-11-10 02.00.17 Bumped MPI2_HEADER_VERSION_UNIT. + * 11-10-10 02.00.18 Bumped MPI2_HEADER_VERSION_UNIT. + * Added MPI2_IEEE_SGE_FLAGS_SYSTEMPLBCPI_ADDR define. * -------------------------------------------------------------------------- mpi2_cnfg.h @@ -171,6 +209,31 @@ mpi2_cnfg.h * Added Ethernet configuration pages. * 10-28-09 02.00.13 Added MPI2_IOUNITPAGE1_ENABLE_HOST_BASED_DISCOVERY. * Added SAS PHY Page 4 structure and defines. + * 02-10-10 02.00.14 Modified the comments for the configuration page + * structures that contain an array of data. The host + * should use the "count" field in the page data (e.g. the + * NumPhys field) to determine the number of valid elements + * in the array. + * Added/modified some MPI2_MFGPAGE_DEVID_SAS defines. + * Added PowerManagementCapabilities to IO Unit Page 7. + * Added PortWidthModGroup field to + * MPI2_SAS_IO_UNIT5_PHY_PM_SETTINGS. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_6 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_7 and related defines. + * Added MPI2_CONFIG_PAGE_SASIOUNIT_8 and related defines. + * 05-12-10 02.00.15 Added MPI2_RAIDVOL0_STATUS_FLAG_VOL_NOT_CONSISTENT + * define. + * Added MPI2_PHYSDISK0_INCOMPATIBLE_MEDIA_TYPE define. + * Added MPI2_SAS_NEG_LINK_RATE_UNSUPPORTED_PHY define. + * 08-11-10 02.00.16 Removed IO Unit Page 1 device path (multi-pathing) + * defines. + * 11-10-10 02.00.17 Added ReceptacleID field (replacing Reserved1) to + * MPI2_MANPAGE7_CONNECTOR_INFO and reworked defines for + * the Pinout field. + * Added BoardTemperature and BoardTemperatureUnits fields + * to MPI2_CONFIG_PAGE_IO_UNIT_7. + * Added MPI2_CONFIG_EXTPAGETYPE_EXT_MANUFACTURING define + * and MPI2_CONFIG_PAGE_EXT_MAN_PS structure. * -------------------------------------------------------------------------- mpi2_init.h @@ -192,6 +255,9 @@ mpi2_init.h * both SCSI IO Error Reply and SCSI Task Management Reply. * Added ResponseInfo field to MPI2_SCSI_TASK_MANAGE_REPLY. * Added MPI2_SCSITASKMGMT_RSP_TM_OVERLAPPED_TAG define. + * 02-10-10 02.00.09 Removed unused structure that had "#if 0" around it. + * 05-12-10 02.00.10 Added optional vendor-unique region to SCSI IO Request. + * 11-10-10 02.00.11 Added MPI2_SCSIIO_NUM_SGLOFFSETS define. * -------------------------------------------------------------------------- mpi2_ioc.h @@ -280,6 +346,12 @@ mpi2_ioc.h * (MPI2_FW_HEADER_PID_). * Modified values for SAS ProductID Family * (MPI2_FW_HEADER_PID_FAMILY_). + * 02-10-10 02.00.14 Added SAS Quiesce Event structure and defines. + * Added PowerManagementControl Request structures and + * defines. + * 05-12-10 02.00.15 Marked Task Set Full Event as obsolete. + * Added MPI2_EVENT_SAS_TOPO_LR_UNSUPPORTED_PHY define. + * 11-10-10 02.00.16 Added MPI2_FW_DOWNLOAD_ITYPE_MIN_PRODUCT_SPECIFIC. * -------------------------------------------------------------------------- mpi2_raid.h @@ -292,6 +364,7 @@ mpi2_raid.h * can be sized by the build environment. * 07-30-09 02.00.04 Added proper define for the Use Default Settings bit of * VolumeCreationFlags and marked the old one as obsolete. + * 05-12-10 02.00.05 Added MPI2_RAID_VOL_FLAGS_OP_MDC define. * -------------------------------------------------------------------------- mpi2_sas.h @@ -302,6 +375,8 @@ mpi2_sas.h * Request. * 10-28-09 02.00.03 Changed the type of SGL in MPI2_SATA_PASSTHROUGH_REQUEST * to MPI2_SGE_IO_UNION since it supports chained SGLs. + * 05-12-10 02.00.04 Modified some comments. + * 08-11-10 02.00.05 Added NCQ operations to SAS IO Unit Control. * -------------------------------------------------------------------------- mpi2_targ.h @@ -313,6 +388,7 @@ mpi2_targ.h * MPI2_TARGET_CMD_BUF_POST_BASE_REQUEST. * Target Status Send Request only takes a single SGE for * response data. + * 02-10-10 02.00.04 Added comment to MPI2_TARGET_SSP_RSP_IU structure. * -------------------------------------------------------------------------- mpi2_tool.h @@ -325,6 +401,9 @@ mpi2_tool.h * and reply messages. * Added MPI2_DIAG_BUF_TYPE_EXTENDED. * Incremented MPI2_DIAG_BUF_TYPE_COUNT. + * 05-12-10 02.00.05 Added Diagnostic Data Upload tool. + * 08-11-10 02.00.06 Added defines that were missing for Diagnostic Buffer + * Post Request. * -------------------------------------------------------------------------- mpi2_type.h @@ -337,24 +416,40 @@ mpi2_ra.h mpi2_hbd.h * 10-28-09 02.00.00 Initial version. + * 08-11-10 02.00.01 Removed PortGroups, DmaGroup, and ControlGroup from + * HBD Action request, replaced by AdditionalInfo field. * -------------------------------------------------------------------------- mpi2_history.txt Parts list history -Filename 02.00.14 02.00.13 02.00.12 ----------- -------- -------- -------- -mpi2.h 02.00.14 02.00.13 02.00.12 -mpi2_cnfg.h 02.00.13 02.00.12 02.00.11 -mpi2_init.h 02.00.08 02.00.07 02.00.07 -mpi2_ioc.h 02.00.13 02.00.12 02.00.11 -mpi2_raid.h 02.00.04 02.00.04 02.00.03 -mpi2_sas.h 02.00.03 02.00.02 02.00.02 -mpi2_targ.h 02.00.03 02.00.03 02.00.03 -mpi2_tool.h 02.00.04 02.00.04 02.00.03 -mpi2_type.h 02.00.00 02.00.00 02.00.00 -mpi2_ra.h 02.00.00 02.00.00 02.00.00 -mpi2_hbd.h 02.00.00 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 18:18:47 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6E38106564A; Thu, 26 Jan 2012 18:18:47 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B791F8FC1D; Thu, 26 Jan 2012 18:18:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QIIlBD000164; Thu, 26 Jan 2012 18:18:47 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QIIlKo000162; Thu, 26 Jan 2012 18:18:47 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201201261818.q0QIIlKo000162@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 26 Jan 2012 18:18:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230593 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 18:18:48 -0000 Author: ken Date: Thu Jan 26 18:18:47 2012 New Revision: 230593 URL: http://svn.freebsd.org/changeset/base/230593 Log: Remove the blank line between the license and .Dd Prompted by: brueffer MFC after: 1 week Modified: head/share/man/man4/xnb.4 Modified: head/share/man/man4/xnb.4 ============================================================================== --- head/share/man/man4/xnb.4 Thu Jan 26 18:17:21 2012 (r230592) +++ head/share/man/man4/xnb.4 Thu Jan 26 18:18:47 2012 (r230593) @@ -30,7 +30,6 @@ .\" .\" $FreeBSD$ .\" - .Dd January 6, 2012 .Dt XNB 4 .Os From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 18:55:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5589A1065673 for ; Thu, 26 Jan 2012 18:55:32 +0000 (UTC) (envelope-from markm@FreeBSD.org) Received: from gromit.grondar.org (grandfather.grondar.org [93.89.92.32]) by mx1.freebsd.org (Postfix) with ESMTP id 1A3318FC0C for ; Thu, 26 Jan 2012 18:55:31 +0000 (UTC) Received: from uucp by gromit.grondar.org with local-rmail (Exim 4.76 (FreeBSD)) (envelope-from ) id 1RqUOd-0002tR-5d for svn-src-all@freebsd.org; Thu, 26 Jan 2012 18:50:07 +0000 Received: from localhost ([127.0.0.1] helo=groundzero.grondar.org) by groundzero.grondar.org with esmtp (Exim 4.77 (FreeBSD)) (envelope-from ) id 1RqUNN-000OwI-0g; Thu, 26 Jan 2012 18:48:49 +0000 To: David Schultz In-reply-to: <20120126175243.GA19199@zim.MIT.EDU> References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175243.GA19199@zim.MIT.EDU> From: Mark Murray Date: Thu, 26 Jan 2012 18:48:48 +0000 Message-Id: Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 18:55:32 -0000 David Schultz writes: > > Although current version with current kernel flags works, I forget > > it is implementation defined in general and not always equal to > > sizeof(int), f.e. with gcc --short-enums. I'll remade it with > > #defines, thanx again. > > Why complicate things with atomics at all? A race might result in > arc4random(9) being seeded multiple times, but that's harmless. > > The race that worries me is that consumers that call arc4random() > before it is properly seeded will get predictable numbers. To fix > that robustly, we'd either have to move arc4random() into the random > module (tricky given all the places where it's used), or make the > random module a mandatory part of the kernel. There is a VERY old problem here, and it is of the chicken vs egg variety. The random device won't unlock until it has enough entropy, and there are things in the kernel that appear to need "random enough" numbers earlier than that. It ought to be possible to unlock the CSPRNG by harvesting entropy earlier, but this is hard work. Very hard work. Unless you have entropy-generating hardware. In the meanwhile, you are left with other alternatives; reseed arc4random() with some early entropy; try to move entropy consumers to later in the boot sequence; try to not depend on entropy early on, and correct for this later (where necessary). There are loads of other alternatives. What you can't do is unlock before you have enough entropy, and that won't happen until the running kernel has had some time to accumulate this. I am in favour of treating arc4random() as a PRNG with (say) the date/time, the TSC register and other easy-to-get data as the first seed. After that its treated as a CSPRNG. This requires that early consumers know the limitations and adapt to them. The notion of making arc4random() block would be silly; the point of the thing is that it always returns numbers, and after the random device seeds, it should always be good. > OpenSSL addresses the issue by providing two APIs: RAND_bytes() > requires a good entropy source and produces cryptographically strong > pseudorandomness. RAND_pseudo_bytes() produces "good" (but not > necessarily unpredictable) randomness, even in the absence of an > entropy source. Applications call one interface or the other, > depending on whether they require cryptographic- quality randomness. You are treading on graves here :-). An ancient bikeshed is buried in the vicinty. M -- Mark R V Murray Cert APS(Open) Dip Phys(Open) BSc Open(Open) BSc(Hons)(Open) Pi: 132511160 From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 19:11:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBB70106566C; Thu, 26 Jan 2012 19:11:09 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 900E18FC08; Thu, 26 Jan 2012 19:11:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QJB9qK001996; Thu, 26 Jan 2012 19:11:09 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QJB9Pc001994; Thu, 26 Jan 2012 19:11:09 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201261911.q0QJB9Pc001994@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 26 Jan 2012 19:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230594 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 19:11:09 -0000 Author: glebius Date: Thu Jan 26 19:11:08 2012 New Revision: 230594 URL: http://svn.freebsd.org/changeset/base/230594 Log: - Rewrite paragraphs about preemption. - Avoid word combination "carp interface". Prodded by: az Modified: head/share/man/man4/carp.4 Modified: head/share/man/man4/carp.4 ============================================================================== --- head/share/man/man4/carp.4 Thu Jan 26 18:18:47 2012 (r230593) +++ head/share/man/man4/carp.4 Thu Jan 26 19:11:08 2012 (r230594) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 20, 2011 +.Dd January 26, 2012 .Dt CARP 4 .Os .Sh NAME @@ -99,24 +99,14 @@ packets. Enabled by default. .It Va net.inet.carp.preempt Allow virtual hosts to preempt each other. -It is also used to failover -.Nm -interfaces as a group. -When the option is enabled and one of the -.Nm -enabled physical interfaces -goes down, -.Cm advskew -is changed to 240 on all -.Nm -interfaces. -See also the first example. +When enabled, a vhid in a backup state would preempt a master that +is announcing itself with a lower advskew. Disabled by default. .It Va net.inet.carp.log Value of 0 disables any logging. Value of 1 enables logging state changes of .Nm -interfaces. +vhids. Values above 1 enable logging of bad .Nm packets. @@ -202,9 +192,9 @@ and section for more information. .Sh EXAMPLES For firewalls and routers with multiple interfaces, it is desirable to -failover all of the +failover all of the addresses running .Nm -interfaces together, when one of the physical interfaces goes down. +together, when one of the physical interfaces goes down. This is achieved by the preempt option. Enable it on both host A and B: .Pp @@ -225,14 +215,13 @@ ifconfig em0 vhid 1 advskew 100 pass mek ifconfig em1 vhid 2 advskew 100 pass mekmitasdigoat 192.168.2.1/24 .Ed .Pp -Because of the preempt option, when one of the physical interfaces of -host A fails, +When one of the physical interfaces of host A fails, .Cm advskew -is adjusted to 240 on all its +is demoted to a configured value on all its .Nm -interfaces. -This will cause host B to preempt on both interfaces instead of -just the failed one. +vhids. +Due to the preempt option, host B would start announcing itself, and thus +preempt host A on both interfaces instead of just the failed one. .\".Pp .\"In order to set up an ARP balanced virtual host, it is necessary to configure .\"one virtual host for each physical host which would respond to ARP requests From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 19:15:13 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F4DA106566C; Thu, 26 Jan 2012 19:15:13 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7CFAE8FC1C; Thu, 26 Jan 2012 19:15:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QJFDrs002160; Thu, 26 Jan 2012 19:15:13 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QJFD5X002158; Thu, 26 Jan 2012 19:15:13 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201201261915.q0QJFD5X002158@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Thu, 26 Jan 2012 19:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230595 - stable/9/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 19:15:13 -0000 Author: dumbbell Date: Thu Jan 26 19:15:13 2012 New Revision: 230595 URL: http://svn.freebsd.org/changeset/base/230595 Log: MFC r227992: Prevent a division by zero with some broken batteries This problem was seen on a laptop with a dead battery. Modified: stable/9/sys/dev/acpica/acpi_battery.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/acpica/acpi_battery.c ============================================================================== --- stable/9/sys/dev/acpica/acpi_battery.c Thu Jan 26 19:11:08 2012 (r230594) +++ stable/9/sys/dev/acpica/acpi_battery.c Thu Jan 26 19:15:13 2012 (r230595) @@ -205,6 +205,14 @@ acpi_battery_get_battinfo(device_t dev, bif->lfcap = (bif->lfcap * bif->dvol) / 1000; } + /* + * The calculation above may set bif->lfcap to zero. This was + * seen on a laptop with a broken battery. The result of the + * division was rounded to zero. + */ + if (!acpi_battery_bif_valid(bif)) + continue; + /* Calculate percent capacity remaining. */ bi[i].cap = (100 * bst[i].cap) / bif->lfcap; From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 19:18:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 250E61065675; Thu, 26 Jan 2012 19:18:11 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1339E8FC12; Thu, 26 Jan 2012 19:18:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QJIAJn002290; Thu, 26 Jan 2012 19:18:10 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QJIAkY002288; Thu, 26 Jan 2012 19:18:10 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201201261918.q0QJIAkY002288@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Thu, 26 Jan 2012 19:18:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230596 - stable/8/sys/dev/acpica X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 19:18:11 -0000 Author: dumbbell Date: Thu Jan 26 19:18:10 2012 New Revision: 230596 URL: http://svn.freebsd.org/changeset/base/230596 Log: MFC r227992: Prevent a division by zero with some broken batteries This problem was seen on a laptop with a dead battery. Modified: stable/8/sys/dev/acpica/acpi_battery.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/acpica/acpi_battery.c ============================================================================== --- stable/8/sys/dev/acpica/acpi_battery.c Thu Jan 26 19:15:13 2012 (r230595) +++ stable/8/sys/dev/acpica/acpi_battery.c Thu Jan 26 19:18:10 2012 (r230596) @@ -205,6 +205,14 @@ acpi_battery_get_battinfo(device_t dev, bif->lfcap = (bif->lfcap * bif->dvol) / 1000; } + /* + * The calculation above may set bif->lfcap to zero. This was + * seen on a laptop with a broken battery. The result of the + * division was rounded to zero. + */ + if (!acpi_battery_bif_valid(bif)) + continue; + /* Calculate percent capacity remaining. */ bi[i].cap = (100 * bst[i].cap) / bif->lfcap; From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 19:46:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7038D1065672; Thu, 26 Jan 2012 19:46:14 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C1738FC13; Thu, 26 Jan 2012 19:46:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QJkEmg003224; Thu, 26 Jan 2012 19:46:14 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QJkEie003214; Thu, 26 Jan 2012 19:46:14 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201201261946.q0QJkEie003214@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Thu, 26 Jan 2012 19:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230597 - in stable/9: sbin/dhclient tools/regression/sbin tools/regression/sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 19:46:14 -0000 Author: dumbbell Date: Thu Jan 26 19:46:13 2012 New Revision: 230597 URL: http://svn.freebsd.org/changeset/base/230597 Log: MFC r228259: Support domain-search in dhclient(8) The "domain-search" option (option 119) allows a DHCP server to publish a list of implicit domain suffixes used during name lookup. This option is described in RFC 3397. For instance, if the domain-search option says: ".example.org .example.com" and one wants to resolve "foobar", the resolver will try: 1. "foobar.example.org" 2. "foobar.example.com" The file /etc/resolv.conf is updated with a "search" directive if the DHCP server provides "domain-search". A regression test suite is included in this patch under tools/regression/sbin/dhclient. PR: bin/151940 Sponsored by: Yakaz (http://www.yakaz.com) MFC r229000: Invalid Domain Search option isn't considered as a fatal error In the original Domain Search option patch, an invalid option value would cause the whole lease to be rejected. However, DHCP servers who emit such an invalid value are more common than I thought. With this new patch, just the option is rejected, not the entire lease. PR: bin/163431 Submitted by: Fabian Keil (earlier version) Reviewed by: Fabian Keil Sponsored by: Yakaz (http://www.yakaz.com) MFC r229001: Adapt testsuite following change in Domain Search error handling In this testsuite, warning() and error() have the same behaviour. PR: bin/163431 Sponsored by: Yakaz (http://www.yakaz.com) Added: stable/9/tools/regression/sbin/dhclient/ - copied from r228259, head/tools/regression/sbin/dhclient/ Modified: stable/9/sbin/dhclient/clparse.c stable/9/sbin/dhclient/dhclient-script stable/9/sbin/dhclient/dhclient.c stable/9/sbin/dhclient/dhcp-options.5 stable/9/sbin/dhclient/dhcp.h stable/9/sbin/dhclient/options.c stable/9/sbin/dhclient/tables.c stable/9/tools/regression/sbin/Makefile stable/9/tools/regression/sbin/dhclient/fake.c Directory Properties: stable/9/sbin/dhclient/ (props changed) stable/9/tools/ (props changed) Modified: stable/9/sbin/dhclient/clparse.c ============================================================================== --- stable/9/sbin/dhclient/clparse.c Thu Jan 26 19:18:10 2012 (r230596) +++ stable/9/sbin/dhclient/clparse.c Thu Jan 26 19:46:13 2012 (r230597) @@ -100,6 +100,8 @@ read_client_conf(void) DHO_DOMAIN_NAME_SERVERS; top_level_config.requested_options [top_level_config.requested_option_count++] = DHO_HOST_NAME; + top_level_config.requested_options + [top_level_config.requested_option_count++] = DHO_DOMAIN_SEARCH; if ((cfile = fopen(path_dhclient_conf, "r")) != NULL) { do { Modified: stable/9/sbin/dhclient/dhclient-script ============================================================================== --- stable/9/sbin/dhclient/dhclient-script Thu Jan 26 19:18:10 2012 (r230596) +++ stable/9/sbin/dhclient/dhclient-script Thu Jan 26 19:46:13 2012 (r230597) @@ -201,7 +201,9 @@ add_new_resolv_conf() { local tmpres=/var/run/resolv.conf.${interface} rm -f $tmpres - if [ -n "$new_domain_name" ]; then + if [ -n "$new_domain_search" ]; then + echo "search $new_domain_search" >>$tmpres + elif [ -n "$new_domain_name" ]; then echo "search $new_domain_name" >>$tmpres fi Modified: stable/9/sbin/dhclient/dhclient.c ============================================================================== --- stable/9/sbin/dhclient/dhclient.c Thu Jan 26 19:18:10 2012 (r230596) +++ stable/9/sbin/dhclient/dhclient.c Thu Jan 26 19:46:13 2012 (r230597) @@ -2368,6 +2368,7 @@ check_option(struct client_lease *l, int } return (1); case DHO_DOMAIN_NAME: + case DHO_DOMAIN_SEARCH: if (!res_hnok(sbuf)) { if (!check_search(sbuf)) { warning("Bogus domain search list %d: %s (%s)", Modified: stable/9/sbin/dhclient/dhcp-options.5 ============================================================================== --- stable/9/sbin/dhclient/dhcp-options.5 Thu Jan 26 19:18:10 2012 (r230596) +++ stable/9/sbin/dhclient/dhcp-options.5 Thu Jan 26 19:46:13 2012 (r230597) @@ -265,6 +265,10 @@ character set. .It Ic option domain-name Ar string ; This option specifies the domain name that the client should use when resolving hostnames via the Domain Name System. +.It Ic option domain-search Ar string ; +This option specifies a list of domain names that the client should use +when resolving hostnames via the Domain Name System. This option is +defined in RFC 3397. .It Ic option swap-server Ar ip-address ; This specifies the IP address of the client's swap server. .It Ic option root-path Ar string ; Modified: stable/9/sbin/dhclient/dhcp.h ============================================================================== --- stable/9/sbin/dhclient/dhcp.h Thu Jan 26 19:18:10 2012 (r230596) +++ stable/9/sbin/dhclient/dhcp.h Thu Jan 26 19:46:13 2012 (r230597) @@ -169,6 +169,7 @@ struct dhcp_packet { #define DHO_STREETTALK_SERVER 75 #define DHO_STREETTALK_DA_SERVER 76 #define DHO_DHCP_USER_CLASS_ID 77 +#define DHO_DOMAIN_SEARCH 119 #define DHO_CLASSLESS_ROUTES 121 #define DHO_END 255 Modified: stable/9/sbin/dhclient/options.c ============================================================================== --- stable/9/sbin/dhclient/options.c Thu Jan 26 19:18:10 2012 (r230596) +++ stable/9/sbin/dhclient/options.c Thu Jan 26 19:46:13 2012 (r230597) @@ -55,6 +55,10 @@ void parse_options(struct packet *); void parse_option_buffer(struct packet *, unsigned char *, int); int store_options(unsigned char *, int, struct tree_cache **, unsigned char *, int, int, int, int); +void expand_domain_search(struct packet *packet); +int find_search_domain_name_len(struct option_data *option, int *offset); +void expand_search_domain_name(struct option_data *option, int *offset, + unsigned char **domain_search); /* @@ -94,6 +98,11 @@ parse_options(struct packet *packet) (unsigned char *)packet->raw->sname, sizeof(packet->raw->sname)); } + + /* Expand DHCP Domain Search option. */ + if (packet->options_valid) { + expand_domain_search(packet); + } } /* @@ -194,6 +203,171 @@ parse_option_buffer(struct packet *packe } /* + * Expand DHCP Domain Search option. The value of this option is + * encoded like DNS' list of labels. See: + * RFC 3397 + * RFC 1035 + */ +void +expand_domain_search(struct packet *packet) +{ + int offset, expanded_len, next_domain_len; + struct option_data *option; + unsigned char *domain_search, *cursor; + + if (packet->options[DHO_DOMAIN_SEARCH].data == NULL) + return; + + option = &packet->options[DHO_DOMAIN_SEARCH]; + + /* Compute final expanded length. */ + expanded_len = 0; + offset = 0; + while (offset < option->len) { + next_domain_len = find_search_domain_name_len(option, &offset); + if (next_domain_len < 0) + /* The Domain Search option value is invalid. */ + return; + + /* We add 1 for the space between domain names. */ + expanded_len += next_domain_len + 1; + } + if (expanded_len > 0) + /* Remove 1 for the superfluous trailing space. */ + --expanded_len; + + domain_search = malloc(expanded_len + 1); + if (domain_search == NULL) + error("Can't allocate storage for expanded domain-search\n"); + + offset = 0; + cursor = domain_search; + while (offset < option->len) { + expand_search_domain_name(option, &offset, &cursor); + cursor[0] = ' '; + cursor++; + } + domain_search[expanded_len] = '\0'; + + free(option->data); + option->len = expanded_len; + option->data = domain_search; +} + +int +find_search_domain_name_len(struct option_data *option, int *offset) +{ + int domain_name_len, i, label_len, pointer, pointed_len; + + domain_name_len = 0; + + i = *offset; + while (i < option->len) { + label_len = option->data[i]; + if (label_len == 0) { + /* + * A zero-length label marks the end of this + * domain name. + */ + *offset = i + 1; + return (domain_name_len); + } else if (label_len & 0xC0) { + /* This is a pointer to another list of labels. */ + if (i + 1 >= option->len) { + /* The pointer is truncated. */ + warning("Truncated pointer in DHCP Domain " + "Search option."); + return (-1); + } + + pointer = ((label_len & ~(0xC0)) << 8) + + option->data[i + 1]; + if (pointer >= *offset) { + /* + * The pointer must indicates a prior + * occurance. + */ + warning("Invalid forward pointer in DHCP " + "Domain Search option compression."); + return (-1); + } + + pointed_len = find_search_domain_name_len(option, + &pointer); + domain_name_len += pointed_len; + + *offset = i + 2; + return (domain_name_len); + } + + if (i + label_len >= option->len) { + warning("Truncated label in DHCP Domain Search " + "option."); + return (-1); + } + + /* + * Update the domain name length with the length of the + * current label, plus a trailing dot ('.'). + */ + domain_name_len += label_len + 1; + + /* Move cursor. */ + i += label_len + 1; + } + + warning("Truncated DHCP Domain Search option."); + + return (-1); +} + +void +expand_search_domain_name(struct option_data *option, int *offset, + unsigned char **domain_search) +{ + int i, label_len, pointer; + unsigned char *cursor; + + /* + * This is the same loop than the function above + * (find_search_domain_name_len). Therefore, we remove checks, + * they're already done. Here, we just make the copy. + */ + i = *offset; + cursor = *domain_search; + while (i < option->len) { + label_len = option->data[i]; + if (label_len == 0) { + /* + * A zero-length label marks the end of this + * domain name. + */ + *offset = i + 1; + *domain_search = cursor; + return; + } else if (label_len & 0xC0) { + /* This is a pointer to another list of labels. */ + pointer = ((label_len & ~(0xC0)) << 8) + + option->data[i + 1]; + + expand_search_domain_name(option, &pointer, &cursor); + + *offset = i + 2; + *domain_search = cursor; + return; + } + + /* Copy the label found. */ + memcpy(cursor, option->data + i + 1, label_len); + cursor[label_len] = '.'; + + /* Move cursor. */ + i += label_len + 1; + cursor += label_len + 1; + } +} + +/* * cons options into a big buffer, and then split them out into the * three separate buffers if needed. This allows us to cons up a set of * vendor options using the same routine. Modified: stable/9/sbin/dhclient/tables.c ============================================================================== --- stable/9/sbin/dhclient/tables.c Thu Jan 26 19:18:10 2012 (r230596) +++ stable/9/sbin/dhclient/tables.c Thu Jan 26 19:46:13 2012 (r230597) @@ -184,7 +184,7 @@ struct option dhcp_options[256] = { { "option-116", "X", &dhcp_universe, 116 }, { "option-117", "X", &dhcp_universe, 117 }, { "option-118", "X", &dhcp_universe, 118 }, - { "option-119", "X", &dhcp_universe, 119 }, + { "domain-search", "t", &dhcp_universe, 119 }, { "option-120", "X", &dhcp_universe, 120 }, { "classless-routes", "BA", &dhcp_universe, 121 }, { "option-122", "X", &dhcp_universe, 122 }, @@ -400,12 +400,13 @@ unsigned char dhcp_option_default_priori DHO_IRC_SERVER, DHO_STREETTALK_SERVER, DHO_STREETTALK_DA_SERVER, + DHO_DOMAIN_SEARCH, /* Presently-undefined options... */ 62, 63, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 118, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, Modified: stable/9/tools/regression/sbin/Makefile ============================================================================== --- stable/9/tools/regression/sbin/Makefile Thu Jan 26 19:18:10 2012 (r230596) +++ stable/9/tools/regression/sbin/Makefile Thu Jan 26 19:46:13 2012 (r230597) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= growfs +SUBDIR= dhclient growfs .include Modified: stable/9/tools/regression/sbin/dhclient/fake.c ============================================================================== --- head/tools/regression/sbin/dhclient/fake.c Sun Dec 4 14:44:31 2011 (r228259) +++ stable/9/tools/regression/sbin/dhclient/fake.c Thu Jan 26 19:46:13 2012 (r230597) @@ -32,7 +32,11 @@ warning(char *fmt, ...) va_end(ap); fprintf(stderr, "\n"); - return ret; + /* + * The original warning() would return "ret" here. We do this to + * check warnings explicitely. + */ + longjmp(env, 1); } int From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 20:02:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A74E106566B; Thu, 26 Jan 2012 20:02:41 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 197578FC0A; Thu, 26 Jan 2012 20:02:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QK2eF3003816; Thu, 26 Jan 2012 20:02:40 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QK2eWF003813; Thu, 26 Jan 2012 20:02:40 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201201262002.q0QK2eWF003813@svn.freebsd.org> From: Kip Macy Date: Thu, 26 Jan 2012 20:02:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230598 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 20:02:41 -0000 Author: kmacy Date: Thu Jan 26 20:02:40 2012 New Revision: 230598 URL: http://svn.freebsd.org/changeset/base/230598 Log: A flowtable entry can continue referencing an llentry indefinitely if the entry is repeatedly referenced within its timeout window. This change clears the LLE_VALID flag when an llentry is removed from an interface's hash table and adds an extra check to the flowtable code for the LLE_VALID flag in llentry to avoid retaining and using a stale reference. Reviewed by: qingli@ MFC after: 2 weeks Modified: head/sys/net/flowtable.c head/sys/net/if_llatbl.c Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Thu Jan 26 19:46:13 2012 (r230597) +++ head/sys/net/flowtable.c Thu Jan 26 20:02:40 2012 (r230598) @@ -1186,12 +1186,14 @@ keycheck: rt = __DEVOLATILE(struct rtentry *, fle->f_rt); lle = __DEVOLATILE(struct llentry *, fle->f_lle); if ((rt != NULL) + && lle != NULL && fle->f_fhash == hash && flowtable_key_equal(fle, key) && (proto == fle->f_proto) && (fibnum == fle->f_fibnum) && (rt->rt_flags & RTF_UP) - && (rt->rt_ifp != NULL)) { + && (rt->rt_ifp != NULL) + && (lle->la_flags & LLE_VALID)) { fs->ft_hits++; fle->f_uptime = time_uptime; fle->f_flags |= flags; Modified: head/sys/net/if_llatbl.c ============================================================================== --- head/sys/net/if_llatbl.c Thu Jan 26 19:46:13 2012 (r230597) +++ head/sys/net/if_llatbl.c Thu Jan 26 20:02:40 2012 (r230598) @@ -122,6 +122,7 @@ llentry_free(struct llentry *lle) ("%s: la_numheld %d > 0, pkts_droped %zd", __func__, lle->la_numheld, pkts_dropped)); + lle->la_flags &= ~LLE_VALID; LLE_FREE_LOCKED(lle); return (pkts_dropped); From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 20:33:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6243106566C; Thu, 26 Jan 2012 20:33:08 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50968FC12; Thu, 26 Jan 2012 20:33:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QKX8Jx005200; Thu, 26 Jan 2012 20:33:08 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QKX8eh005198; Thu, 26 Jan 2012 20:33:08 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201262033.q0QKX8eh005198@svn.freebsd.org> From: Guy Helmer Date: Thu, 26 Jan 2012 20:33:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230599 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 20:33:09 -0000 Author: ghelmer Date: Thu Jan 26 20:33:08 2012 New Revision: 230599 URL: http://svn.freebsd.org/changeset/base/230599 Log: Restore the parenthesis that are necessary around the constant values. Requested by bde. Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Jan 26 20:02:40 2012 (r230598) +++ head/lib/libutil/libutil.h Thu Jan 26 20:33:08 2012 (r230599) @@ -233,12 +233,12 @@ __END_DECLS /* Return values from uu_lock(). */ #define UU_LOCK_INUSE 1 #define UU_LOCK_OK 0 -#define UU_LOCK_OPEN_ERR -1 -#define UU_LOCK_READ_ERR -2 -#define UU_LOCK_CREAT_ERR -3 -#define UU_LOCK_WRITE_ERR -4 -#define UU_LOCK_LINK_ERR -5 -#define UU_LOCK_TRY_ERR -6 -#define UU_LOCK_OWNER_ERR -7 +#define UU_LOCK_OPEN_ERR (-1) +#define UU_LOCK_READ_ERR (-2) +#define UU_LOCK_CREAT_ERR (-3) +#define UU_LOCK_WRITE_ERR (-4) +#define UU_LOCK_LINK_ERR (-5) +#define UU_LOCK_TRY_ERR (-6) +#define UU_LOCK_OWNER_ERR (-7) #endif /* !_LIBUTIL_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 20:35:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0236106566B; Thu, 26 Jan 2012 20:35:01 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 923C58FC19; Thu, 26 Jan 2012 20:35:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QKZ16o005501; Thu, 26 Jan 2012 20:35:01 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QKZ10M005500; Thu, 26 Jan 2012 20:35:01 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201262035.q0QKZ10M005500@svn.freebsd.org> From: Guy Helmer Date: Thu, 26 Jan 2012 20:35:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230600 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 20:35:01 -0000 Author: ghelmer Date: Thu Jan 26 20:35:01 2012 New Revision: 230600 URL: http://svn.freebsd.org/changeset/base/230600 Log: Make the comments consistent (capitalization, punctuation, and format). Requested by bde Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Jan 26 20:33:08 2012 (r230599) +++ head/lib/libutil/libutil.h Thu Jan 26 20:35:01 2012 (r230600) @@ -71,14 +71,14 @@ typedef __uid_t uid_t; #define PROPERTY_MAX_NAME 64 #define PROPERTY_MAX_VALUE 512 -/* for properties.c */ +/* For properties.c. */ typedef struct _property { struct _property *next; char *name; char *value; } *properties; -/* Avoid pulling in all the include files for no need */ +/* Avoid pulling in all the include files for no need. */ struct in_addr; struct pidfh; struct sockaddr; @@ -132,7 +132,11 @@ int uu_lock(const char *_ttyname); int uu_unlock(const char *_ttyname); int uu_lock_txfr(const char *_ttyname, pid_t _pid); -#ifdef _STDIO_H_ /* avoid adding new includes */ +/* + * Conditionally prototype the following functions if the include + * files upon which they depend have been included. + */ +#ifdef _STDIO_H_ char *fparseln(FILE *_fp, size_t *_len, size_t *_lineno, const char _delim[3], int _flags); #endif @@ -209,18 +213,18 @@ __END_DECLS #define HD_OMIT_HEX (1 << 17) #define HD_OMIT_CHARS (1 << 18) -/* Flags for humanize_number(3) flags. */ +/* Values for humanize_number(3)'s flags parameter. */ #define HN_DECIMAL 0x01 #define HN_NOSPACE 0x02 #define HN_B 0x04 #define HN_DIVISOR_1000 0x08 #define HN_IEC_PREFIXES 0x10 -/* Flags for humanize_number(3) scale. */ +/* Values for humanize_number(3)'s scale parameter. */ #define HN_GETSCALE 0x10 #define HN_AUTOSCALE 0x20 -/* return values from realhostname(). */ +/* Return values from realhostname(). */ #define HOSTNAME_FOUND 0 #define HOSTNAME_INCORRECTNAME 1 #define HOSTNAME_INVALIDADDR 2 From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 20:40:22 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1D28106566B; Thu, 26 Jan 2012 20:40:22 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0F7C8FC12; Thu, 26 Jan 2012 20:40:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QKeMLg005856; Thu, 26 Jan 2012 20:40:22 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QKeM7R005854; Thu, 26 Jan 2012 20:40:22 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201201262040.q0QKeM7R005854@svn.freebsd.org> From: Guy Helmer Date: Thu, 26 Jan 2012 20:40:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230601 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 20:40:23 -0000 Author: ghelmer Date: Thu Jan 26 20:40:22 2012 New Revision: 230601 URL: http://svn.freebsd.org/changeset/base/230601 Log: Consensus between bde and pjd seemed to be that if the function names are lined up, then any * after a long type should appear after the type instead of being in front of the function name on the following line. Modified: head/lib/libutil/libutil.h Modified: head/lib/libutil/libutil.h ============================================================================== --- head/lib/libutil/libutil.h Thu Jan 26 20:35:01 2012 (r230600) +++ head/lib/libutil/libutil.h Thu Jan 26 20:40:22 2012 (r230601) @@ -154,26 +154,26 @@ char *pw_make(const struct passwd *_pw); char *pw_make_v7(const struct passwd *_pw); int pw_mkdb(const char *_user); int pw_lock(void); -struct passwd - *pw_scan(const char *_line, int _flags); -const char - *pw_tempname(void); +struct passwd * + pw_scan(const char *_line, int _flags); +const char * + pw_tempname(void); int pw_tmp(int _mfd); #endif #ifdef _GRP_H_ int gr_copy(int __ffd, int _tfd, const struct group *_gr, struct group *_old_gr); -struct group - *gr_dup(const struct group *_gr); +struct group * + gr_dup(const struct group *_gr); int gr_equal(const struct group *_gr1, const struct group *_gr2); void gr_fini(void); int gr_init(const char *_dir, const char *_master); int gr_lock(void); char *gr_make(const struct group *_gr); int gr_mkdb(void); -struct group - *gr_scan(const char *_line); +struct group * + gr_scan(const char *_line); int gr_tmp(int _mdf); #endif From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 21:43:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DFD81065673; Thu, 26 Jan 2012 21:43:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D6C358FC15; Thu, 26 Jan 2012 21:43:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QLhBjn007724; Thu, 26 Jan 2012 21:43:11 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QLhB54007721; Thu, 26 Jan 2012 21:43:11 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201262143.q0QLhB54007721@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 26 Jan 2012 21:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230602 - head/sys/dev/sound/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 21:43:12 -0000 Author: pfg Date: Thu Jan 26 21:43:11 2012 New Revision: 230602 URL: http://svn.freebsd.org/changeset/base/230602 Log: Minor cleanups to the csa snd driver. Remove unneeded temporary variable (data) to better match the OSS code. Remove some unused constants and type definitions. Tested by: joel Approved by: jhb (mentor) MFC after: 3 weeks Modified: head/sys/dev/sound/pci/csa.c head/sys/dev/sound/pci/csareg.h Modified: head/sys/dev/sound/pci/csa.c ============================================================================== --- head/sys/dev/sound/pci/csa.c Thu Jan 26 20:40:22 2012 (r230601) +++ head/sys/dev/sound/pci/csa.c Thu Jan 26 21:43:11 2012 (r230602) @@ -861,7 +861,7 @@ static int csa_downloadimage(csa_res *resp) { int i; - u_int32_t tmp, src, dst, count, data; + u_int32_t tmp, src, dst, count; for (i = 0; i < CLEAR__COUNT; i++) { dst = ClrStat[i].BA1__DestByteOffset; @@ -875,8 +875,7 @@ csa_downloadimage(csa_res *resp) dst = FillStat[i].Offset; count = FillStat[i].Size; for (tmp = 0; tmp < count; tmp += 4) { - data = FillStat[i].pFill[src]; - csa_writemem(resp, dst + tmp, data); + csa_writemem(resp, dst + tmp, FillStat[i].pFill[src]); src++; } } Modified: head/sys/dev/sound/pci/csareg.h ============================================================================== --- head/sys/dev/sound/pci/csareg.h Thu Jan 26 20:40:22 2012 (r230601) +++ head/sys/dev/sound/pci/csareg.h Thu Jan 26 21:43:11 2012 (r230602) @@ -1949,24 +1949,4 @@ #define CS_AC97_POWER_CONTROL_MIXVON_ON 0x0004 #define CS_AC97_POWER_CONTROL_MIXVOFF_ON 0x0008 -/* The following struct holds the initialization array. */ - -/* - * this is 3*1024 for parameter, 3.5*1024 for sample and 2*3.5*1024 for code since - * each instruction is 40 bits and takes two dwords - */ -#define INKY_BA1_DWORD_SIZE (13 * 1024 + 512) -#define INKY_MEMORY_COUNT 3 - -struct BA1struct -{ - struct - { - u_long ulDestByteOffset, - ulSourceByteSize; - } MemoryStat[INKY_MEMORY_COUNT]; - - u_long BA1Array[INKY_BA1_DWORD_SIZE]; -}; - #endif /* _CSA_REG_H */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 26 22:01:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58900106566B; Thu, 26 Jan 2012 22:01:06 +0000 (UTC) (envelope-from dumbbell@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 448088FC0C; Thu, 26 Jan 2012 22:01:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0QM16gx008331; Thu, 26 Jan 2012 22:01:06 GMT (envelope-from dumbbell@svn.freebsd.org) Received: (from dumbbell@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0QM15Sh008320; Thu, 26 Jan 2012 22:01:05 GMT (envelope-from dumbbell@svn.freebsd.org) Message-Id: <201201262201.q0QM15Sh008320@svn.freebsd.org> From: Jean-Sebastien Pedron Date: Thu, 26 Jan 2012 22:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230603 - in stable/8: sbin/dhclient tools/regression/sbin tools/regression/sbin/dhclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 22:01:06 -0000 Author: dumbbell Date: Thu Jan 26 22:01:05 2012 New Revision: 230603 URL: http://svn.freebsd.org/changeset/base/230603 Log: MFC r228259: Support domain-search in dhclient(8) The "domain-search" option (option 119) allows a DHCP server to publish a list of implicit domain suffixes used during name lookup. This option is described in RFC 3397. For instance, if the domain-search option says: ".example.org .example.com" and one wants to resolve "foobar", the resolver will try: 1. "foobar.example.org" 2. "foobar.example.com" The file /etc/resolv.conf is updated with a "search" directive if the DHCP server provides "domain-search". A regression test suite is included in this patch under tools/regression/sbin/dhclient. PR: bin/151940 Sponsored by: Yakaz (http://www.yakaz.com) MFC r229000: Invalid Domain Search option isn't considered as a fatal error In the original Domain Search option patch, an invalid option value would cause the whole lease to be rejected. However, DHCP servers who emit such an invalid value are more common than I thought. With this new patch, just the option is rejected, not the entire lease. PR: bin/163431 Submitted by: Fabian Keil (earlier version) Reviewed by: Fabian Keil Sponsored by: Yakaz (http://www.yakaz.com) MFC r229001: Adapt testsuite following change in Domain Search error handling In this testsuite, warning() and error() have the same behaviour. PR: bin/163431 Sponsored by: Yakaz (http://www.yakaz.com) Added: stable/8/tools/regression/sbin/dhclient/ - copied from r228259, head/tools/regression/sbin/dhclient/ Modified: stable/8/sbin/dhclient/clparse.c stable/8/sbin/dhclient/dhclient-script stable/8/sbin/dhclient/dhclient.c stable/8/sbin/dhclient/dhcp-options.5 stable/8/sbin/dhclient/dhcp.h stable/8/sbin/dhclient/options.c stable/8/sbin/dhclient/tables.c stable/8/tools/regression/sbin/Makefile stable/8/tools/regression/sbin/dhclient/fake.c Directory Properties: stable/8/sbin/dhclient/ (props changed) stable/8/tools/ (props changed) Modified: stable/8/sbin/dhclient/clparse.c ============================================================================== --- stable/8/sbin/dhclient/clparse.c Thu Jan 26 21:43:11 2012 (r230602) +++ stable/8/sbin/dhclient/clparse.c Thu Jan 26 22:01:05 2012 (r230603) @@ -100,6 +100,8 @@ read_client_conf(void) DHO_DOMAIN_NAME_SERVERS; top_level_config.requested_options [top_level_config.requested_option_count++] = DHO_HOST_NAME; + top_level_config.requested_options + [top_level_config.requested_option_count++] = DHO_DOMAIN_SEARCH; if ((cfile = fopen(path_dhclient_conf, "r")) != NULL) { do { Modified: stable/8/sbin/dhclient/dhclient-script ============================================================================== --- stable/8/sbin/dhclient/dhclient-script Thu Jan 26 21:43:11 2012 (r230602) +++ stable/8/sbin/dhclient/dhclient-script Thu Jan 26 22:01:05 2012 (r230603) @@ -201,7 +201,9 @@ add_new_resolv_conf() { local tmpres=/var/run/resolv.conf.${interface} rm -f $tmpres - if [ -n "$new_domain_name" ]; then + if [ -n "$new_domain_search" ]; then + echo "search $new_domain_search" >>$tmpres + elif [ -n "$new_domain_name" ]; then echo "search $new_domain_name" >>$tmpres fi Modified: stable/8/sbin/dhclient/dhclient.c ============================================================================== --- stable/8/sbin/dhclient/dhclient.c Thu Jan 26 21:43:11 2012 (r230602) +++ stable/8/sbin/dhclient/dhclient.c Thu Jan 26 22:01:05 2012 (r230603) @@ -2368,6 +2368,7 @@ check_option(struct client_lease *l, int } return (1); case DHO_DOMAIN_NAME: + case DHO_DOMAIN_SEARCH: if (!res_hnok(sbuf)) { if (!check_search(sbuf)) { warning("Bogus domain search list %d: %s (%s)", Modified: stable/8/sbin/dhclient/dhcp-options.5 ============================================================================== --- stable/8/sbin/dhclient/dhcp-options.5 Thu Jan 26 21:43:11 2012 (r230602) +++ stable/8/sbin/dhclient/dhcp-options.5 Thu Jan 26 22:01:05 2012 (r230603) @@ -265,6 +265,10 @@ character set. .It Ic option domain-name Ar string ; This option specifies the domain name that the client should use when resolving hostnames via the Domain Name System. +.It Ic option domain-search Ar string ; +This option specifies a list of domain names that the client should use +when resolving hostnames via the Domain Name System. This option is +defined in RFC 3397. .It Ic option swap-server Ar ip-address ; This specifies the IP address of the client's swap server. .It Ic option root-path Ar string ; Modified: stable/8/sbin/dhclient/dhcp.h ============================================================================== --- stable/8/sbin/dhclient/dhcp.h Thu Jan 26 21:43:11 2012 (r230602) +++ stable/8/sbin/dhclient/dhcp.h Thu Jan 26 22:01:05 2012 (r230603) @@ -169,6 +169,7 @@ struct dhcp_packet { #define DHO_STREETTALK_SERVER 75 #define DHO_STREETTALK_DA_SERVER 76 #define DHO_DHCP_USER_CLASS_ID 77 +#define DHO_DOMAIN_SEARCH 119 #define DHO_CLASSLESS_ROUTES 121 #define DHO_END 255 Modified: stable/8/sbin/dhclient/options.c ============================================================================== --- stable/8/sbin/dhclient/options.c Thu Jan 26 21:43:11 2012 (r230602) +++ stable/8/sbin/dhclient/options.c Thu Jan 26 22:01:05 2012 (r230603) @@ -55,6 +55,10 @@ void parse_options(struct packet *); void parse_option_buffer(struct packet *, unsigned char *, int); int store_options(unsigned char *, int, struct tree_cache **, unsigned char *, int, int, int, int); +void expand_domain_search(struct packet *packet); +int find_search_domain_name_len(struct option_data *option, int *offset); +void expand_search_domain_name(struct option_data *option, int *offset, + unsigned char **domain_search); /* @@ -94,6 +98,11 @@ parse_options(struct packet *packet) (unsigned char *)packet->raw->sname, sizeof(packet->raw->sname)); } + + /* Expand DHCP Domain Search option. */ + if (packet->options_valid) { + expand_domain_search(packet); + } } /* @@ -194,6 +203,171 @@ parse_option_buffer(struct packet *packe } /* + * Expand DHCP Domain Search option. The value of this option is + * encoded like DNS' list of labels. See: + * RFC 3397 + * RFC 1035 + */ +void +expand_domain_search(struct packet *packet) +{ + int offset, expanded_len, next_domain_len; + struct option_data *option; + unsigned char *domain_search, *cursor; + + if (packet->options[DHO_DOMAIN_SEARCH].data == NULL) + return; + + option = &packet->options[DHO_DOMAIN_SEARCH]; + + /* Compute final expanded length. */ + expanded_len = 0; + offset = 0; + while (offset < option->len) { + next_domain_len = find_search_domain_name_len(option, &offset); + if (next_domain_len < 0) + /* The Domain Search option value is invalid. */ + return; + + /* We add 1 for the space between domain names. */ + expanded_len += next_domain_len + 1; + } + if (expanded_len > 0) + /* Remove 1 for the superfluous trailing space. */ + --expanded_len; + + domain_search = malloc(expanded_len + 1); + if (domain_search == NULL) + error("Can't allocate storage for expanded domain-search\n"); + + offset = 0; + cursor = domain_search; + while (offset < option->len) { + expand_search_domain_name(option, &offset, &cursor); + cursor[0] = ' '; + cursor++; + } + domain_search[expanded_len] = '\0'; + + free(option->data); + option->len = expanded_len; + option->data = domain_search; +} + +int +find_search_domain_name_len(struct option_data *option, int *offset) +{ + int domain_name_len, i, label_len, pointer, pointed_len; + + domain_name_len = 0; + + i = *offset; + while (i < option->len) { + label_len = option->data[i]; + if (label_len == 0) { + /* + * A zero-length label marks the end of this + * domain name. + */ + *offset = i + 1; + return (domain_name_len); + } else if (label_len & 0xC0) { + /* This is a pointer to another list of labels. */ + if (i + 1 >= option->len) { + /* The pointer is truncated. */ + warning("Truncated pointer in DHCP Domain " + "Search option."); + return (-1); + } + + pointer = ((label_len & ~(0xC0)) << 8) + + option->data[i + 1]; + if (pointer >= *offset) { + /* + * The pointer must indicates a prior + * occurance. + */ + warning("Invalid forward pointer in DHCP " + "Domain Search option compression."); + return (-1); + } + + pointed_len = find_search_domain_name_len(option, + &pointer); + domain_name_len += pointed_len; + + *offset = i + 2; + return (domain_name_len); + } + + if (i + label_len >= option->len) { + warning("Truncated label in DHCP Domain Search " + "option."); + return (-1); + } + + /* + * Update the domain name length with the length of the + * current label, plus a trailing dot ('.'). + */ + domain_name_len += label_len + 1; + + /* Move cursor. */ + i += label_len + 1; + } + + warning("Truncated DHCP Domain Search option."); + + return (-1); +} + +void +expand_search_domain_name(struct option_data *option, int *offset, + unsigned char **domain_search) +{ + int i, label_len, pointer; + unsigned char *cursor; + + /* + * This is the same loop than the function above + * (find_search_domain_name_len). Therefore, we remove checks, + * they're already done. Here, we just make the copy. + */ + i = *offset; + cursor = *domain_search; + while (i < option->len) { + label_len = option->data[i]; + if (label_len == 0) { + /* + * A zero-length label marks the end of this + * domain name. + */ + *offset = i + 1; + *domain_search = cursor; + return; + } else if (label_len & 0xC0) { + /* This is a pointer to another list of labels. */ + pointer = ((label_len & ~(0xC0)) << 8) + + option->data[i + 1]; + + expand_search_domain_name(option, &pointer, &cursor); + + *offset = i + 2; + *domain_search = cursor; + return; + } + + /* Copy the label found. */ + memcpy(cursor, option->data + i + 1, label_len); + cursor[label_len] = '.'; + + /* Move cursor. */ + i += label_len + 1; + cursor += label_len + 1; + } +} + +/* * cons options into a big buffer, and then split them out into the * three separate buffers if needed. This allows us to cons up a set of * vendor options using the same routine. Modified: stable/8/sbin/dhclient/tables.c ============================================================================== --- stable/8/sbin/dhclient/tables.c Thu Jan 26 21:43:11 2012 (r230602) +++ stable/8/sbin/dhclient/tables.c Thu Jan 26 22:01:05 2012 (r230603) @@ -184,7 +184,7 @@ struct option dhcp_options[256] = { { "option-116", "X", &dhcp_universe, 116 }, { "option-117", "X", &dhcp_universe, 117 }, { "option-118", "X", &dhcp_universe, 118 }, - { "option-119", "X", &dhcp_universe, 119 }, + { "domain-search", "t", &dhcp_universe, 119 }, { "option-120", "X", &dhcp_universe, 120 }, { "classless-routes", "BA", &dhcp_universe, 121 }, { "option-122", "X", &dhcp_universe, 122 }, @@ -400,12 +400,13 @@ unsigned char dhcp_option_default_priori DHO_IRC_SERVER, DHO_STREETTALK_SERVER, DHO_STREETTALK_DA_SERVER, + DHO_DOMAIN_SEARCH, /* Presently-undefined options... */ 62, 63, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, + 118, 120, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, Modified: stable/8/tools/regression/sbin/Makefile ============================================================================== --- stable/8/tools/regression/sbin/Makefile Thu Jan 26 21:43:11 2012 (r230602) +++ stable/8/tools/regression/sbin/Makefile Thu Jan 26 22:01:05 2012 (r230603) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= growfs +SUBDIR= dhclient growfs .include Modified: stable/8/tools/regression/sbin/dhclient/fake.c ============================================================================== --- head/tools/regression/sbin/dhclient/fake.c Sun Dec 4 14:44:31 2011 (r228259) +++ stable/8/tools/regression/sbin/dhclient/fake.c Thu Jan 26 22:01:05 2012 (r230603) @@ -32,7 +32,11 @@ warning(char *fmt, ...) va_end(ap); fprintf(stderr, "\n"); - return ret; + /* + * The original warning() would return "ret" here. We do this to + * check warnings explicitely. + */ + longjmp(env, 1); } int From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 02:13:28 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D2ED106564A; Fri, 27 Jan 2012 02:13:28 +0000 (UTC) (envelope-from qingli@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 70CA58FC19; Fri, 27 Jan 2012 02:13:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0R2DSKq016068; Fri, 27 Jan 2012 02:13:28 GMT (envelope-from qingli@svn.freebsd.org) Received: (from qingli@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0R2DS3x016063; Fri, 27 Jan 2012 02:13:28 GMT (envelope-from qingli@svn.freebsd.org) Message-Id: <201201270213.q0R2DS3x016063@svn.freebsd.org> From: Qing Li Date: Fri, 27 Jan 2012 02:13:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230604 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 02:13:28 -0000 Author: qingli Date: Fri Jan 27 02:13:27 2012 New Revision: 230604 URL: http://svn.freebsd.org/changeset/base/230604 Log: MFC 227460 A default route learned from the RAs could be deleted manually after its installation. This removal may be accidental and can prevent the default route from being installed in the future if the associated default router has the best preference. The cause is the lack of status update in the default router on the state of its route installation in the kernel FIB. This patch fixes the described problem. Reviewed by: hrs, discussed with hrs Modified: stable/9/sys/netinet6/in6.c stable/9/sys/netinet6/nd6.c stable/9/sys/netinet6/nd6.h stable/9/sys/netinet6/nd6_rtr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Thu Jan 26 22:01:05 2012 (r230603) +++ stable/9/sys/netinet6/in6.c Fri Jan 27 02:13:27 2012 (r230604) @@ -152,7 +152,7 @@ in6_ifaddloop(struct ifaddr *ifa) ia = ifa2ia6(ifa); ifp = ifa->ifa_ifp; IF_AFDATA_LOCK(ifp); - ifa->ifa_rtrequest = NULL; + ifa->ifa_rtrequest = nd6_rtrequest; /* XXX QL * we need to report rt_newaddrmsg Modified: stable/9/sys/netinet6/nd6.c ============================================================================== --- stable/9/sys/netinet6/nd6.c Thu Jan 26 22:01:05 2012 (r230603) +++ stable/9/sys/netinet6/nd6.c Fri Jan 27 02:13:27 2012 (r230604) @@ -1174,6 +1174,46 @@ done: } +/* + * Rejuvenate this function for routing operations related + * processing. + */ +void +nd6_rtrequest(int req, struct rtentry *rt, struct rt_addrinfo *info) +{ + struct sockaddr_in6 *gateway = (struct sockaddr_in6 *)rt->rt_gateway; + struct nd_defrouter *dr; + struct ifnet *ifp = rt->rt_ifp; + + RT_LOCK_ASSERT(rt); + + switch (req) { + case RTM_ADD: + break; + + case RTM_DELETE: + if (!ifp) + return; + /* + * Only indirect routes are interesting. + */ + if ((rt->rt_flags & RTF_GATEWAY) == 0) + return; + /* + * check for default route + */ + if (IN6_ARE_ADDR_EQUAL(&in6addr_any, + &SIN6(rt_key(rt))->sin6_addr)) { + + dr = defrouter_lookup(&gateway->sin6_addr, ifp); + if (dr != NULL) + dr->installed = 0; + } + break; + } +} + + int nd6_ioctl(u_long cmd, caddr_t data, struct ifnet *ifp) { Modified: stable/9/sys/netinet6/nd6.h ============================================================================== --- stable/9/sys/netinet6/nd6.h Thu Jan 26 22:01:05 2012 (r230603) +++ stable/9/sys/netinet6/nd6.h Fri Jan 27 02:13:27 2012 (r230604) @@ -406,6 +406,7 @@ void nd6_purge __P((struct ifnet *)); void nd6_nud_hint __P((struct rtentry *, struct in6_addr *, int)); int nd6_resolve __P((struct ifnet *, struct rtentry *, struct mbuf *, struct sockaddr *, u_char *)); +void nd6_rtrequest __P((int, struct rtentry *, struct rt_addrinfo *)); int nd6_ioctl __P((u_long, caddr_t, struct ifnet *)); struct llentry *nd6_cache_lladdr __P((struct ifnet *, struct in6_addr *, char *, int, int, int)); Modified: stable/9/sys/netinet6/nd6_rtr.c ============================================================================== --- stable/9/sys/netinet6/nd6_rtr.c Thu Jan 26 22:01:05 2012 (r230603) +++ stable/9/sys/netinet6/nd6_rtr.c Fri Jan 27 02:13:27 2012 (r230604) @@ -751,9 +751,10 @@ defrtrlist_update(struct nd_defrouter *n /* * If the preference does not change, there's no need - * to sort the entries. + * to sort the entries. Also make sure the selected + * router is still installed in the kernel. */ - if (rtpref(new) == oldpref) { + if (dr->installed && rtpref(new) == oldpref) { splx(s); return (dr); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 02:46:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6CE4106564A; Fri, 27 Jan 2012 02:46:12 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A4B758FC08; Fri, 27 Jan 2012 02:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0R2kCnx017341; Fri, 27 Jan 2012 02:46:12 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0R2kCpU017336; Fri, 27 Jan 2012 02:46:12 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201270246.q0R2kCpU017336@svn.freebsd.org> From: Rick Macklem Date: Fri, 27 Jan 2012 02:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230605 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 02:46:12 -0000 Author: rmacklem Date: Fri Jan 27 02:46:12 2012 New Revision: 230605 URL: http://svn.freebsd.org/changeset/base/230605 Log: A problem with respect to data read through the buffer cache for both NFS clients was reported to freebsd-fs@ under the subject "NFS corruption in recent HEAD" on Nov. 26, 2011. This problem occurred when a TCP mounted root fs was changed to using UDP. I believe that this problem was caused by the change in mnt_stat.f_iosize that occurred because rsize was decreased to the maximum supported by UDP. This patch fixes the problem by using v_bufobj.bo_bsize instead of f_iosize, since the latter is set to f_iosize when the vnode is allocated, but does not change for a given vnode when f_iosize changes. Reported by: pjd Reviewed by: kib MFC after: 2 weeks Modified: head/sys/fs/nfsclient/nfs_clbio.c head/sys/fs/nfsclient/nfs_clnode.c head/sys/fs/nfsclient/nfs_clport.c head/sys/nfsclient/nfs_bio.c Modified: head/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clbio.c Fri Jan 27 02:13:27 2012 (r230604) +++ head/sys/fs/nfsclient/nfs_clbio.c Fri Jan 27 02:46:12 2012 (r230605) @@ -480,7 +480,7 @@ ncl_bioread(struct vnode *vp, struct uio /* No caching/ no readaheads. Just read data into the user buffer */ return ncl_readrpc(vp, uio, cred); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); error = nfs_bioread_check_cons(vp, td, cred); @@ -960,7 +960,7 @@ flush_and_restart: if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes * would exceed the local maximum per-file write commit size when @@ -1264,12 +1264,8 @@ nfs_getcacheblk(struct vnode *vp, daddr_ bp = getblk(vp, bn, size, 0, 0, 0); } - if (vp->v_type == VREG) { - int biosize; - - biosize = mp->mnt_stat.f_iosize; - bp->b_blkno = bn * (biosize / DEV_BSIZE); - } + if (vp->v_type == VREG) + bp->b_blkno = bn * (vp->v_bufobj.bo_bsize / DEV_BSIZE); return (bp); } @@ -1785,7 +1781,7 @@ ncl_meta_setsize(struct vnode *vp, struc { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; - int biosize = vp->v_mount->mnt_stat.f_iosize; + int biosize = vp->v_bufobj.bo_bsize; int error = 0; mtx_lock(&np->n_mtx); Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Fri Jan 27 02:13:27 2012 (r230604) +++ head/sys/fs/nfsclient/nfs_clnode.c Fri Jan 27 02:46:12 2012 (r230605) @@ -136,6 +136,7 @@ ncl_nget(struct mount *mntp, u_int8_t *f return (error); } vp = nvp; + KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0")); vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Fri Jan 27 02:13:27 2012 (r230604) +++ head/sys/fs/nfsclient/nfs_clport.c Fri Jan 27 02:46:12 2012 (r230605) @@ -212,6 +212,7 @@ nfscl_nget(struct mount *mntp, struct vn return (error); } vp = nvp; + KASSERT(vp->v_bufobj.bo_bsize != 0, ("nfscl_nget: bo_bsize == 0")); vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; Modified: head/sys/nfsclient/nfs_bio.c ============================================================================== --- head/sys/nfsclient/nfs_bio.c Fri Jan 27 02:13:27 2012 (r230604) +++ head/sys/nfsclient/nfs_bio.c Fri Jan 27 02:46:12 2012 (r230605) @@ -474,7 +474,7 @@ nfs_bioread(struct vnode *vp, struct uio /* No caching/ no readaheads. Just read data into the user buffer */ return nfs_readrpc(vp, uio, cred); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; seqcount = (int)((off_t)(ioflag >> IO_SEQSHIFT) * biosize / BKVASIZE); error = nfs_bioread_check_cons(vp, td, cred); @@ -951,7 +951,7 @@ flush_and_restart: if (vn_rlimit_fsize(vp, uio, td)) return (EFBIG); - biosize = vp->v_mount->mnt_stat.f_iosize; + biosize = vp->v_bufobj.bo_bsize; /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes * would exceed the local maximum per-file write commit size when @@ -1255,12 +1255,8 @@ nfs_getcacheblk(struct vnode *vp, daddr_ bp = getblk(vp, bn, size, 0, 0, 0); } - if (vp->v_type == VREG) { - int biosize; - - biosize = mp->mnt_stat.f_iosize; - bp->b_blkno = bn * (biosize / DEV_BSIZE); - } + if (vp->v_type == VREG) + bp->b_blkno = bn * (vp->v_bufobj.bo_bsize / DEV_BSIZE); return (bp); } @@ -1767,7 +1763,7 @@ nfs_meta_setsize(struct vnode *vp, struc { struct nfsnode *np = VTONFS(vp); u_quad_t tsize; - int biosize = vp->v_mount->mnt_stat.f_iosize; + int biosize = vp->v_bufobj.bo_bsize; int error = 0; mtx_lock(&np->n_mtx); From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 06:28:20 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A5021106566C; Fri, 27 Jan 2012 06:28:20 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 2648F8FC08; Fri, 27 Jan 2012 06:28:19 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0R6SGJS022139 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jan 2012 17:28:17 +1100 Date: Fri, 27 Jan 2012 17:28:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Guy Helmer In-Reply-To: <201201262035.q0QKZ10M005500@svn.freebsd.org> Message-ID: <20120127172656.V992@besplex.bde.org> References: <201201262035.q0QKZ10M005500@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230600 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 06:28:20 -0000 On Thu, 26 Jan 2012, Guy Helmer wrote: > Log: > Make the comments consistent (capitalization, punctuation, and > format). > > Requested by bde Thanks. Sorry I never got around to replying to your mail that contained a patch for this. It seemed complete and correct. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 07:15:15 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 584C61065677; Fri, 27 Jan 2012 07:15:15 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 465808FC19; Fri, 27 Jan 2012 07:15:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0R7FF97027376; Fri, 27 Jan 2012 07:15:15 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0R7FFiY027374; Fri, 27 Jan 2012 07:15:15 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201270715.q0R7FFiY027374@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 27 Jan 2012 07:15:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230607 - stable/9/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 07:15:15 -0000 Author: pluknet Date: Fri Jan 27 07:15:14 2012 New Revision: 230607 URL: http://svn.freebsd.org/changeset/base/230607 Log: MFC r230496: Remove the stale XXX rt_newaddrmsg comment. Modified: stable/9/sys/netinet6/in6.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/netinet6/in6.c ============================================================================== --- stable/9/sys/netinet6/in6.c Fri Jan 27 05:04:47 2012 (r230606) +++ stable/9/sys/netinet6/in6.c Fri Jan 27 07:15:14 2012 (r230607) @@ -153,10 +153,6 @@ in6_ifaddloop(struct ifaddr *ifa) ifp = ifa->ifa_ifp; IF_AFDATA_LOCK(ifp); ifa->ifa_rtrequest = nd6_rtrequest; - - /* XXX QL - * we need to report rt_newaddrmsg - */ ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR | LLE_EXCLUSIVE), (struct sockaddr *)&ia->ia_addr); IF_AFDATA_UNLOCK(ifp); From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 07:34:49 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D78CE106564A; Fri, 27 Jan 2012 07:34:49 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper-int.allbsd.org [IPv6:2001:2f0:104:e002::2]) by mx1.freebsd.org (Postfix) with ESMTP id AA6C08FC08; Fri, 27 Jan 2012 07:34:48 +0000 (UTC) Received: from alph.allbsd.org ([IPv6:2001:2f0:104:e010:862b:2bff:febc:8956]) (authenticated bits=128) by mail.allbsd.org (8.14.4/8.14.4) with ESMTP id q0R7YaT0045389; Fri, 27 Jan 2012 16:34:46 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [IPv6:::1]) (authenticated bits=0) by alph.allbsd.org (8.14.4/8.14.4) with ESMTP id q0R7YYDL045061; Fri, 27 Jan 2012 16:34:35 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Fri, 27 Jan 2012 16:34:16 +0900 (JST) Message-Id: <20120127.163416.2189393622265082144.hrs@allbsd.org> To: ae@FreeBSD.org From: Hiroki Sato In-Reply-To: <4F2115A2.2010803@FreeBSD.org> References: <201201260851.q0Q8pO3f073097@svn.freebsd.org> <4F2115A2.2010803@FreeBSD.org> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.4 on Emacs 23.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Fri_Jan_27_16_34_16_2012_358)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (mail.allbsd.org [IPv6:2001:2f0:104:e001::32]); Fri, 27 Jan 2012 16:34:46 +0900 (JST) X-Spam-Status: No, score=-104.6 required=13.0 tests=BAYES_00, CONTENT_TYPE_PRESENT, RDNS_NONE, SPF_SOFTFAIL, USER_IN_WHITELIST autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on gatekeeper.allbsd.org Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-8@FreeBSD.org Subject: Re: svn commit: r230568 - stable/8/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 07:34:50 -0000 ----Security_Multipart(Fri_Jan_27_16_34_16_2012_358)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit "Andrey V. Elsukov" wrote in <4F2115A2.2010803@FreeBSD.org>: ae> On 26.01.2012 12:51, Andrey V. Elsukov wrote: ae> > Author: ae ae> > Date: Thu Jan 26 08:51:23 2012 ae> > New Revision: 230568 ae> > URL: http://svn.freebsd.org/changeset/base/230568 ae> > ae> > Log: ae> > Disable integrity checks by default. It will warn users about found ae> > problems, but will not reject partition tables. ae> ae> Users may discover that their partition tables marked as corrupted. ae> This will prevent modifying tables and write boot code, but probably ae> this behavior should be disabled in 8-STABLE. ae> Any opinions are welcome. I also think it is reasonable to disable the check in gpart on 8-STABLE. -- Hiroki ----Security_Multipart(Fri_Jan_27_16_34_16_2012_358)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAk8iU3gACgkQTyzT2CeTzy2XrACgsYKhKMvn5EFF3XcAvBxyEuE8 nIEAnRbHy5edklOrJTBWEccBe51lJM5g =V/oW -----END PGP SIGNATURE----- ----Security_Multipart(Fri_Jan_27_16_34_16_2012_358)---- From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 07:37:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24CF41065670; Fri, 27 Jan 2012 07:37:11 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 131B68FC15; Fri, 27 Jan 2012 07:37:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0R7bAE1028081; Fri, 27 Jan 2012 07:37:10 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0R7bA08028079; Fri, 27 Jan 2012 07:37:10 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201270737.q0R7bA08028079@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 27 Jan 2012 07:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230608 - stable/8/sys/netinet6 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 07:37:11 -0000 Author: pluknet Date: Fri Jan 27 07:37:10 2012 New Revision: 230608 URL: http://svn.freebsd.org/changeset/base/230608 Log: MFC r230496: Remove the stale XXX rt_newaddrmsg comment. Modified: stable/8/sys/netinet6/in6.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet6/in6.c ============================================================================== --- stable/8/sys/netinet6/in6.c Fri Jan 27 07:15:14 2012 (r230607) +++ stable/8/sys/netinet6/in6.c Fri Jan 27 07:37:10 2012 (r230608) @@ -1811,10 +1811,6 @@ in6_ifinit(struct ifnet *ifp, struct in6 IF_AFDATA_LOCK(ifp); ia->ia_ifa.ifa_rtrequest = nd6_rtrequest; - - /* XXX QL - * we need to report rt_newaddrmsg - */ ln = lla_lookup(LLTABLE6(ifp), (LLE_CREATE | LLE_IFADDR | LLE_EXCLUSIVE), (struct sockaddr *)&ia->ia_addr); IF_AFDATA_UNLOCK(ifp); From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 08:46:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BAB66106564A; Fri, 27 Jan 2012 08:46:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A827F8FC08; Fri, 27 Jan 2012 08:46:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0R8kWHO030255; Fri, 27 Jan 2012 08:46:32 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0R8kWUt030253; Fri, 27 Jan 2012 08:46:32 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201270846.q0R8kWUt030253@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 27 Jan 2012 08:46:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230609 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 08:46:32 -0000 Author: glebius Date: Fri Jan 27 08:46:32 2012 New Revision: 230609 URL: http://svn.freebsd.org/changeset/base/230609 Log: Do not mention SIOCSIFADDR. Modified: head/share/man/man4/lo.4 Modified: head/share/man/man4/lo.4 ============================================================================== --- head/share/man/man4/lo.4 Fri Jan 27 07:37:10 2012 (r230608) +++ head/share/man/man4/lo.4 Fri Jan 27 08:46:32 2012 (r230609) @@ -30,7 +30,7 @@ .\" @(#)lo.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd March 15, 2009 +.Dd January 25, 2012 .Dt LO 4 .Os .Sh NAME @@ -47,9 +47,9 @@ communication. As with other network interfaces, the loopback interface must have network addresses assigned for each address family with which it is to be used. These addresses -may be set or changed with the -.Dv SIOCSIFADDR -.Xr ioctl 2 . +may be set with the appropriate +.Xr ioctl 2 +commands for corresponding address families. The loopback interface should be the last interface configured, as protocols may use the order of configuration as an indication of priority. The loopback should From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 08:50:34 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D364B106564A; Fri, 27 Jan 2012 08:50:34 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.freebsd.org (Postfix) with ESMTP id 544E58FC12; Fri, 27 Jan 2012 08:50:33 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail05.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0R8oUCA011934 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jan 2012 19:50:31 +1100 Date: Fri, 27 Jan 2012 19:50:30 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff In-Reply-To: <20120126153641.GA68112@FreeBSD.org> Message-ID: <20120127194612.H1547@besplex.bde.org> References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 08:50:34 -0000 On Thu, 26 Jan 2012, Gleb Smirnoff wrote: > On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: > B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio > B> > return (error); > B> > } > B> > > B> > + /* XXX: aio_nbytes is later casted to signed types. */ > B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { > B> > B> This should avoid implementation-defined behaviour by checking if > B> > B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. > Is the attached patch okay? Yes. It now matches the style used for read^Wsys_read() and friends. This used to have to fit the count in "int uio_resid". uio_resid now has type ssize_t, but for some reason the old INT_MAX limits remain. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 08:58:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54B90106564A; Fri, 27 Jan 2012 08:58:59 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43B2F8FC13; Fri, 27 Jan 2012 08:58:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0R8wxi6030722; Fri, 27 Jan 2012 08:58:59 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0R8wx09030720; Fri, 27 Jan 2012 08:58:59 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201201270858.q0R8wx09030720@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 27 Jan 2012 08:58:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230610 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 08:58:59 -0000 Author: glebius Date: Fri Jan 27 08:58:58 2012 New Revision: 230610 URL: http://svn.freebsd.org/changeset/base/230610 Log: Fix size check, that prevents getting negative after casting to a signed type Reviewed by: bde Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Fri Jan 27 08:46:32 2012 (r230609) +++ head/sys/kern/vfs_aio.c Fri Jan 27 08:58:58 2012 (r230610) @@ -1553,7 +1553,7 @@ aio_aqueue(struct thread *td, struct aio } /* XXX: aio_nbytes is later casted to signed types. */ - if ((int)aiocbe->uaiocb.aio_nbytes < 0) { + if (aiocbe->uaiocb.aio_nbytes > INT_MAX) { uma_zfree(aiocb_zone, aiocbe); return (EINVAL); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 09:13:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AB59106566B; Fri, 27 Jan 2012 09:13:10 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 0F9068FC15; Fri, 27 Jan 2012 09:13:09 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0R9Cj2r088776 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jan 2012 11:12:45 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0R9CiRs041347; Fri, 27 Jan 2012 11:12:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0R9Ci1Y041346; Fri, 27 Jan 2012 11:12:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 27 Jan 2012 11:12:44 +0200 From: Kostik Belousov To: Bruce Evans Message-ID: <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="AAiVQQES42Kk67ff" Content-Disposition: inline In-Reply-To: <20120127194612.H1547@besplex.bde.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 09:13:10 -0000 --AAiVQQES42Kk67ff Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 27, 2012 at 07:50:30PM +1100, Bruce Evans wrote: > On Thu, 26 Jan 2012, Gleb Smirnoff wrote: >=20 > >On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: > >B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio > >B> > return (error); > >B> > } > >B> > > >B> > + /* XXX: aio_nbytes is later casted to signed types. */ > >B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { > >B> > >B> This should avoid implementation-defined behaviour by checking if > >B> > >B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. >=20 > >Is the attached patch okay? >=20 > Yes. It now matches the style used for read^Wsys_read() and friends. > This used to have to fit the count in "int uio_resid". uio_resid now > has type ssize_t, but for some reason the old INT_MAX limits remain. Well, I can revive the patch. I still think it is good to get rid of the limit. --AAiVQQES42Kk67ff Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8iaowACgkQC3+MBN1Mb4iylgCfataZKijFQ1rXTJojfdaX18cp CMIAoIKpWYIbWfnLE4Tc5OF9/QYDoFiv =j2qm -----END PGP SIGNATURE----- --AAiVQQES42Kk67ff-- From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 09:15:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE550106566B; Fri, 27 Jan 2012 09:15:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D8208FC19; Fri, 27 Jan 2012 09:15:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0R9Ft7C031276; Fri, 27 Jan 2012 09:15:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0R9FtmV031274; Fri, 27 Jan 2012 09:15:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201270915.q0R9FtmV031274@svn.freebsd.org> From: Alexander Motin Date: Fri, 27 Jan 2012 09:15:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230611 - head/usr.sbin/mixer X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 09:15:55 -0000 Author: mav Date: Fri Jan 27 09:15:55 2012 New Revision: 230611 URL: http://svn.freebsd.org/changeset/base/230611 Log: Return proper error message if recording device is not specified. MFC after: 1 week Modified: head/usr.sbin/mixer/mixer.c Modified: head/usr.sbin/mixer/mixer.c ============================================================================== --- head/usr.sbin/mixer/mixer.c Fri Jan 27 08:58:58 2012 (r230610) +++ head/usr.sbin/mixer/mixer.c Fri Jan 27 09:15:55 2012 (r230611) @@ -193,13 +193,18 @@ main(int argc, char *argv[]) argc--; argv++; continue; - } else if (argc > 1 && strcmp("rec", *argv + 1) == 0) { + } else if (strcmp("rec", *argv + 1) == 0) { if (**argv != '+' && **argv != '-' && **argv != '=' && **argv != '^') { warnx("unknown modifier: %c", **argv); dusage = 1; break; } + if (argc <= 1) { + warnx("no recording device specified"); + dusage = 1; + break; + } if ((dev = res_name(argv[1], recmask)) == -1) { warnx("unknown recording device: %s", argv[1]); dusage = 1; From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 09:18:44 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9E58106566C; Fri, 27 Jan 2012 09:18:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id 5A2BD8FC13; Fri, 27 Jan 2012 09:18:43 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0R9IJle030380 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jan 2012 20:18:42 +1100 Date: Fri, 27 Jan 2012 20:18:19 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Rick Macklem In-Reply-To: <1513888354.186214.1327592563003.JavaMail.root@erie.cs.uoguelph.ca> Message-ID: <20120127195645.G1604@besplex.bde.org> References: <1513888354.186214.1327592563003.JavaMail.root@erie.cs.uoguelph.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r230516 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 09:18:44 -0000 On Thu, 26 Jan 2012, Rick Macklem wrote: > Bruce Evans wrote: > >> Doesn't umount -f have to wait for i/o anyway? When it closes files, >> it must wait for all in-progress i/o for the files, and for all new >> i/o's that result from closing. >> > umount -f kills off RPCs in progress. There was an email discussion > about this, where it seemed there was no advantage in defining a > separate "hard forced dismount" for this case. But umount -f means to close the files, not to lose their contents. nfs umount should give a best effort not to lose any contents by waiting a bit. Maybe it already does. I saw some of the discussion. BTW, I just replied to the POSIX list about close() returning EINTR. POSIX has the silly specification that close() shall not discard any ouput for a terminal device file [although an endless wait may be required for that] but no similar detail for much more important types of files. unmount() is better behaved than close() here since it can and does actually handle cached data correctly by failing when there is an i/o error writing it. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 09:34:39 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90260106564A; Fri, 27 Jan 2012 09:34:39 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 247638FC13; Fri, 27 Jan 2012 09:34:38 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0R9Yalw018175 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jan 2012 20:34:36 +1100 Date: Fri, 27 Jan 2012 20:34:35 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov In-Reply-To: <20120126175021.GA93016@vniz.net> Message-ID: <20120127201855.K1604@besplex.bde.org> References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175021.GA93016@vniz.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@FreeBSD.org, John Baldwin , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, David Schultz , Mark Murray Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 09:34:39 -0000 On Thu, 26 Jan 2012, Andrey Chernov wrote: >> On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote: >>> Atomics don't operate on enums. You'll need to make it an int and just use >>> #define's for the 3 states. This restores some style bugs and keeps old ones. > --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 > +++ sys/libkern.h 2012-01-26 21:40:21.000000000 +0400 > @@ -72,6 +72,10 @@ static __inline quad_t qabs(quad_t a) { > > /* Prototypes for non-quad routines. */ > struct malloc_type; > +#define ARC4_ENTR_NONE 0 /* Don't have entropy yet. */ > +#define ARC4_ENTR_HAVE 1 /* Have entropy. */ > +#define ARC4_ENTR_SEED 2 /* Reseeding. */ > +extern volatile int arc4rand_iniseed_state; I see no prototypes here. > uint32_t arc4random(void); > void arc4rand(void *ptr, u_int len, int reseed); I see a prototype with style bugs here (names for parameters, which isn't bug for bug compatible with the other prototypes). > int bcmp(const void *, const void *, size_t); > --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.000000000 +0300 > +++ dev/random/randomdev_soft.c 2012-01-26 19:35:12.000000000 +0400 > @@ -366,6 +366,8 @@ random_yarrow_unblock(void) > selwakeuppri(&random_systat.rsel, PUSER); > wakeup(&random_systat); > } > + (void)atomic_cmpset_int(&arc4rand_iniseed_state, > + ARC4_ENTR_NONE, ARC4_ENTR_HAVE); > } This is gnu style. Continuation indentation is 4 spaces in KNF. > > static int > --- libkern/arc4random.c.old 2008-08-08 01:51:09.000000000 +0400 > +++ libkern/arc4random.c 2012-01-26 21:40:47.000000000 +0400 > @@ -24,6 +24,8 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 > #define ARC4_RESEED_SECONDS 300 > #define ARC4_KEYBYTES (256 / 8) > > +volatile int arc4rand_iniseed_state = ARC4_ENTR_NONE; > + I don't see what all the volatile qualifiers and atomic ops are for. The volatiles certainly have no effect, since this variable is only accessed by atomic ops which only access variables as volatile whether you want this or not. See das's reply for more about the atomic ops. Here I think they just close a window that would be open just once for each for a few instructions while booting. > static u_int8_t arc4_i, arc4_j; > static int arc4_numruns = 0; > static u_int8_t arc4_sbox[256]; > @@ -130,7 +132,9 @@ arc4rand(void *ptr, u_int len, int resee > struct timeval tv; > > getmicrouptime(&tv); > - if (reseed || > + if (atomic_cmpset_int(&arc4rand_iniseed_state, > + ARC4_ENTR_HAVE, ARC4_ENTR_SEED) || Gnu style indentation. Excessively early line splitting. > + reseed || > (arc4_numruns > ARC4_RESEED_BYTES) || > (tv.tv_sec > arc4_t_reseed)) Old code uses KNF style (except for excessive line splitting and excessive parentheses) in the same statement. > arc4_randomstir(); Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 09:45:45 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BD44106566B; Fri, 27 Jan 2012 09:45:45 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id EFE818FC08; Fri, 27 Jan 2012 09:45:44 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0R9jeLU014480 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jan 2012 20:45:41 +1100 Date: Fri, 27 Jan 2012 20:45:40 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Cox In-Reply-To: <4F21820B.8040000@rice.edu> Message-ID: <20120127203631.Q1604@besplex.bde.org> References: <201201260955.q0Q9tG1m075353@svn.freebsd.org> <4F21820B.8040000@rice.edu> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org Subject: Re: svn commit: r230572 - in head/sys/dev: ixgbe netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 09:45:45 -0000 On Thu, 26 Jan 2012, Alan Cox wrote: > On 01/26/2012 03:55, Luigi Rizzo wrote: >> Log: >> ... >> Netmap-related changes for ixgbe: >> ... >> +#define NKR_PENDINTR 0x1 // Pending interrupt. >> u_int nkr_num_slots; >> >> int nkr_hwofs; /* offset between NIC and netmap ring */ >> struct netmap_adapter *na; // debugging >> struct selinfo si; /* poll/select wait queue */ >> -}; >> +} __attribute__((__aligned__(64))); > > The machine-dependent param.h defines CACHE_LINE_SIZE for use in situations > like this. Also, the machine-independent cdefs.h defines __aligned() for use in situations like this. All cases that use CACHE_LINE_SIZE in an alignment statement spell the alignment statement correctly. The only hard-coded __attribute__() in a line matching CACHE_LINE_SIZE is for CVMX_CACHE_LINE_SIZE in contrib/octeon-sdk/cvmx-utils.h. Perhaps contrib'ed code needs to use hard-coded gccisms instead of hard-coded FreeBSDisms. Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 11:48:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40D7B106566B; Fri, 27 Jan 2012 11:48:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1FC768FC0C; Fri, 27 Jan 2012 11:48:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RBmj6O038186; Fri, 27 Jan 2012 11:48:45 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RBmjxV038184; Fri, 27 Jan 2012 11:48:45 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201201271148.q0RBmjxV038184@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 27 Jan 2012 11:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230612 - head/sbin/mdconfig X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 11:48:45 -0000 Author: trasz Date: Fri Jan 27 11:48:44 2012 New Revision: 230612 URL: http://svn.freebsd.org/changeset/base/230612 Log: Rewrite option parsing in mdconfig(8). This makes it more user-friendly by removing the ordering requirements and adding more descriptive error messages; it also makes it more readable and maintainable. Sponsored by: The FreeBSD Foundation Modified: head/sbin/mdconfig/mdconfig.c Modified: head/sbin/mdconfig/mdconfig.c ============================================================================== --- head/sbin/mdconfig/mdconfig.c Fri Jan 27 09:15:55 2012 (r230611) +++ head/sbin/mdconfig/mdconfig.c Fri Jan 27 11:48:44 2012 (r230612) @@ -1,7 +1,11 @@ /*- * Copyright (c) 2000-2004 Poul-Henning Kamp + * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * + * Portions of this software were developed by Edward Tomasz Napierala + * under sponsorship from the FreeBSD Foundation. + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -49,7 +53,6 @@ #include #include - static struct md_ioctl mdio; static enum {UNSET, ATTACH, DETACH, LIST} action = UNSET; static int nflag; @@ -72,6 +75,7 @@ static void md_prthumanval(char *length) static void usage(void) { + fprintf(stderr, "usage: mdconfig -a -t type [-n] [-o [no]option] ... [-f file]\n" " [-s size] [-S sectorsize] [-u unit]\n" @@ -92,8 +96,7 @@ main(int argc, char **argv) { int ch, fd, i, vflag; char *p; - int cmdline = 0; - char *mdunit = NULL; + char *fflag = NULL, *tflag = NULL, *uflag = NULL; bzero(&mdio, sizeof(mdio)); mdio.md_file = malloc(PATH_MAX); @@ -101,79 +104,59 @@ main(int argc, char **argv) err(1, "could not allocate memory"); vflag = 0; bzero(mdio.md_file, PATH_MAX); + + if (argc == 1) + usage(); + while ((ch = getopt(argc, argv, "ab:df:lno:s:S:t:u:vx:y:")) != -1) { switch (ch) { case 'a': - if (cmdline != 0) - usage(); + if (action != UNSET && action != ATTACH) + errx(1, + "-a is mutually exclusive with -d and -l"); action = ATTACH; - cmdline = 1; break; case 'd': - if (cmdline != 0) - usage(); + if (action != UNSET && action != DETACH) + errx(1, + "-d is mutually exclusive with -a and -l"); action = DETACH; - mdio.md_options = MD_AUTOUNIT; - cmdline = 3; + mdio.md_options |= MD_AUTOUNIT; break; case 'l': - if (cmdline != 0) - usage(); + if (action != UNSET && action != LIST) + errx(1, + "-l is mutually exclusive with -a and -d"); action = LIST; - mdio.md_options = MD_AUTOUNIT; - cmdline = 3; + mdio.md_options |= MD_AUTOUNIT; break; case 'n': nflag = 1; break; case 't': - if (cmdline != 1) - usage(); + if (tflag != NULL) + errx(1, "-t can be passed only once"); + tflag = optarg; if (!strcmp(optarg, "malloc")) { mdio.md_type = MD_MALLOC; - mdio.md_options = MD_AUTOUNIT | MD_COMPRESS; + mdio.md_options |= MD_AUTOUNIT | MD_COMPRESS; } else if (!strcmp(optarg, "preload")) { mdio.md_type = MD_PRELOAD; - mdio.md_options = 0; } else if (!strcmp(optarg, "vnode")) { mdio.md_type = MD_VNODE; - mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; + mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; } else if (!strcmp(optarg, "swap")) { mdio.md_type = MD_SWAP; - mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; - } else { - usage(); - } - cmdline=2; + mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; + } else + errx(1, "unknown type: %s", optarg); break; case 'f': - if (cmdline == 0) { - action = ATTACH; - cmdline = 1; - } - if (cmdline == 1) { - /* Imply ``-t vnode'' */ - mdio.md_type = MD_VNODE; - mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; - cmdline = 2; - } - if (cmdline != 2) - usage(); - md_set_file(optarg); + if (fflag != NULL) + errx(1, "-f can be passed only once"); + fflag = optarg; break; case 'o': - if (action == DETACH) { - if (!strcmp(optarg, "force")) - mdio.md_options |= MD_FORCE; - else if (!strcmp(optarg, "noforce")) - mdio.md_options &= ~MD_FORCE; - else - errx(1, "Unknown option: %s.", optarg); - break; - } - - if (cmdline != 2) - usage(); if (!strcmp(optarg, "async")) mdio.md_options |= MD_ASYNC; else if (!strcmp(optarg, "noasync")) @@ -199,27 +182,12 @@ main(int argc, char **argv) else if (!strcmp(optarg, "noreserve")) mdio.md_options &= ~MD_RESERVE; else - errx(1, "Unknown option: %s.", optarg); + errx(1, "unknown option: %s", optarg); break; case 'S': - if (cmdline != 2) - usage(); mdio.md_sectorsize = strtoul(optarg, &p, 0); break; case 's': - if (cmdline == 0) { - /* Imply ``-a'' */ - action = ATTACH; - cmdline = 1; - } - if (cmdline == 1) { - /* Imply ``-t swap'' */ - mdio.md_type = MD_SWAP; - mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; - cmdline = 2; - } - if (cmdline != 2) - usage(); mdio.md_mediasize = (off_t)strtoumax(optarg, &p, 0); if (p == NULL || *p == '\0') mdio.md_mediasize *= DEV_BSIZE; @@ -235,34 +203,22 @@ main(int argc, char **argv) mdio.md_mediasize <<= 30; mdio.md_mediasize <<= 10; } else - errx(1, "Unknown suffix on -s argument"); + errx(1, "unknown suffix on -s argument"); break; case 'u': - if (cmdline != 2 && cmdline != 3) - usage(); if (!strncmp(optarg, "/dev/", 5)) optarg += 5; if (!strncmp(optarg, MD_NAME, sizeof(MD_NAME) - 1)) optarg += sizeof(MD_NAME) - 1; - mdio.md_unit = strtoul(optarg, &p, 0); - if (mdio.md_unit == (unsigned)ULONG_MAX || *p != '\0') - errx(1, "bad unit: %s", optarg); - mdunit = optarg; - mdio.md_options &= ~MD_AUTOUNIT; + uflag = optarg; break; case 'v': - if (cmdline != 3) - usage(); vflag = OPT_VERBOSE; break; case 'x': - if (cmdline != 2) - usage(); mdio.md_fwsectors = strtoul(optarg, &p, 0); break; case 'y': - if (cmdline != 2) - usage(); mdio.md_fwheads = strtoul(optarg, &p, 0); break; default: @@ -272,14 +228,88 @@ main(int argc, char **argv) argc -= optind; argv += optind; - if (action == UNSET) { - if (argc != 1) - usage(); + + if (action == UNSET) action = ATTACH; - mdio.md_type = MD_VNODE; - mdio.md_options = MD_CLUSTER | MD_AUTOUNIT | MD_COMPRESS; - cmdline = 2; - md_set_file(*argv); + + if (action == ATTACH) { + if (tflag == NULL) { + /* + * Try to infer the type based on other arguments. + */ + if (fflag != NULL || argc > 0) { + /* Imply ``-t vnode'' */ + mdio.md_type = MD_VNODE; + mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | + MD_COMPRESS; + } else if (mdio.md_mediasize != 0) { + /* Imply ``-t swap'' */ + mdio.md_type = MD_SWAP; + mdio.md_options |= MD_CLUSTER | MD_AUTOUNIT | + MD_COMPRESS; + } else + errx(1, "unable to determine type"); + } + + if ((fflag != NULL || argc > 0) && mdio.md_type != MD_VNODE) + errx(1, "only -t vnode can be used with file name"); + + if (mdio.md_type == MD_VNODE) { + if (fflag != NULL) { + if (argc != 0) + usage(); + md_set_file(fflag); + } else { + if (argc != 1) + usage(); + md_set_file(*argv); + } + + if ((mdio.md_options & MD_READONLY) == 0 && + access(mdio.md_file, W_OK) < 0 && + (errno == EACCES || errno == EPERM || + errno == EROFS)) { + warnx("WARNING: opening backing store: %s " + "readonly", mdio.md_file); + mdio.md_options |= MD_READONLY; + } + } + + if ((mdio.md_type == MD_MALLOC || mdio.md_type == MD_SWAP) && + mdio.md_mediasize == 0) + errx(1, "must specify -s for -t malloc or -t swap"); + if (mdio.md_type == MD_VNODE && mdio.md_file[0] == '\0') + errx(1, "must specify -f for -t vnode"); + } else { + if (mdio.md_sectorsize != 0) + errx(1, "-S can only be used with -a"); + if (mdio.md_mediasize != 0) + errx(1, "-s can only be used with -a"); + if (mdio.md_fwsectors != 0) + errx(1, "-x can only be used with -a"); + if (mdio.md_fwheads != 0) + errx(1, "-y can only be used with -a"); + if (fflag != NULL) + errx(1, "-f can only be used with -a"); + if (tflag != NULL) + errx(1, "-t can only be used with -a"); + if (argc > 0) + errx(1, "file can only be used with -a"); + if (action != DETACH && (mdio.md_options & ~MD_AUTOUNIT) != 0) + errx(1, "-o can only be used with -a and -d"); + if (action == DETACH && + (mdio.md_options & ~(MD_FORCE | MD_AUTOUNIT)) != 0) + errx(1, "only -o [no]force can be used with -d"); + } + + if (action != LIST && vflag == OPT_VERBOSE) + errx(1, "-v can only be used with -l"); + + if (uflag != NULL) { + mdio.md_unit = strtoul(uflag, &p, 0); + if (mdio.md_unit == (unsigned)ULONG_MAX || *p != '\0') + errx(1, "bad unit: %s", uflag); + mdio.md_options &= ~MD_AUTOUNIT; } mdio.md_version = MDIOVERSION; @@ -290,36 +320,8 @@ main(int argc, char **argv) fd = open("/dev/" MDCTL_NAME, O_RDWR, 0); if (fd < 0) err(1, "open(/dev/%s)", MDCTL_NAME); - if (cmdline == 2 - && (mdio.md_type == MD_MALLOC || mdio.md_type == MD_SWAP)) - if (mdio.md_mediasize == 0) - errx(1, "must specify -s for -t malloc or -t swap"); - if (cmdline == 2 && mdio.md_type == MD_VNODE) - if (mdio.md_file[0] == '\0') - errx(1, "must specify -f for -t vnode"); - if (mdio.md_type == MD_VNODE && - (mdio.md_options & MD_READONLY) == 0) { - if (access(mdio.md_file, W_OK) < 0 && - (errno == EACCES || errno == EPERM || errno == EROFS)) { - fprintf(stderr, - "WARNING: opening backing store: %s readonly\n", - mdio.md_file); - mdio.md_options |= MD_READONLY; - } - } - if (action == LIST) { - if (mdio.md_options & MD_AUTOUNIT) { - /* - * Listing all devices. This is why we pass NULL - * together with OPT_LIST. - */ - md_list(NULL, OPT_LIST | vflag); - } else { - return (md_query(mdunit)); - } - } else if (action == ATTACH) { - if (cmdline < 2) - usage(); + + if (action == ATTACH) { i = ioctl(fd, MDIOCATTACH, &mdio); if (i < 0) err(1, "ioctl(/dev/%s)", MDCTL_NAME); @@ -327,13 +329,23 @@ main(int argc, char **argv) printf("%s%d\n", nflag ? "" : MD_NAME, mdio.md_unit); } else if (action == DETACH) { if (mdio.md_options & MD_AUTOUNIT) - usage(); + errx(1, "-d requires -u"); i = ioctl(fd, MDIOCDETACH, &mdio); if (i < 0) err(1, "ioctl(/dev/%s)", MDCTL_NAME); + } else if (action == LIST) { + if (mdio.md_options & MD_AUTOUNIT) { + /* + * Listing all devices. This is why we pass NULL + * together with OPT_LIST. + */ + md_list(NULL, OPT_LIST | vflag); + } else + return (md_query(uflag)); + } else usage(); - close (fd); + close(fd); return (0); } @@ -507,5 +519,6 @@ md_prthumanval(char *length) int md_query(char *name) { + return (md_list(name, OPT_UNIT)); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 12:56:37 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3656C1065670; Fri, 27 Jan 2012 12:56:37 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id E5FC28FC17; Fri, 27 Jan 2012 12:56:36 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id 0D8C57300A; Fri, 27 Jan 2012 13:58:44 +0100 (CET) Date: Fri, 27 Jan 2012 13:58:44 +0100 From: Luigi Rizzo To: Bruce Evans Message-ID: <20120127125844.GA11690@onelab2.iet.unipi.it> References: <201201260955.q0Q9tG1m075353@svn.freebsd.org> <4F21820B.8040000@rice.edu> <20120127203631.Q1604@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120127203631.Q1604@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, Luigi Rizzo , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, Alan Cox Subject: Re: svn commit: r230572 - in head/sys/dev: ixgbe netmap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 12:56:37 -0000 On Fri, Jan 27, 2012 at 08:45:40PM +1100, Bruce Evans wrote: > On Thu, 26 Jan 2012, Alan Cox wrote: > > >On 01/26/2012 03:55, Luigi Rizzo wrote: > > >>Log: > >>... > >> Netmap-related changes for ixgbe: > >>... > >>+#define NKR_PENDINTR 0x1 // Pending interrupt. > >> u_int nkr_num_slots; > >> > >> int nkr_hwofs; /* offset between NIC and netmap ring */ > >> struct netmap_adapter *na; // debugging > >> struct selinfo si; /* poll/select wait queue */ > >>-}; > >>+} __attribute__((__aligned__(64))); > > > >The machine-dependent param.h defines CACHE_LINE_SIZE for use in > >situations like this. > > Also, the machine-independent cdefs.h defines __aligned() for use > in situations like this. All cases that use CACHE_LINE_SIZE in an > alignment statement spell the alignment statement correctly. The > only hard-coded __attribute__() in a line matching CACHE_LINE_SIZE > is for CVMX_CACHE_LINE_SIZE in contrib/octeon-sdk/cvmx-utils.h. > Perhaps contrib'ed code needs to use hard-coded gccisms instead of > hard-coded FreeBSDisms. thanks for the comments, I'll adjust this in some subsequent commit. cheers luigi From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 13:26:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C9B41065672; Fri, 27 Jan 2012 13:26:20 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 25C8E8FC08; Fri, 27 Jan 2012 13:26:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RDQKuD041293; Fri, 27 Jan 2012 13:26:20 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RDQKWW041291; Fri, 27 Jan 2012 13:26:20 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201201271326.q0RDQKWW041291@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 27 Jan 2012 13:26:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230613 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 13:26:20 -0000 Author: pluknet Date: Fri Jan 27 13:26:19 2012 New Revision: 230613 URL: http://svn.freebsd.org/changeset/base/230613 Log: Remove a left-over reference to make.conf(5) which was used as a place to store the VM_STACK compile option to enable MAP_STACK support in its earliest stage of development. Found by: mux Modified: head/lib/libc/sys/mmap.2 Modified: head/lib/libc/sys/mmap.2 ============================================================================== --- head/lib/libc/sys/mmap.2 Fri Jan 27 11:48:44 2012 (r230612) +++ head/lib/libc/sys/mmap.2 Fri Jan 27 13:26:19 2012 (r230613) @@ -356,8 +356,7 @@ was specified and insufficient memory wa .Xr msync 2 , .Xr munlock 2 , .Xr munmap 2 , -.Xr getpagesize 3 , -.Xr make.conf 5 +.Xr getpagesize 3 .Sh BUGS The .Fa len From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 13:26:27 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C9ED1065704; Fri, 27 Jan 2012 13:26:25 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C1198FC12; Fri, 27 Jan 2012 13:26:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RDQPeG041332; Fri, 27 Jan 2012 13:26:25 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RDQPwm041330; Fri, 27 Jan 2012 13:26:25 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201201271326.q0RDQPwm041330@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 27 Jan 2012 13:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230614 - head/sys/netinet/ipfw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 13:26:27 -0000 Author: luigi Date: Fri Jan 27 13:26:25 2012 New Revision: 230614 URL: http://svn.freebsd.org/changeset/base/230614 Log: a variable was erroneously declared as 32 bit instead of 64. MFC after: 3 days Modified: head/sys/netinet/ipfw/dn_sched_qfq.c Modified: head/sys/netinet/ipfw/dn_sched_qfq.c ============================================================================== --- head/sys/netinet/ipfw/dn_sched_qfq.c Fri Jan 27 13:26:19 2012 (r230613) +++ head/sys/netinet/ipfw/dn_sched_qfq.c Fri Jan 27 13:26:25 2012 (r230614) @@ -608,7 +608,7 @@ static inline void qfq_update_start(struct qfq_sched *q, struct qfq_class *cl) { unsigned long mask; - uint32_t limit, roundedF; + uint64_t limit, roundedF; int slot_shift = cl->grp->slot_shift; roundedF = qfq_round_down(cl->F, slot_shift); From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 16:33:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3A49106564A; Fri, 27 Jan 2012 16:33:41 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from esa-annu.mail.uoguelph.ca (esa-annu.mail.uoguelph.ca [131.104.91.36]) by mx1.freebsd.org (Postfix) with ESMTP id 1AB898FC16; Fri, 27 Jan 2012 16:33:40 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ap4EAOrQIk+DaFvO/2dsb2JhbABDhQuqS4FyAQEEASMEUgUWDgoCAg0ZAlkGiA+mVZFZgS+HYQEFAxwEAQsBCAEGBAMDBBAVgmYFAwMBAgcDFQEFCwcCAYEbCYIegRYEiD+MW5Jr X-IronPort-AV: E=Sophos;i="4.71,580,1320642000"; d="scan'208";a="153999910" Received: from erie.cs.uoguelph.ca (HELO zcs3.mail.uoguelph.ca) ([131.104.91.206]) by esa-annu-pri.mail.uoguelph.ca with ESMTP; 27 Jan 2012 11:33:39 -0500 Received: from zcs3.mail.uoguelph.ca (localhost.localdomain [127.0.0.1]) by zcs3.mail.uoguelph.ca (Postfix) with ESMTP id E92E0B40D2; Fri, 27 Jan 2012 11:33:39 -0500 (EST) Date: Fri, 27 Jan 2012 11:33:39 -0500 (EST) From: Rick Macklem To: Bruce Evans Message-ID: <1072010695.266929.1327682019937.JavaMail.root@erie.cs.uoguelph.ca> In-Reply-To: <20120127195645.G1604@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [172.17.91.201] X-Mailer: Zimbra 6.0.10_GA_2692 (ZimbraWebClient - FF3.0 (Win)/6.0.10_GA_2692) Cc: svn-src-head@FreeBSD.org, Rick Macklem , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230516 - in head/sys: fs/nfsclient nfsclient X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 16:33:41 -0000 Bruce Evans wrote: > On Thu, 26 Jan 2012, Rick Macklem wrote: > > > Bruce Evans wrote: > > > >> Doesn't umount -f have to wait for i/o anyway? When it closes > >> files, > >> it must wait for all in-progress i/o for the files, and for all new > >> i/o's that result from closing. > >> > > umount -f kills off RPCs in progress. There was an email discussion > > about this, where it seemed there was no advantage in defining a > > separate "hard forced dismount" for this case. > > But umount -f means to close the files, not to lose their contents. > nfs umount should give a best effort not to lose any contents by > waiting > a bit. Maybe it already does. I saw some of the discussion. > Well, maybe in theory, but in practice, I don't think it makes much difference. I can think of 2 scenarios where a sysadmin might use "umount -f" on an NFS mount point: 1 - The NFS server is unresponsive (crashed or network partitioned) and the sysadmin can't wait until it comes back online. --> waiting a fraction of a second won't have any effect on the outcome unless the server comes back online within that fraction of a second. Since the sysadmin isn't willing to wait... 2 - The sysadmin needs to unmount the file system now, but some program has file(s) open on the mount point, so a normal unmount fails with EBUSY. --> Any programs with file(s) open for writing on the mount, will have those opens arbitrarily closed and subsequent write attempts will fail. As such, the programs won't be able to get the data written. (Yes, you could argue that the program was just finishing doing any writing it wanted to do and waiting a fraction of a second would allow it to complete, but that's basically the same argument as for #1.) No different than the sysadmin waiting a fraction of a second longer before they type "umount -f /mnt" from what I see. rick > BTW, I just replied to the POSIX list about close() returning EINTR. > POSIX has the silly specification that close() shall not discard any > ouput for a terminal device file [although an endless wait may be > required for that] but no similar detail for much more important types > of files. unmount() is better behaved than close() here since it can > and does actually handle cached data correctly by failing when there > is an i/o error writing it. > > Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 17:16:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 753F11065680; Fri, 27 Jan 2012 17:16:45 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45C308FC24; Fri, 27 Jan 2012 17:16:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RHGjCr048702; Fri, 27 Jan 2012 17:16:45 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RHGjFt048700; Fri, 27 Jan 2012 17:16:45 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201201271716.q0RHGjFt048700@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 27 Jan 2012 17:16:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230617 - head/usr.sbin/ifmcstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 17:16:45 -0000 Author: maxim Date: Fri Jan 27 17:16:44 2012 New Revision: 230617 URL: http://svn.freebsd.org/changeset/base/230617 Log: o in6_ifinfo() does not do any kvm(3) operations, so do not guard it by WITH_KVM ifdef. This allows to build ifmcstat(8) without kvm(3) support. PR: bin/164353 Submitted by: Ivan Rozhuk MFC after: 2 weeks Modified: head/usr.sbin/ifmcstat/ifmcstat.c Modified: head/usr.sbin/ifmcstat/ifmcstat.c ============================================================================== --- head/usr.sbin/ifmcstat/ifmcstat.c Fri Jan 27 14:50:15 2012 (r230616) +++ head/usr.sbin/ifmcstat/ifmcstat.c Fri Jan 27 17:16:44 2012 (r230617) @@ -441,32 +441,6 @@ ll_addrlist(struct ifaddr *ifap) #ifdef INET6 static void -in6_ifinfo(struct mld_ifinfo *mli) -{ - - printf("\t"); - switch (mli->mli_version) { - case MLD_VERSION_1: - case MLD_VERSION_2: - printf("mldv%d", mli->mli_version); - break; - default: - printf("mldv?(%d)", mli->mli_version); - break; - } - printb(" flags", mli->mli_flags, "\020\1SILENT"); - if (mli->mli_version == MLD_VERSION_2) { - printf(" rv %u qi %u qri %u uri %u", - mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri); - } - if (vflag >= 2) { - printf(" v1timer %u v2timer %u", mli->mli_v1_timer, - mli->mli_v2_timer); - } - printf("\n"); -} - -static void if6_addrlist(struct ifaddr *ifap) { struct ifnet ifnet; @@ -763,6 +737,33 @@ in_multientry(struct in_multi *pinm) #endif /* WITH_KVM */ #ifdef INET6 + +static void +in6_ifinfo(struct mld_ifinfo *mli) +{ + + printf("\t"); + switch (mli->mli_version) { + case MLD_VERSION_1: + case MLD_VERSION_2: + printf("mldv%d", mli->mli_version); + break; + default: + printf("mldv?(%d)", mli->mli_version); + break; + } + printb(" flags", mli->mli_flags, "\020\1SILENT"); + if (mli->mli_version == MLD_VERSION_2) { + printf(" rv %u qi %u qri %u uri %u", + mli->mli_rv, mli->mli_qi, mli->mli_qri, mli->mli_uri); + } + if (vflag >= 2) { + printf(" v1timer %u v2timer %u", mli->mli_v1_timer, + mli->mli_v2_timer); + } + printf("\n"); +} + static const char * inet6_n2a(struct in6_addr *p) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 17:29:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E41FA106564A; Fri, 27 Jan 2012 17:29:59 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE56B8FC08; Fri, 27 Jan 2012 17:29:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RHTx5u049496; Fri, 27 Jan 2012 17:29:59 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RHTxVV049494; Fri, 27 Jan 2012 17:29:59 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201201271729.q0RHTxVV049494@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 27 Jan 2012 17:29:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230618 - stable/9/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 17:30:00 -0000 Author: bschmidt Date: Fri Jan 27 17:29:59 2012 New Revision: 230618 URL: http://svn.freebsd.org/changeset/base/230618 Log: MFC r229375: Don't rely on MCS7 being at index 7 while determining the amount of antennas to use. Not all APs enable all MCS rates. Modified: stable/9/sys/dev/iwn/if_iwn.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/9/sys/dev/iwn/if_iwn.c Fri Jan 27 17:16:44 2012 (r230617) +++ stable/9/sys/dev/iwn/if_iwn.c Fri Jan 27 17:29:59 2012 (r230618) @@ -2128,7 +2128,7 @@ iwn_newassoc(struct ieee80211_node *ni, plcp |= IWN_RFLAG_SGI; } else if (ni->ni_htcap & IEEE80211_HTCAP_SHORTGI20) plcp |= IWN_RFLAG_SGI; - if (i > 7) + if (RV(ni->ni_htrates.rs_rates[i]) > 7) plcp |= IWN_RFLAG_ANT(txant1 | txant2); else plcp |= IWN_RFLAG_ANT(txant1); From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 17:32:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B924C106564A; Fri, 27 Jan 2012 17:32:50 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2C2D8FC08; Fri, 27 Jan 2012 17:32:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RHWoMC049641; Fri, 27 Jan 2012 17:32:50 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RHWoGG049639; Fri, 27 Jan 2012 17:32:50 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201201271732.q0RHWoGG049639@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 27 Jan 2012 17:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230619 - stable/9/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 17:32:50 -0000 Author: bschmidt Date: Fri Jan 27 17:32:50 2012 New Revision: 230619 URL: http://svn.freebsd.org/changeset/base/230619 Log: MFC r229284: MCS32 equals 32, not 8*ic_txstream. Modified: stable/9/sys/net80211/ieee80211_ht.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/net80211/ieee80211_ht.c ============================================================================== --- stable/9/sys/net80211/ieee80211_ht.c Fri Jan 27 17:29:59 2012 (r230618) +++ stable/9/sys/net80211/ieee80211_ht.c Fri Jan 27 17:32:50 2012 (r230619) @@ -432,7 +432,7 @@ ieee80211_get_suphtrates(struct ieee8021 ADDRATE(i); if ((ic->ic_htcaps & IEEE80211_HTCAP_CHWIDTH40) && (ic->ic_htcaps & IEEE80211_HTC_TXMCS32)) - ADDRATE(i); + ADDRATE(32); if (ic->ic_htcaps & IEEE80211_HTC_TXUNEQUAL) { if (ic->ic_txstream >= 2) { for (i = 33; i <= 38; i++) From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 17:39:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5687B106566C; Fri, 27 Jan 2012 17:39:03 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41EA18FC15; Fri, 27 Jan 2012 17:39:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RHd3g8049873; Fri, 27 Jan 2012 17:39:03 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RHd3Qb049871; Fri, 27 Jan 2012 17:39:03 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201201271739.q0RHd3Qb049871@svn.freebsd.org> From: Bernhard Schmidt Date: Fri, 27 Jan 2012 17:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230620 - head/sys/dev/iwn X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 17:39:03 -0000 Author: bschmidt Date: Fri Jan 27 17:39:02 2012 New Revision: 230620 URL: http://svn.freebsd.org/changeset/base/230620 Log: On state changes from RUN to anything else the AGGR sessions are cleared/dropped leading to qid2tap[n] being NULL as there no longer is a tap. Now, if there have been lots of frames queued the firmware processes and returns those after the tap is gone. Tested by: osa MFC after: 1 week Modified: head/sys/dev/iwn/if_iwn.c Modified: head/sys/dev/iwn/if_iwn.c ============================================================================== --- head/sys/dev/iwn/if_iwn.c Fri Jan 27 17:32:50 2012 (r230619) +++ head/sys/dev/iwn/if_iwn.c Fri Jan 27 17:39:02 2012 (r230620) @@ -2813,11 +2813,13 @@ iwn_ampdu_tx_done(struct iwn_softc *sc, bitmap |= 1ULL << bit; } tap = sc->qid2tap[qid]; - tid = WME_AC_TO_TID(tap->txa_ac); - wn = (void *)tap->txa_ni; - wn->agg[tid].bitmap = bitmap; - wn->agg[tid].startidx = start; - wn->agg[tid].nframes = nframes; + if (tap != NULL) { + tid = WME_AC_TO_TID(tap->txa_ac); + wn = (void *)tap->txa_ni; + wn->agg[tid].bitmap = bitmap; + wn->agg[tid].startidx = start; + wn->agg[tid].nframes = nframes; + } seqno = le32toh(*(status + nframes)) & 0xfff; for (lastidx = (seqno & 0xff); ring->read != lastidx;) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 18:21:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFB541065673; Fri, 27 Jan 2012 18:21:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8B5A8FC0A; Fri, 27 Jan 2012 18:21:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RILe31051280; Fri, 27 Jan 2012 18:21:40 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RILe7G051277; Fri, 27 Jan 2012 18:21:40 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201201271821.q0RILe7G051277@svn.freebsd.org> From: Ed Maste Date: Fri, 27 Jan 2012 18:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230621 - in stable/6: contrib/telnet/libtelnet crypto/heimdal/appl/telnet/libtelnet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 18:21:40 -0000 Author: emaste Date: Fri Jan 27 18:21:40 2012 New Revision: 230621 URL: http://svn.freebsd.org/changeset/base/230621 Log: MFC r228843: Fix a buffer overflow in telnetd. [11:08] Modified: stable/6/contrib/telnet/libtelnet/encrypt.c stable/6/crypto/heimdal/appl/telnet/libtelnet/encrypt.c Directory Properties: stable/6/contrib/telnet/ (props changed) stable/6/crypto/heimdal/ (props changed) Modified: stable/6/contrib/telnet/libtelnet/encrypt.c ============================================================================== --- stable/6/contrib/telnet/libtelnet/encrypt.c Fri Jan 27 17:39:02 2012 (r230620) +++ stable/6/contrib/telnet/libtelnet/encrypt.c Fri Jan 27 18:21:40 2012 (r230621) @@ -721,6 +721,9 @@ encrypt_keyid(struct key_info *kp, unsig int dir = kp->dir; int ret = 0; + if (len > MAXKEYLEN) + len = MAXKEYLEN; + if (!(ep = (*kp->getcrypt)(*kp->modep))) { if (len == 0) return; Modified: stable/6/crypto/heimdal/appl/telnet/libtelnet/encrypt.c ============================================================================== --- stable/6/crypto/heimdal/appl/telnet/libtelnet/encrypt.c Fri Jan 27 17:39:02 2012 (r230620) +++ stable/6/crypto/heimdal/appl/telnet/libtelnet/encrypt.c Fri Jan 27 18:21:40 2012 (r230621) @@ -736,6 +736,9 @@ encrypt_keyid(struct key_info *kp, unsig int dir = kp->dir; int ret = 0; + if (len > MAXKEYLEN) + len = MAXKEYLEN; + if (!(ep = (*kp->getcrypt)(*kp->modep))) { if (len == 0) return; From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 18:29:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F5E8106564A; Fri, 27 Jan 2012 18:29:04 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3974C8FC0A; Fri, 27 Jan 2012 18:29:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RIT4EW051547; Fri, 27 Jan 2012 18:29:04 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RIT4Xq051545; Fri, 27 Jan 2012 18:29:04 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201201271829.q0RIT4Xq051545@svn.freebsd.org> From: Dimitry Andric Date: Fri, 27 Jan 2012 18:29:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230622 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 18:29:04 -0000 Author: dim Date: Fri Jan 27 18:29:03 2012 New Revision: 230622 URL: http://svn.freebsd.org/changeset/base/230622 Log: When the buildkernel stage 2.3 (build tools) runs, the PATH is still set to the default from the top-level Makefile. Therefore, invocations of lex and yacc (used during building of aicasm) will use the executables in /usr/bin, not those optionally built during the previous buildworld or kernel-toolchain. This makes kernel builds from older FreeBSD releases more difficult than necessary. Fix this by setting PATH to ${BPATH}:${PATH} in stage 2.3, so the bootstrap tools directories are searched before the regular ones. Silence from: svn-src-{all,head} MFC after: 1 week Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 27 18:21:40 2012 (r230621) +++ head/Makefile.inc1 Fri Jan 27 18:29:03 2012 (r230622) @@ -832,6 +832,7 @@ buildkernel: @echo ">>> stage 2.3: build tools" @echo "--------------------------------------------------------------" cd ${KRNLOBJDIR}/${_kernel}; \ + PATH=${BPATH}:${PATH} \ MAKESRCPATH=${KERNSRCDIR}/dev/aic7xxx/aicasm \ ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF \ -f ${KERNSRCDIR}/dev/aic7xxx/aicasm/Makefile @@ -839,6 +840,7 @@ buildkernel: .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists(${KERNSRCDIR}/modules) .for target in obj depend all cd ${KERNSRCDIR}/modules/aic7xxx/aicasm; \ + PATH=${BPATH}:${PATH} \ MAKEOBJDIRPREFIX=${KRNLOBJDIR}/${_kernel}/modules \ ${MAKE} SSP_CFLAGS= -DNO_CPU_CFLAGS -DNO_CTF ${target} .endfor From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 19:42:23 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0343D106566B; Fri, 27 Jan 2012 19:42:23 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id AA0F48FC13; Fri, 27 Jan 2012 19:42:22 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0RJgLwA025802; Fri, 27 Jan 2012 14:42:21 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0RJgL2E025801; Fri, 27 Jan 2012 14:42:21 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Fri, 27 Jan 2012 14:42:21 -0500 From: David Schultz To: Kostik Belousov Message-ID: <20120127194221.GA25723@zim.MIT.EDU> Mail-Followup-To: Kostik Belousov , Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, Gleb Smirnoff , src-committers@FreeBSD.ORG, Bruce Evans Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 19:42:23 -0000 On Fri, Jan 27, 2012, Kostik Belousov wrote: > On Fri, Jan 27, 2012 at 07:50:30PM +1100, Bruce Evans wrote: > > On Thu, 26 Jan 2012, Gleb Smirnoff wrote: > > > > >On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: > > >B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio > > >B> > return (error); > > >B> > } > > >B> > > > >B> > + /* XXX: aio_nbytes is later casted to signed types. */ > > >B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { > > >B> > > >B> This should avoid implementation-defined behaviour by checking if > > >B> > > >B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. > > > > >Is the attached patch okay? > > > > Yes. It now matches the style used for read^Wsys_read() and friends. > > This used to have to fit the count in "int uio_resid". uio_resid now > > has type ssize_t, but for some reason the old INT_MAX limits remain. > > Well, I can revive the patch. I still think it is good to get rid of > the limit. The correct limit on the maximum size of a single read/write is SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the limit yet, though, because of bugs in several filesystems. For example, FFS copies uio_resid into a local variable of type int. I have some old patches that fix some of these issues for FFS and cd9660, but surely there are more places I didn't notice. By the way, PR 147226 is about this. From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 20:18:33 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 357D71065673; Fri, 27 Jan 2012 20:18:33 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1DC328FC1D; Fri, 27 Jan 2012 20:18:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RKIWa2055082; Fri, 27 Jan 2012 20:18:32 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RKIWUD055070; Fri, 27 Jan 2012 20:18:32 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201201272018.q0RKIWUD055070@svn.freebsd.org> From: Kip Macy Date: Fri, 27 Jan 2012 20:18:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230623 - in head/sys: amd64/amd64 cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 20:18:33 -0000 Author: kmacy Date: Fri Jan 27 20:18:31 2012 New Revision: 230623 URL: http://svn.freebsd.org/changeset/base/230623 Log: exclude kmem_alloc'ed ARC data buffers from kernel minidumps on amd64 excluding other allocations including UMA now entails the addition of a single flag to kmem_alloc or uma zone create Reviewed by: alc, avg MFC after: 2 weeks Modified: head/sys/amd64/amd64/minidump_machdep.c head/sys/amd64/amd64/uma_machdep.c head/sys/cddl/compat/opensolaris/sys/kmem.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c head/sys/sys/malloc.h head/sys/vm/uma.h head/sys/vm/uma_core.c head/sys/vm/vm_contig.c head/sys/vm/vm_kern.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/amd64/amd64/minidump_machdep.c ============================================================================== --- head/sys/amd64/amd64/minidump_machdep.c Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/amd64/amd64/minidump_machdep.c Fri Jan 27 20:18:31 2012 (r230623) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #include #include #include @@ -75,8 +76,11 @@ CTASSERT(sizeof(*vm_page_dump) == 8); static int is_dumpable(vm_paddr_t pa) { + vm_page_t m; int i; + if ((m = vm_phys_paddr_to_vm_page(pa)) != NULL) + return ((m->flags & PG_NODUMP) == 0); for (i = 0; dump_avail[i] != 0 || dump_avail[i + 1] != 0; i += 2) { if (pa >= dump_avail[i] && pa < dump_avail[i + 1]) return (1); Modified: head/sys/amd64/amd64/uma_machdep.c ============================================================================== --- head/sys/amd64/amd64/uma_machdep.c Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/amd64/amd64/uma_machdep.c Fri Jan 27 20:18:31 2012 (r230623) @@ -65,7 +65,8 @@ uma_small_alloc(uma_zone_t zone, int byt break; } pa = m->phys_addr; - dump_add_page(pa); + if ((wait & M_NODUMP) == 0) + dump_add_page(pa); va = (void *)PHYS_TO_DMAP(pa); if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) pagezero(va); Modified: head/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/kmem.h Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/cddl/compat/opensolaris/sys/kmem.h Fri Jan 27 20:18:31 2012 (r230623) @@ -45,7 +45,9 @@ MALLOC_DECLARE(M_SOLARIS); #define KM_SLEEP M_WAITOK #define KM_PUSHPAGE M_WAITOK #define KM_NOSLEEP M_NOWAIT -#define KMC_NODEBUG 0 +#define KM_ZERO M_ZERO +#define KM_NODEBUG M_NODUMP +#define KMC_NODEBUG UMA_ZONE_NODUMP #define KMC_NOTOUCH 0 typedef struct kmem_cache { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Fri Jan 27 20:18:31 2012 (r230623) @@ -242,7 +242,7 @@ zio_data_buf_alloc(size_t size) if (zio_use_uma) return (kmem_cache_alloc(zio_data_buf_cache[c], KM_PUSHPAGE)); else - return (kmem_alloc(size, KM_SLEEP)); + return (kmem_alloc(size, KM_SLEEP | KM_NODEBUG)); } void Modified: head/sys/sys/malloc.h ============================================================================== --- head/sys/sys/malloc.h Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/sys/malloc.h Fri Jan 27 20:18:31 2012 (r230623) @@ -50,6 +50,7 @@ #define M_ZERO 0x0100 /* bzero the allocation */ #define M_NOVM 0x0200 /* don't ask VM for pages */ #define M_USE_RESERVE 0x0400 /* can alloc out of reserve memory */ +#define M_NODUMP 0x0800 /* don't dump pages in this allocation */ #define M_MAGIC 877983977 /* time when first defined :-) */ Modified: head/sys/vm/uma.h ============================================================================== --- head/sys/vm/uma.h Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/vm/uma.h Fri Jan 27 20:18:31 2012 (r230623) @@ -248,6 +248,10 @@ int uma_zsecond_add(uma_zone_t zone, uma * backend pages and can fail early. */ #define UMA_ZONE_VTOSLAB 0x2000 /* Zone uses vtoslab for lookup. */ +#define UMA_ZONE_NODUMP 0x4000 /* + * Zone's pages will not be included in + * mini-dumps. + */ /* * These flags are shared between the keg and zone. In zones wishing to add Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/vm/uma_core.c Fri Jan 27 20:18:31 2012 (r230623) @@ -845,6 +845,9 @@ keg_alloc_slab(uma_keg_t keg, uma_zone_t else wait &= ~M_ZERO; + if (keg->uk_flags & UMA_ZONE_NODUMP) + wait |= M_NODUMP; + /* zone is passed for legacy reasons. */ mem = allocf(zone, keg->uk_ppera * UMA_SLAB_SIZE, &flags, wait); if (mem == NULL) { Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/vm/vm_contig.c Fri Jan 27 20:18:31 2012 (r230623) @@ -315,6 +315,8 @@ kmem_alloc_contig(vm_map_t map, vm_size_ pflags = VM_ALLOC_SYSTEM | VM_ALLOC_NOBUSY; if (flags & M_ZERO) pflags |= VM_ALLOC_ZERO; + if (flags & M_NODUMP) + pflags |= VM_ALLOC_NODUMP; VM_OBJECT_LOCK(object); tries = 0; retry: Modified: head/sys/vm/vm_kern.c ============================================================================== --- head/sys/vm/vm_kern.c Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/vm/vm_kern.c Fri Jan 27 20:18:31 2012 (r230623) @@ -382,6 +382,8 @@ kmem_back(vm_map_t map, vm_offset_t addr if (flags & M_ZERO) pflags |= VM_ALLOC_ZERO; + if (flags & M_NODUMP) + pflags |= VM_ALLOC_NODUMP; VM_OBJECT_LOCK(kmem_object); for (i = 0; i < size; i += PAGE_SIZE) { Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/vm/vm_page.c Fri Jan 27 20:18:31 2012 (r230623) @@ -1305,6 +1305,7 @@ vm_page_cache_transfer(vm_object_t orig_ * VM_ALLOC_IFNOTCACHED return NULL, do not reactivate if the page * is cached * VM_ALLOC_NOBUSY do not set the flag VPO_BUSY on the page + * VM_ALLOC_NODUMP do not include the page in a kernel core dump * VM_ALLOC_NOOBJ page is not associated with an object and * should not have the flag VPO_BUSY set * VM_ALLOC_WIRED wire the allocated page @@ -1429,6 +1430,8 @@ vm_page_alloc(vm_object_t object, vm_pin * must be cleared before the free page queues lock is released. */ flags = 0; + if (req & VM_ALLOC_NODUMP) + flags |= PG_NODUMP; if (m->flags & PG_ZERO) { vm_page_zero_count--; if (req & VM_ALLOC_ZERO) @@ -1599,6 +1602,8 @@ retry: flags = 0; if ((req & VM_ALLOC_ZERO) != 0) flags = PG_ZERO; + if ((req & VM_ALLOC_NODUMP) != 0) + flags |= PG_NODUMP; if ((req & VM_ALLOC_WIRED) != 0) atomic_add_int(&cnt.v_wire_count, npages); oflags = VPO_UNMANAGED; Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Fri Jan 27 18:29:03 2012 (r230622) +++ head/sys/vm/vm_page.h Fri Jan 27 20:18:31 2012 (r230623) @@ -263,6 +263,7 @@ extern struct vpglocks pa_lock[]; #define PG_MARKER 0x10 /* special queue marker page */ #define PG_SLAB 0x20 /* object pointer is actually a slab */ #define PG_WINATCFLS 0x40 /* flush dirty page on inactive q */ +#define PG_NODUMP 0x80 /* don't include this page in the dump */ /* * Misc constants. @@ -350,6 +351,7 @@ extern struct vpglocks vm_page_queue_loc #define VM_ALLOC_IFCACHED 0x0400 /* Fail if the page is not cached */ #define VM_ALLOC_IFNOTCACHED 0x0800 /* Fail if the page is cached */ #define VM_ALLOC_IGN_SBUSY 0x1000 /* vm_page_grab() only */ +#define VM_ALLOC_NODUMP 0x2000 /* don't include in dump */ #define VM_ALLOC_COUNT_SHIFT 16 #define VM_ALLOC_COUNT(count) ((count) << VM_ALLOC_COUNT_SHIFT) From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 20:53:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE0C1106566B; Fri, 27 Jan 2012 20:53:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC5B28FC08; Fri, 27 Jan 2012 20:53:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RKrbMo057848; Fri, 27 Jan 2012 20:53:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RKrbDL057845; Fri, 27 Jan 2012 20:53:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201272053.q0RKrbDL057845@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 27 Jan 2012 20:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230624 - in stable/9: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 20:53:38 -0000 Author: jilles Date: Fri Jan 27 20:53:37 2012 New Revision: 230624 URL: http://svn.freebsd.org/changeset/base/230624 Log: MFC r230095: sh: Properly show "Not a directory" error in cd builtin. The errno message display added in r222292 did not take attempting to cd to a non-directory or something that cannot be stat()ed into account. PR: bin/164070 Added: stable/9/tools/regression/bin/sh/builtins/cd8.0 - copied unchanged from r230095, head/tools/regression/bin/sh/builtins/cd8.0 Modified: stable/9/bin/sh/cd.c Directory Properties: stable/9/bin/sh/ (props changed) stable/9/tools/regression/bin/sh/ (props changed) Modified: stable/9/bin/sh/cd.c ============================================================================== --- stable/9/bin/sh/cd.c Fri Jan 27 20:18:31 2012 (r230623) +++ stable/9/bin/sh/cd.c Fri Jan 27 20:53:37 2012 (r230624) @@ -130,7 +130,12 @@ cdcmd(int argc, char **argv) (path = bltinlookup("CDPATH", 1)) == NULL) path = nullstr; while ((p = padvance(&path, dest)) != NULL) { - if (stat(p, &statb) >= 0 && S_ISDIR(statb.st_mode)) { + if (stat(p, &statb) < 0) { + if (errno != ENOENT) + errno1 = errno; + } else if (!S_ISDIR(statb.st_mode)) + errno1 = ENOTDIR; + else { if (!print) { /* * XXX - rethink Copied: stable/9/tools/regression/bin/sh/builtins/cd8.0 (from r230095, head/tools/regression/bin/sh/builtins/cd8.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/cd8.0 Fri Jan 27 20:53:37 2012 (r230624, copy of r230095, head/tools/regression/bin/sh/builtins/cd8.0) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +# The exact wording of the error message is not standardized, but giving +# a description of the errno is useful. + +LC_ALL=C +export LC_ALL +r=0 + +t() { + exec 3>&1 + errmsg=`cd "$1" 2>&1 >&3 3>&-` + exec 3>&- + case $errmsg in + *[Nn]ot\ a\ directory*) + ;; + *) + printf "Wrong error message for %s: %s\n" "$1" "$errmsg" + r=3 + ;; + esac +} + +t /dev/tty +t /dev/tty/x +exit $r From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 21:22:08 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27BCA106567C; Fri, 27 Jan 2012 21:22:08 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1184C8FC12; Fri, 27 Jan 2012 21:22:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RLM7n6061076; Fri, 27 Jan 2012 21:22:07 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RLM71E061074; Fri, 27 Jan 2012 21:22:07 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201201272122.q0RLM71E061074@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 27 Jan 2012 21:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230625 - stable/9/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 21:22:08 -0000 Author: jilles Date: Fri Jan 27 21:22:07 2012 New Revision: 230625 URL: http://svn.freebsd.org/changeset/base/230625 Log: MFC r228937: sh: Do not force special builtins non-special in optimized command substitition. This is not necessary: errors are already caught in evalbackcmd() and forcelocal handles changes to variables. Note that this depends on r223024. Modified: stable/9/bin/sh/eval.c Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/eval.c ============================================================================== --- stable/9/bin/sh/eval.c Fri Jan 27 20:53:37 2012 (r230624) +++ stable/9/bin/sh/eval.c Fri Jan 27 21:22:07 2012 (r230625) @@ -983,7 +983,6 @@ evalcommand(union node *cmd, int flags, memout.nextc = memout.buf; memout.bufsize = 64; mode |= REDIR_BACKQ; - cmdentry.special = 0; } savecmdname = commandname; savetopfile = getcurrentfile(); @@ -1004,7 +1003,7 @@ evalcommand(union node *cmd, int flags, * If there is no command word, redirection errors should * not be fatal but assignment errors should. */ - if (argc == 0 && !(flags & EV_BACKCMD)) + if (argc == 0) cmdentry.special = 1; listsetvar(cmdenviron, cmdentry.special ? 0 : VNOSET); if (argc > 0) From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 21:49:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A07E106566B; Fri, 27 Jan 2012 21:49:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 254E58FC12; Fri, 27 Jan 2012 21:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RLn3av061919; Fri, 27 Jan 2012 21:49:03 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RLn2U3061917; Fri, 27 Jan 2012 21:49:02 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201201272149.q0RLn2U3061917@svn.freebsd.org> From: Warner Losh Date: Fri, 27 Jan 2012 21:49:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230626 - head/sys/dev/pccbb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 21:49:03 -0000 Author: imp Date: Fri Jan 27 21:49:02 2012 New Revision: 230626 URL: http://svn.freebsd.org/changeset/base/230626 Log: Some laptops have weak power controllers that cannot tolerate multiple cards powering up at once. Work around the easy case (multiple cards inserted on boot) with a short sleep and a long comment. This improves reliability on those laptops with power hungry cards. Modified: head/sys/dev/pccbb/pccbb.c Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Fri Jan 27 21:22:07 2012 (r230625) +++ head/sys/dev/pccbb/pccbb.c Fri Jan 27 21:49:02 2012 (r230626) @@ -460,6 +460,13 @@ cbb_event_thread(void *arg) int err; int not_a_card = 0; + /* + * We need to act as a power sequencer on startup. Delay 2s/channel + * to ensure the other channels have had a chance to come up. We likely + * should add a lock that's shared on a per-slot basis so that only + * one power event can happen per slot at a time. + */ + pause("cbbstart", hz * device_get_unit(sc->dev) * 2); mtx_lock(&sc->mtx); sc->flags |= CBB_KTHREAD_RUNNING; while ((sc->flags & CBB_KTHREAD_DONE) == 0) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 21:53:00 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63B80106566C; Fri, 27 Jan 2012 21:53:00 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4E0BB8FC0C; Fri, 27 Jan 2012 21:53:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RLr0Sf062078; Fri, 27 Jan 2012 21:53:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RLr0gS062075; Fri, 27 Jan 2012 21:53:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201272153.q0RLr0gS062075@svn.freebsd.org> From: Marius Strobl Date: Fri, 27 Jan 2012 21:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230627 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 21:53:00 -0000 Author: marius Date: Fri Jan 27 21:52:59 2012 New Revision: 230627 URL: http://svn.freebsd.org/changeset/base/230627 Log: Using ATA_CAM along with ATAPI DMA causes data corruption with ALI_NEW and CMD controllers for reasons unknown so disable it. PR: 164226 Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c head/sys/dev/ata/chipsets/ata-siliconimage.c Modified: head/sys/dev/ata/chipsets/ata-acerlabs.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-acerlabs.c Fri Jan 27 21:49:02 2012 (r230626) +++ head/sys/dev/ata/chipsets/ata-acerlabs.c Fri Jan 27 21:52:59 2012 (r230627) @@ -213,6 +213,10 @@ ata_ali_ch_attach(device_t dev) if (ch->dma.max_iosize > 256 * 512) ch->dma.max_iosize = 256 * 512; } +#ifdef ATA_CAM + if (ctlr->chip->cfg2 & ALI_NEW) + ch->flags |= ATA_NO_ATAPI_DMA; +#endif return 0; } Modified: head/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-siliconimage.c Fri Jan 27 21:49:02 2012 (r230626) +++ head/sys/dev/ata/chipsets/ata-siliconimage.c Fri Jan 27 21:52:59 2012 (r230627) @@ -240,6 +240,10 @@ ata_cmd_ch_attach(device_t dev) if (ctlr->chip->cfg2 & SII_INTR) ch->hw.status = ata_cmd_status; +#ifdef ATA_CAM + ch->flags |= ATA_NO_ATAPI_DMA; +#endif + return 0; } From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 22:04:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC836106566B; Fri, 27 Jan 2012 22:04:43 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B79C58FC18; Fri, 27 Jan 2012 22:04:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RM4htu062480; Fri, 27 Jan 2012 22:04:43 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RM4hRH062478; Fri, 27 Jan 2012 22:04:43 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201272204.q0RM4hRH062478@svn.freebsd.org> From: Marius Strobl Date: Fri, 27 Jan 2012 22:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230628 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 22:04:43 -0000 Author: marius Date: Fri Jan 27 22:04:43 2012 New Revision: 230628 URL: http://svn.freebsd.org/changeset/base/230628 Log: Mark cpu_{halt,reset}() as __dead2 as appropriate. Modified: head/sys/sparc64/include/cpu.h Modified: head/sys/sparc64/include/cpu.h ============================================================================== --- head/sys/sparc64/include/cpu.h Fri Jan 27 21:52:59 2012 (r230627) +++ head/sys/sparc64/include/cpu.h Fri Jan 27 22:04:43 2012 (r230628) @@ -53,8 +53,8 @@ extern char btext[]; extern char etext[]; void cheetah_init(u_int cpu_impl); -void cpu_halt(void); -void cpu_reset(void); +void cpu_halt(void) __dead2; +void cpu_reset(void) __dead2; void fork_trampoline(void); void swi_vm(void *v); void zeus_init(u_int cpu_impl); From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 22:24:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43E04106564A; Fri, 27 Jan 2012 22:24:04 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 322658FC13; Fri, 27 Jan 2012 22:24:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RMO4wd063107; Fri, 27 Jan 2012 22:24:04 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RMO3Im063105; Fri, 27 Jan 2012 22:24:04 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201201272224.q0RMO3Im063105@svn.freebsd.org> From: Kip Macy Date: Fri, 27 Jan 2012 22:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230629 - head/cddl/contrib/opensolaris/lib/libzpool/common/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 22:24:04 -0000 Author: kmacy Date: Fri Jan 27 22:24:03 2012 New Revision: 230629 URL: http://svn.freebsd.org/changeset/base/230629 Log: add KM_NODEBUG needed by ARC buffer core dump exclusion change Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Modified: head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Jan 27 22:04:43 2012 (r230628) +++ head/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Fri Jan 27 22:24:03 2012 (r230629) @@ -331,6 +331,7 @@ extern void cv_broadcast(kcondvar_t *cv) #define KM_NOSLEEP UMEM_DEFAULT #define KMC_NODEBUG UMC_NODEBUG #define KMC_NOTOUCH 0 /* not needed for userland caches */ +#define KM_NODEBUG 0 #define kmem_alloc(_s, _f) umem_alloc(_s, _f) #define kmem_zalloc(_s, _f) umem_zalloc(_s, _f) #define kmem_free(_b, _s) umem_free(_b, _s) From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 22:25:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7BAD106564A; Fri, 27 Jan 2012 22:25:46 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 969738FC0A; Fri, 27 Jan 2012 22:25:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RMPkEU063195; Fri, 27 Jan 2012 22:25:46 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RMPkbE063193; Fri, 27 Jan 2012 22:25:46 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201272225.q0RMPkbE063193@svn.freebsd.org> From: Marius Strobl Date: Fri, 27 Jan 2012 22:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230630 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 22:25:46 -0000 Author: marius Date: Fri Jan 27 22:25:46 2012 New Revision: 230630 URL: http://svn.freebsd.org/changeset/base/230630 Log: For machines where the kernel address space is unrestricted increase VM_KMEM_SIZE_SCALE to 2, awaiting more insight from alc@. As it turns out, the VM apparently has problems with machines that have large holes in the physical address space, causing the kmem_suballoc() call in kmeminit() to fail with a VM_KMEM_SIZE_SCALE of 1. Using a value of 2 allows these, namely Blade 1500 with 2GB of RAM, to boot. PR: 164227 Modified: head/sys/sparc64/include/vmparam.h Modified: head/sys/sparc64/include/vmparam.h ============================================================================== --- head/sys/sparc64/include/vmparam.h Fri Jan 27 22:24:03 2012 (r230629) +++ head/sys/sparc64/include/vmparam.h Fri Jan 27 22:25:46 2012 (r230630) @@ -218,7 +218,7 @@ * is the total KVA space allocated for kmem_map. */ #ifndef VM_KMEM_SIZE_SCALE -#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 1) +#define VM_KMEM_SIZE_SCALE (tsb_kernel_ldd_phys == 0 ? 3 : 2) #endif /* From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 22:29:30 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3E59106564A; Fri, 27 Jan 2012 22:29:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2DB78FC15; Fri, 27 Jan 2012 22:29:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RMTTct063334; Fri, 27 Jan 2012 22:29:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RMTTiB063332; Fri, 27 Jan 2012 22:29:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201272229.q0RMTTiB063332@svn.freebsd.org> From: Marius Strobl Date: Fri, 27 Jan 2012 22:29:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230631 - head/sys/dev/ofw X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 22:29:30 -0000 Author: marius Date: Fri Jan 27 22:29:29 2012 New Revision: 230631 URL: http://svn.freebsd.org/changeset/base/230631 Log: Implement OF_printf() using kvprintf() directly, avoiding to use a buffer and allowing to handle newlines properly Modified: head/sys/dev/ofw/openfirm.c Modified: head/sys/dev/ofw/openfirm.c ============================================================================== --- head/sys/dev/ofw/openfirm.c Fri Jan 27 22:25:46 2012 (r230630) +++ head/sys/dev/ofw/openfirm.c Fri Jan 27 22:29:29 2012 (r230631) @@ -72,6 +72,8 @@ __FBSDID("$FreeBSD$"); #include "ofw_if.h" +static void OF_putchar(int c, void *arg); + MALLOC_DEFINE(M_OFWPROP, "openfirm", "Open Firmware properties"); static ihandle_t stdout; @@ -82,7 +84,7 @@ static struct ofw_kobj ofw_kernel_obj; static struct kobj_ops ofw_kernel_kops; /* - * OFW install routines. Highest priority wins, equal priority also + * OFW install routines. Highest priority wins, equal priority also * overrides allowing last-set to win. */ SET_DECLARE(ofw_set, ofw_def_t); @@ -138,15 +140,27 @@ OF_init(void *cookie) return (rv); } +static void +OF_putchar(int c, void *arg __unused) +{ + char cbuf; + + if (c == '\n') { + cbuf = '\r'; + OF_write(stdout, &cbuf, 1); + } + + cbuf = c; + OF_write(stdout, &cbuf, 1); +} + void OF_printf(const char *fmt, ...) { va_list va; - char buf[1024]; va_start(va, fmt); - vsprintf(buf, fmt, va); - OF_write(stdout, buf, strlen(buf)); + (void)kvprintf(fmt, OF_putchar, NULL, 10, va); va_end(va); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 22:35:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86AF5106566C; Fri, 27 Jan 2012 22:35:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B1608FC17; Fri, 27 Jan 2012 22:35:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RMZsJV063831; Fri, 27 Jan 2012 22:35:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RMZsvu063828; Fri, 27 Jan 2012 22:35:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201272235.q0RMZsvu063828@svn.freebsd.org> From: Marius Strobl Date: Fri, 27 Jan 2012 22:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230632 - in head/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 22:35:54 -0000 Author: marius Date: Fri Jan 27 22:35:53 2012 New Revision: 230632 URL: http://svn.freebsd.org/changeset/base/230632 Log: - Now that we have a working OF_printf() since r230631, use it for implementing a simple OF_panic() that may be used during the early cycles when panic() isn't available, yet. - Mark cpu_{exit,shutdown}() as __dead2 as appropriate. Modified: head/sys/sparc64/include/ofw_machdep.h head/sys/sparc64/sparc64/ofw_machdep.c Modified: head/sys/sparc64/include/ofw_machdep.h ============================================================================== --- head/sys/sparc64/include/ofw_machdep.h Fri Jan 27 22:29:29 2012 (r230631) +++ head/sys/sparc64/include/ofw_machdep.h Fri Jan 27 22:35:53 2012 (r230632) @@ -37,8 +37,9 @@ typedef uint64_t cell_t; int OF_decode_addr(phandle_t, int, int *, bus_addr_t *); void OF_getetheraddr(device_t, u_char *); u_int OF_getscsinitid(device_t); -void cpu_shutdown(void *); +void OF_panic(const char *fmt, ...) __dead2 __printflike(1, 2); +void cpu_shutdown(void *) __dead2; int ofw_entry(void *); -void ofw_exit(void *); +void ofw_exit(void *) __dead2; #endif /* _MACHINE_OFW_MACHDEP_H_ */ Modified: head/sys/sparc64/sparc64/ofw_machdep.c ============================================================================== --- head/sys/sparc64/sparc64/ofw_machdep.c Fri Jan 27 22:29:29 2012 (r230631) +++ head/sys/sparc64/sparc64/ofw_machdep.c Fri Jan 27 22:35:53 2012 (r230632) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include void OF_getetheraddr(device_t dev, u_char *addr) @@ -81,6 +82,19 @@ OF_getscsinitid(device_t dev) return (7); } +void +OF_panic(const char *fmt, ...) +{ + char buf[256]; + va_list ap; + + va_start(ap, fmt); + (void)vsnprintf(buf, sizeof(buf), fmt, ap); + OF_printf("OF_panic: %s\n", buf); + va_end(ap); + OF_exit(); +} + static __inline uint32_t phys_hi_mask_space(const char *bus, uint32_t phys_hi) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 23:21:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33A301065672; Fri, 27 Jan 2012 23:21:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 213EE8FC12; Fri, 27 Jan 2012 23:21:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RNLsoM065523; Fri, 27 Jan 2012 23:21:54 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RNLsak065518; Fri, 27 Jan 2012 23:21:54 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201272321.q0RNLsak065518@svn.freebsd.org> From: Marius Strobl Date: Fri, 27 Jan 2012 23:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230633 - in head/sys/sparc64: include sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 23:21:55 -0000 Author: marius Date: Fri Jan 27 23:21:54 2012 New Revision: 230633 URL: http://svn.freebsd.org/changeset/base/230633 Log: Now that we have a working OF_printf() since r230631 and a OF_panic() helper since r230632, use these for output and panicing during the early cycles and move cninit() until after the static per-CPU data has been set up. This solves a couple of issue regarding the non- availability of the static per-CPU data: - panic() not working and only making things worse when called, - having to supply a special DELAY() implementation to the low-level console drivers, - curthread accesses of mutex(9) usage in low-level console drivers that aren't conditional due to compiler optimizations (basically, this is the problem described in r227537 but in this case for keyboards attached via uart(4)). [1] PR: 164123 [1] Modified: head/sys/sparc64/include/clock.h head/sys/sparc64/sparc64/cache.c head/sys/sparc64/sparc64/clock.c head/sys/sparc64/sparc64/machdep.c Modified: head/sys/sparc64/include/clock.h ============================================================================== --- head/sys/sparc64/include/clock.h Fri Jan 27 22:35:53 2012 (r230632) +++ head/sys/sparc64/include/clock.h Fri Jan 27 23:21:54 2012 (r230633) @@ -1,27 +1,5 @@ /*- - * Copyright (c) 2001 Jake Burkholder. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. + * This file is in the public domain. * * $FreeBSD$ */ @@ -29,10 +7,4 @@ #ifndef _MACHINE_CLOCK_H_ #define _MACHINE_CLOCK_H_ -extern void (*delay_func)(int usec); -extern u_long clock_boot; - -void delay_boot(int usec); -void delay_tick(int usec); - #endif /* !_MACHINE_CLOCK_H_ */ Modified: head/sys/sparc64/sparc64/cache.c ============================================================================== --- head/sys/sparc64/sparc64/cache.c Fri Jan 27 22:35:53 2012 (r230632) +++ head/sys/sparc64/sparc64/cache.c Fri Jan 27 23:21:54 2012 (r230633) @@ -142,24 +142,24 @@ cache_init(struct pcpu *pcpu) "l2-cache-line-size", pcpu->pc_cache.ec_linesize) == -1 || OF_GET(pcpu->pc_node, !use_new_prop ? "ecache-associativity" : "l2-cache-associativity", pcpu->pc_cache.ec_assoc) == -1) - panic("cache_init: could not retrieve cache parameters"); + OF_panic("%s: could not retrieve cache parameters", __func__); set = pcpu->pc_cache.ic_size / pcpu->pc_cache.ic_assoc; if ((set & ~(1UL << (ffs(set) - 1))) != 0) - panic("cache_init: I$ set size not a power of 2"); + OF_panic("%s: I$ set size not a power of 2", __func__); if ((pcpu->pc_cache.dc_size & ~(1UL << (ffs(pcpu->pc_cache.dc_size) - 1))) != 0) - panic("cache_init: D$ size not a power of 2"); + OF_panic("%s: D$ size not a power of 2", __func__); /* * For CPUs which don't support unaliasing in hardware ensure that * the data cache doesn't have too many virtual colors. */ if (dcache_color_ignore == 0 && ((pcpu->pc_cache.dc_size / pcpu->pc_cache.dc_assoc) / PAGE_SIZE) != DCACHE_COLORS) - panic("cache_init: too many D$ colors"); + OF_panic("%s: too many D$ colors", __func__); set = pcpu->pc_cache.ec_size / pcpu->pc_cache.ec_assoc; if ((set & ~(1UL << (ffs(set) - 1))) != 0) - panic("cache_init: E$ set size not a power of 2"); + OF_panic("%s: E$ set size not a power of 2", __func__); if (pcpu->pc_impl >= CPU_IMPL_ULTRASPARCIII) { cache_enable = cheetah_cache_enable; @@ -184,5 +184,5 @@ cache_init(struct pcpu *pcpu) tlb_flush_nonlocked = spitfire_tlb_flush_nonlocked; tlb_flush_user = spitfire_tlb_flush_user; } else - panic("cache_init: unknown CPU"); + OF_panic("%s: unknown CPU", __func__); } Modified: head/sys/sparc64/sparc64/clock.c ============================================================================== --- head/sys/sparc64/sparc64/clock.c Fri Jan 27 22:35:53 2012 (r230632) +++ head/sys/sparc64/sparc64/clock.c Fri Jan 27 23:21:54 2012 (r230633) @@ -33,36 +33,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include -void (*delay_func)(int usec); -u_long clock_boot; - void DELAY(int usec) { - - (*delay_func)(usec); -} - -void -delay_boot(int usec) -{ - u_long end; - - if (usec < 0) - return; - - end = rd(tick) + (u_long)usec * clock_boot / 1000000; - while (rd(tick) < end) - cpu_spinwait(); -} - -void -delay_tick(int usec) -{ u_long end; if (usec < 0) Modified: head/sys/sparc64/sparc64/machdep.c ============================================================================== --- head/sys/sparc64/sparc64/machdep.c Fri Jan 27 22:35:53 2012 (r230632) +++ head/sys/sparc64/sparc64/machdep.c Fri Jan 27 23:21:54 2012 (r230633) @@ -88,7 +88,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -376,7 +375,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l /* * Parse metadata if present and fetch parameters. Must be before the - * console is inited so cninit gets the right value of boothowto. + * console is inited so cninit() gets the right value of boothowto. */ if (mdp != NULL) { preload_metadata = mdp; @@ -421,37 +420,19 @@ sparc64_init(caddr_t mdp, u_long o1, u_l root = OF_peer(0); pc->pc_node = find_bsp(root, pc->pc_mid, cpu_impl); if (pc->pc_node == 0) - OF_exit(); + OF_panic("%s: cannot find boot CPU node", __func__); if (OF_getprop(pc->pc_node, "clock-frequency", &pc->pc_clock, sizeof(pc->pc_clock)) <= 0) - OF_exit(); - - /* - * Provide a DELAY() that works before PCPU_REG is set. We can't - * set PCPU_REG without also taking over the trap table or the - * firmware will overwrite it. Unfortunately, it's way to early - * to also take over the trap table at this point. - */ - clock_boot = pc->pc_clock; - delay_func = delay_boot; - - /* - * Initialize the console before printing anything. - * NB: the low-level console drivers require a working DELAY() at - * this point. - */ - cninit(); + OF_panic("%s: cannot determine boot CPU clock", __func__); /* * Panic if there is no metadata. Most likely the kernel was booted * directly, instead of through loader(8). */ if (mdp == NULL || kmdp == NULL || end == 0 || - kernel_tlb_slots == 0 || kernel_tlbs == NULL) { - printf("sparc64_init: missing loader metadata.\n" - "This probably means you are not using loader(8).\n"); - panic("sparc64_init"); - } + kernel_tlb_slots == 0 || kernel_tlbs == NULL) + OF_panic("%s: missing loader metadata.\nThis probably means " + "you are not using loader(8).", __func__); /* * Work around the broken loader behavior of not demapping no @@ -461,7 +442,7 @@ sparc64_init(caddr_t mdp, u_long o1, u_l for (va = KERNBASE + (kernel_tlb_slots - 1) * PAGE_SIZE_4M; va >= roundup2(end, PAGE_SIZE_4M); va -= PAGE_SIZE_4M) { if (bootverbose) - printf("demapping unused kernel TLB slot " + OF_printf("demapping unused kernel TLB slot " "(va %#lx - %#lx)\n", va, va + PAGE_SIZE_4M - 1); stxa(TLB_DEMAP_VA(va) | TLB_DEMAP_PRIMARY | TLB_DEMAP_PAGE, ASI_DMMU_DEMAP, 0); @@ -479,13 +460,15 @@ sparc64_init(caddr_t mdp, u_long o1, u_l */ if (OF_getprop(pc->pc_node, "#dtlb-entries", &dtlb_slots, sizeof(dtlb_slots)) == -1) - panic("sparc64_init: cannot determine number of dTLB slots"); + OF_panic("%s: cannot determine number of dTLB slots", + __func__); if (OF_getprop(pc->pc_node, "#itlb-entries", &itlb_slots, sizeof(itlb_slots)) == -1) - panic("sparc64_init: cannot determine number of iTLB slots"); + OF_panic("%s: cannot determine number of iTLB slots", + __func__); /* - * Initialize and enable the caches. Note that his may include + * Initialize and enable the caches. Note that this may include * applying workarounds. */ cache_init(pc); @@ -573,9 +556,13 @@ sparc64_init(caddr_t mdp, u_long o1, u_l sun4u_set_traptable(tl0_base); /* - * It's now safe to use the real DELAY(). + * Initialize the console. + * NB: the low-level console drivers require a working DELAY() and + * some compiler optimizations may cause the curthread accesses of + * mutex(9) to be factored out even if the latter aren't actually + * called, both requiring PCPU_REG to be set. */ - delay_func = delay_tick; + cninit(); /* * Initialize the dynamic per-CPU area for the BSP and the message From owner-svn-src-all@FreeBSD.ORG Fri Jan 27 23:25:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35C9D1065670; Fri, 27 Jan 2012 23:25:25 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24AE28FC18; Fri, 27 Jan 2012 23:25:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0RNPOGk065674; Fri, 27 Jan 2012 23:25:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0RNPOKo065672; Fri, 27 Jan 2012 23:25:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201272325.q0RNPOKo065672@svn.freebsd.org> From: Marius Strobl Date: Fri, 27 Jan 2012 23:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230634 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 23:25:25 -0000 Author: marius Date: Fri Jan 27 23:25:24 2012 New Revision: 230634 URL: http://svn.freebsd.org/changeset/base/230634 Log: Commit file missed in r230633. Modified: head/sys/sparc64/sparc64/pmap.c Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Fri Jan 27 23:21:54 2012 (r230633) +++ head/sys/sparc64/sparc64/pmap.c Fri Jan 27 23:25:24 2012 (r230634) @@ -333,16 +333,16 @@ pmap_bootstrap(u_int cpu_impl) * pmap_bootstrap_alloc is called. */ if ((pmem = OF_finddevice("/memory")) == -1) - panic("pmap_bootstrap: finddevice /memory"); + OF_panic("%s: finddevice /memory", __func__); if ((sz = OF_getproplen(pmem, "available")) == -1) - panic("pmap_bootstrap: getproplen /memory/available"); + OF_panic("%s: getproplen /memory/available", __func__); if (sizeof(phys_avail) < sz) - panic("pmap_bootstrap: phys_avail too small"); + OF_panic("%s: phys_avail too small", __func__); if (sizeof(mra) < sz) - panic("pmap_bootstrap: mra too small"); + OF_panic("%s: mra too small", __func__); bzero(mra, sz); if (OF_getprop(pmem, "available", mra, sz) == -1) - panic("pmap_bootstrap: getprop /memory/available"); + OF_panic("%s: getprop /memory/available", __func__); sz /= sizeof(*mra); CTR0(KTR_PMAP, "pmap_bootstrap: physical memory"); qsort(mra, sz, sizeof (*mra), mr_cmp); @@ -414,7 +414,7 @@ pmap_bootstrap(u_int cpu_impl) */ pa = pmap_bootstrap_alloc(tsb_kernel_size, colors); if (pa & PAGE_MASK_4M) - panic("pmap_bootstrap: TSB unaligned\n"); + OF_panic("%s: TSB unaligned", __func__); tsb_kernel_phys = pa; if (tsb_kernel_ldd_phys == 0) { tsb_kernel = @@ -461,7 +461,7 @@ pmap_bootstrap(u_int cpu_impl) #define PATCH_ASI(addr, asi) do { \ if (addr[0] != WR_R_I(IF_F3_RD(addr[0]), 0x0, \ IF_F3_RS1(addr[0]))) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_IMM((asi), 13); \ flush(addr); \ @@ -470,7 +470,7 @@ pmap_bootstrap(u_int cpu_impl) #define PATCH_LDD(addr, asi) do { \ if (addr[0] != LDDA_R_I_R(IF_F3_RD(addr[0]), 0x0, \ IF_F3_RS1(addr[0]), IF_F3_RS2(addr[0]))) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_F3_IMM_ASI(asi); \ flush(addr); \ @@ -481,7 +481,7 @@ pmap_bootstrap(u_int cpu_impl) addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, \ IF_F3_RS1(addr[1])) || \ addr[3] != SETHI(IF_F2_RD(addr[3]), 0x0)) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_IMM((val) >> 42, 22); \ addr[1] |= EIF_IMM((val) >> 32, 10); \ @@ -495,7 +495,7 @@ pmap_bootstrap(u_int cpu_impl) if (addr[0] != SETHI(IF_F2_RD(addr[0]), 0x0) || \ addr[1] != OR_R_I_R(IF_F3_RD(addr[1]), 0x0, \ IF_F3_RS1(addr[1]))) \ - panic("%s: patched instructions have changed", \ + OF_panic("%s: patched instructions have changed", \ __func__); \ addr[0] |= EIF_IMM((val) >> 10, 22); \ addr[1] |= EIF_IMM((val), 10); \ @@ -604,14 +604,15 @@ pmap_bootstrap(u_int cpu_impl) * Add the PROM mappings to the kernel TSB. */ if ((vmem = OF_finddevice("/virtual-memory")) == -1) - panic("pmap_bootstrap: finddevice /virtual-memory"); + OF_panic("%s: finddevice /virtual-memory", __func__); if ((sz = OF_getproplen(vmem, "translations")) == -1) - panic("pmap_bootstrap: getproplen translations"); + OF_panic("%s: getproplen translations", __func__); if (sizeof(translations) < sz) - panic("pmap_bootstrap: translations too small"); + OF_panic("%s: translations too small", __func__); bzero(translations, sz); if (OF_getprop(vmem, "translations", translations, sz) == -1) - panic("pmap_bootstrap: getprop /virtual-memory/translations"); + OF_panic("%s: getprop /virtual-memory/translations", + __func__); sz /= sizeof(*translations); translations_size = sz; CTR0(KTR_PMAP, "pmap_bootstrap: translations"); @@ -649,11 +650,11 @@ pmap_bootstrap(u_int cpu_impl) * calls in that situation. */ if ((sz = OF_getproplen(pmem, "reg")) == -1) - panic("pmap_bootstrap: getproplen /memory/reg"); + OF_panic("%s: getproplen /memory/reg", __func__); if (sizeof(sparc64_memreg) < sz) - panic("pmap_bootstrap: sparc64_memreg too small"); + OF_panic("%s: sparc64_memreg too small", __func__); if (OF_getprop(pmem, "reg", sparc64_memreg, sz) == -1) - panic("pmap_bootstrap: getprop /memory/reg"); + OF_panic("%s: getprop /memory/reg", __func__); sparc64_nmemreg = sz / sizeof(*sparc64_memreg); /* @@ -726,7 +727,7 @@ pmap_bootstrap_alloc(vm_size_t size, uin phys_avail[i] += size; return (pa); } - panic("pmap_bootstrap_alloc"); + OF_panic("%s: no suitable region found", __func__); } /* From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 00:17:17 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C36CD106564A; Sat, 28 Jan 2012 00:17:17 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B1FB78FC08; Sat, 28 Jan 2012 00:17:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0S0HHGb067303; Sat, 28 Jan 2012 00:17:17 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0S0HH1W067302; Sat, 28 Jan 2012 00:17:17 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201201280017.q0S0HH1W067302@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 28 Jan 2012 00:17:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230635 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 00:17:17 -0000 Author: pfg Date: Sat Jan 28 00:17:17 2012 New Revision: 230635 URL: http://svn.freebsd.org/changeset/base/230635 Log: Set SVN text/plain property for some shell scripts that happen to have a .exe extension. While here fix the shebang of a shell script that was looking for /bin/bash. Reviewed by: gnn Approved by: jhb (mentor) MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe (contents, props changed) Directory Properties: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PDESC_ZERO.badlib.exe (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_FUNC.badfunc.exe (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_LIB.libdash.exe (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.alldash.exe (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.badname.exe (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_NAME.globdash.exe (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_OFF.toobig.exe (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.coverage.exe (props changed) head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/tst.emptystack.exe (props changed) Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/pid/err.D_PROC_CREATEFAIL.many.exe ============================================================================== Binary file (source and/or target). No diff available. From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 01:38:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 029A81065672; Sat, 28 Jan 2012 01:38:49 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E64428FC0A; Sat, 28 Jan 2012 01:38:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0S1cmuZ069762; Sat, 28 Jan 2012 01:38:48 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0S1cmgS069760; Sat, 28 Jan 2012 01:38:48 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201201280138.q0S1cmgS069760@svn.freebsd.org> From: Ed Maste Date: Sat, 28 Jan 2012 01:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230636 - head/sys/dev/hwpmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 01:38:49 -0000 Author: emaste Date: Sat Jan 28 01:38:48 2012 New Revision: 230636 URL: http://svn.freebsd.org/changeset/base/230636 Log: pmc_*_initialize may return NULL if the CPU is not supported, so check that md is not null before dereferencing it. PR: kern/156540 Modified: head/sys/dev/hwpmc/hwpmc_x86.c Modified: head/sys/dev/hwpmc/hwpmc_x86.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_x86.c Sat Jan 28 00:17:17 2012 (r230635) +++ head/sys/dev/hwpmc/hwpmc_x86.c Sat Jan 28 01:38:48 2012 (r230636) @@ -250,7 +250,7 @@ pmc_md_initialize() return (NULL); /* disallow sampling if we do not have an LAPIC */ - if (!lapic_enable_pmc()) + if (md != NULL && !lapic_enable_pmc()) for (i = 1; i < md->pmd_nclass; i++) md->pmd_classdep[i].pcd_caps &= ~PMC_CAP_INTERRUPT; From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 01:45:19 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFA06106564A; Sat, 28 Jan 2012 01:45:19 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C3F4A8FC08; Sat, 28 Jan 2012 01:45:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0S1jJBj069998; Sat, 28 Jan 2012 01:45:19 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0S1jJwT069996; Sat, 28 Jan 2012 01:45:19 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201280145.q0S1jJwT069996@svn.freebsd.org> From: Rick Macklem Date: Sat, 28 Jan 2012 01:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230637 - stable/9/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 01:45:20 -0000 Author: rmacklem Date: Sat Jan 28 01:45:19 2012 New Revision: 230637 URL: http://svn.freebsd.org/changeset/base/230637 Log: MFC: r230100 Tai Horgan reported via email that there were two places in the new NFSv4 server where the code follows the wrong list. Fortunately, for these fairly rare cases, the lc_stateid[] lists are normally empty. This patch fixes the code to follow the correct list. Modified: stable/9/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/9/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jan 28 01:38:48 2012 (r230636) +++ stable/9/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jan 28 01:45:19 2012 (r230637) @@ -315,7 +315,7 @@ nfsrv_setclient(struct nfsrv_descript *n for (i = 0; i < NFSSTATEHASHSIZE; i++) { LIST_NEWHEAD(&new_clp->lc_stateid[i], &clp->lc_stateid[i], ls_hash); - LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_list) + LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, @@ -369,7 +369,7 @@ nfsrv_setclient(struct nfsrv_descript *n for (i = 0; i < NFSSTATEHASHSIZE; i++) { LIST_NEWHEAD(&new_clp->lc_stateid[i], &clp->lc_stateid[i], ls_hash); - LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_list) + LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 02:18:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6597106566B; Sat, 28 Jan 2012 02:18:50 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4CD98FC0A; Sat, 28 Jan 2012 02:18:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0S2IoUc071057; Sat, 28 Jan 2012 02:18:50 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0S2IowX071055; Sat, 28 Jan 2012 02:18:50 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201201280218.q0S2IowX071055@svn.freebsd.org> From: Rick Macklem Date: Sat, 28 Jan 2012 02:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230638 - stable/8/sys/fs/nfsserver X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 02:18:51 -0000 Author: rmacklem Date: Sat Jan 28 02:18:50 2012 New Revision: 230638 URL: http://svn.freebsd.org/changeset/base/230638 Log: MFC: r230100 Tai Horgan reported via email that there were two places in the new NFSv4 server where the code follows the wrong list. Fortunately, for these fairly rare cases, the lc_stateid[] lists are normally empty. This patch fixes the code to follow the correct list. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jan 28 01:45:19 2012 (r230637) +++ stable/8/sys/fs/nfsserver/nfs_nfsdstate.c Sat Jan 28 02:18:50 2012 (r230638) @@ -315,7 +315,7 @@ nfsrv_setclient(struct nfsrv_descript *n for (i = 0; i < NFSSTATEHASHSIZE; i++) { LIST_NEWHEAD(&new_clp->lc_stateid[i], &clp->lc_stateid[i], ls_hash); - LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_list) + LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, @@ -369,7 +369,7 @@ nfsrv_setclient(struct nfsrv_descript *n for (i = 0; i < NFSSTATEHASHSIZE; i++) { LIST_NEWHEAD(&new_clp->lc_stateid[i], &clp->lc_stateid[i], ls_hash); - LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_list) + LIST_FOREACH(tstp, &new_clp->lc_stateid[i], ls_hash) tstp->ls_clp = new_clp; } LIST_INSERT_HEAD(NFSCLIENTHASH(new_clp->lc_clientid), new_clp, From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 02:52:23 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59701106564A; Sat, 28 Jan 2012 02:52:23 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 490248FC15; Sat, 28 Jan 2012 02:52:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0S2qNfh072202; Sat, 28 Jan 2012 02:52:23 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0S2qNoX072200; Sat, 28 Jan 2012 02:52:23 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201201280252.q0S2qNoX072200@svn.freebsd.org> From: Justin Hibbits Date: Sat, 28 Jan 2012 02:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230640 - head/etc/devd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 02:52:23 -0000 Author: jhibbits Date: Sat Jan 28 02:52:22 2012 New Revision: 230640 URL: http://svn.freebsd.org/changeset/base/230640 Log: Remove the notify match from a couple devd apple events, the events don't include notify tags. Approved by: nwhitehorn (mentor) MFC after: 3 days Modified: head/etc/devd/apple.conf Modified: head/etc/devd/apple.conf ============================================================================== --- head/etc/devd/apple.conf Sat Jan 28 02:48:48 2012 (r230639) +++ head/etc/devd/apple.conf Sat Jan 28 02:52:22 2012 (r230640) @@ -6,7 +6,6 @@ notify 0 { match "system" "PMU"; match "subsystem" "Button"; - match "notify" "0x0"; action "shutdown -p now"; }; @@ -16,7 +15,6 @@ notify 0 { match "system" "PMU"; match "subsystem" "lid"; match "type" "close"; - match "notify" "0x0"; action "shutdown -p now"; }; From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 04:29:10 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1BC01065670; Sat, 28 Jan 2012 04:29:10 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id 940258FC14; Sat, 28 Jan 2012 04:29:10 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed; delsp=yes Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYH00400R4LG200@smtpauth2.wiscmail.wisc.edu>; Fri, 27 Jan 2012 22:29:09 -0600 (CST) Received: from [10.0.2.94] (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYH001Q2R4J9V00@smtpauth2.wiscmail.wisc.edu>; Fri, 27 Jan 2012 22:29:08 -0600 (CST) Date: Fri, 27 Jan 2012 22:29:07 -0600 From: Nathan Whitehorn In-reply-to: <20120123160340.GI95413@hoeg.nl> To: Ed Schouten Message-id: <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> X-Mailer: Apple Mail (2.936) X-Spam-Report: AuthenticatedSender=yes, SenderIP=10.0.2.94 X-Spam-PmxInfo: Server=avs-14, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.1.28.41516, SenderIP=10.0.2.94 References: <201201231544.q0NFirMh032859@svn.freebsd.org> <20120123160340.GI95413@hoeg.nl> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 04:29:10 -0000 I think we didn't make PC98 release media for 9.0, but that's a good point. I'm out of commission right now due to an injury, so patches would be welcome. -Nathan On Jan 23, 2012, at 10:03 AM, Ed Schouten wrote: > Hi Nathan, > > * Nathan Whitehorn , 20120123 16:44: >> TERM=xterm > > This code is also used on pc98, right? I think on pc98 we still need > to > use TERM=cons25w, to support Japanese character sets and keyboard > input. > > -- > Ed Schouten > WWW: http://80386.nl/ From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 04:31:22 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9189D106566C; Sat, 28 Jan 2012 04:31:22 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 170688FC0C; Sat, 28 Jan 2012 04:31:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0S4VKvb012344; Sat, 28 Jan 2012 08:31:20 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0S4VJDY012343; Sat, 28 Jan 2012 08:31:19 +0400 (MSK) (envelope-from ache) Date: Sat, 28 Jan 2012 08:31:18 +0400 From: Andrey Chernov To: Bruce Evans Message-ID: <20120128043118.GA12241@vniz.net> Mail-Followup-To: Andrey Chernov , Bruce Evans , John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175021.GA93016@vniz.net> <20120127201855.K1604@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120127201855.K1604@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.ORG, John Baldwin , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, David Schultz , Mark Murray Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 04:31:22 -0000 On Fri, Jan 27, 2012 at 08:34:35PM +1100, Bruce Evans wrote: > On Thu, 26 Jan 2012, Andrey Chernov wrote: > > >> On Thu, Jan 26, 2012 at 11:32:38AM -0500, John Baldwin wrote: > >>> Atomics don't operate on enums. You'll need to make it an int and just use > >>> #define's for the 3 states. > > This restores some style bugs and keeps old ones. About old bugs - I don't want this patch to be intrusive and touch style of old things. It can be committed as separate patch. > > /* Prototypes for non-quad routines. */ > > struct malloc_type; > > +#define ARC4_ENTR_NONE 0 /* Don't have entropy yet. */ > > +#define ARC4_ENTR_HAVE 1 /* Have entropy. */ > > +#define ARC4_ENTR_SEED 2 /* Reseeding. */ > > +extern volatile int arc4rand_iniseed_state; > > I see no prototypes here. Will be moved before the comment. > > uint32_t arc4random(void); > > void arc4rand(void *ptr, u_int len, int reseed); > > I see a prototype with style bugs here (names for parameters, which isn't > bug for bug compatible with the other prototypes). I don't wan't to touch old things for now. > > int bcmp(const void *, const void *, size_t); > > --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.000000000 +0300 > > +++ dev/random/randomdev_soft.c 2012-01-26 19:35:12.000000000 +0400 > > @@ -366,6 +366,8 @@ random_yarrow_unblock(void) > > selwakeuppri(&random_systat.rsel, PUSER); > > wakeup(&random_systat); > > } > > + (void)atomic_cmpset_int(&arc4rand_iniseed_state, > > + ARC4_ENTR_NONE, ARC4_ENTR_HAVE); > > } > > This is gnu style. Continuation indentation is 4 spaces in KNF. Will be 4-space indented. > > +volatile int arc4rand_iniseed_state = ARC4_ENTR_NONE; > > + > > I don't see what all the volatile qualifiers and atomic ops are for. > The volatiles certainly have no effect, since this variable is only > accessed by atomic ops which only access variables as volatile whether > you want this or not. See das's reply for more about the atomic ops. > Here I think they just close a window that would be open just once for > each for a few instructions while booting. I will remove volatile. About atomic ops: arc4rand calls are protected with mutex and yarrow calls are protected, but they can works concurrently wich each other. So, if we have atomic ops, why not to use them to close one time window too? > > + if (atomic_cmpset_int(&arc4rand_iniseed_state, > > + ARC4_ENTR_HAVE, ARC4_ENTR_SEED) || > > Gnu style indentation. Excessively early line splitting. Will be fixed. > Old code uses KNF style (except for excessive line splitting and excessive > parentheses) in the same statement. Old code is not in question at this moment. Thanx. -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 04:58:59 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B71E810656EC; Sat, 28 Jan 2012 04:58:59 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 26ACF8FC12; Sat, 28 Jan 2012 04:58:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0S4wvra012580; Sat, 28 Jan 2012 08:58:57 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0S4wugt012579; Sat, 28 Jan 2012 08:58:56 +0400 (MSK) (envelope-from ache) Date: Sat, 28 Jan 2012 08:58:55 +0400 From: Andrey Chernov To: Bruce Evans , John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG Message-ID: <20120128045854.GA12556@vniz.net> Mail-Followup-To: Andrey Chernov , Bruce Evans , John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175021.GA93016@vniz.net> <20120127201855.K1604@besplex.bde.org> <20120128043118.GA12241@vniz.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120128043118.GA12241@vniz.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 04:58:59 -0000 New verson addressed bde's style things: --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 +++ sys/libkern.h 2012-01-28 08:49:19.000000000 +0400 @@ -70,6 +70,11 @@ static __inline int abs(int a) { return static __inline long labs(long a) { return (a < 0 ? -a : a); } static __inline quad_t qabs(quad_t a) { return (a < 0 ? -a : a); } +#define ARC4_ENTR_NONE 0 /* Don't have entropy yet. */ +#define ARC4_ENTR_HAVE 1 /* Have entropy. */ +#define ARC4_ENTR_SEED 2 /* Reseeding. */ +extern int arc4rand_iniseed_state; + /* Prototypes for non-quad routines. */ struct malloc_type; uint32_t arc4random(void); --- dev/random/randomdev_soft.c.old 2011-03-02 01:42:19.000000000 +0300 +++ dev/random/randomdev_soft.c 2012-01-28 08:48:22.000000000 +0400 @@ -366,6 +366,8 @@ random_yarrow_unblock(void) selwakeuppri(&random_systat.rsel, PUSER); wakeup(&random_systat); } + (void)atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_NONE, + ARC4_ENTR_HAVE); } static int --- libkern/arc4random.c.old 2008-08-08 01:51:09.000000000 +0400 +++ libkern/arc4random.c 2012-01-28 08:51:12.000000000 +0400 @@ -24,6 +24,8 @@ __FBSDID("$FreeBSD: src/sys/libkern/arc4 #define ARC4_RESEED_SECONDS 300 #define ARC4_KEYBYTES (256 / 8) +int arc4rand_iniseed_state = ARC4_ENTR_NONE; + static u_int8_t arc4_i, arc4_j; static int arc4_numruns = 0; static u_int8_t arc4_sbox[256]; @@ -130,7 +132,8 @@ arc4rand(void *ptr, u_int len, int resee struct timeval tv; getmicrouptime(&tv); - if (reseed || + if (atomic_cmpset_int(&arc4rand_iniseed_state, ARC4_ENTR_HAVE, + ARC4_ENTR_SEED) || reseed || (arc4_numruns > ARC4_RESEED_BYTES) || (tv.tv_sec > arc4_t_reseed)) arc4_randomstir(); -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 07:47:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 820FD106566B; Sat, 28 Jan 2012 07:47:58 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id 147618FC13; Sat, 28 Jan 2012 07:47:57 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0S7lo4k016202 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Jan 2012 18:47:54 +1100 Date: Sat, 28 Jan 2012 18:47:50 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov In-Reply-To: <20120128045854.GA12556@vniz.net> Message-ID: <20120128180310.F1114@besplex.bde.org> References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175021.GA93016@vniz.net> <20120127201855.K1604@besplex.bde.org> <20120128043118.GA12241@vniz.net> <20120128045854.GA12556@vniz.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: src-committers@freebsd.org, John Baldwin , svn-src-all@freebsd.org, Bruce Evans , svn-src-head@freebsd.org, David Schultz , Mark Murray Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 07:47:58 -0000 On Sat, 28 Jan 2012, Andrey Chernov wrote: > New verson addressed bde's style things: Thanks, but ... > --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 > +++ sys/libkern.h 2012-01-28 08:49:19.000000000 +0400 > @@ -70,6 +70,11 @@ static __inline int abs(int a) { return > static __inline long labs(long a) { return (a < 0 ? -a : a); } > static __inline quad_t qabs(quad_t a) { return (a < 0 ? -a : a); } > > +#define ARC4_ENTR_NONE 0 /* Don't have entropy yet. */ > +#define ARC4_ENTR_HAVE 1 /* Have entropy. */ > +#define ARC4_ENTR_SEED 2 /* Reseeding. */ > +extern int arc4rand_iniseed_state; > + > /* Prototypes for non-quad routines. */ > struct malloc_type; > uint32_t arc4random(void); ... I will also ask for data and macros to be sorted into the data an macro sections and not unsorted in between the first set of inlines and the prototypes. (Whether the macros should be all in a macro section or near the variables or prototypes that they are for is unclear, especially since the current organization for this in this file is random.) This file was last nearly sorted in FreeBSD-2.1. Now its organization is partly to put macros and data together with inline functions that use them. This gives lots of subsections which are not clearly delimited and is not used in the prototype section, where it would split up that section too much. >From your previous reply (non-style part): > > > +volatile int arc4rand_iniseed_state = ARC4_ENTR_NONE; > > > + > > > > I don't see what all the volatile qualifiers and atomic ops are for. > > The volatiles certainly have no effect, since this variable is only > > accessed by atomic ops which only access variables as volatile whether > > you want this or not. See das's reply for more about the atomic ops. > > Here I think they just close a window that would be open just once for > > each for a few instructions while booting. > > I will remove volatile. > About atomic ops: arc4rand calls are protected with mutex and yarrow > calls are protected, but they can works concurrently wich each > other. So, if we have atomic ops, why not to use them to close one time > window too? Hmm, it's tricky code either way. I use similar cmpsets in sio, and also need a loop to synchronize the final state change. But when the state is seen to be final, atomic ops are not needed to check that it doesn't change (or to see that it is final), since it won't change again. This gives a tiny optimization that would be larger here. This is mostly overkill, since sio is^Wwas normally present at boot time. New-bus and most drivers don't have complications like this, but might need them more for loadable drivers. It is very unclear that new-bus's Giant locking is enough for anything (unless the whole system also uses Giant locking). Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 08:20:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 412D6106566B; Sat, 28 Jan 2012 08:20:16 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id AD2348FC0A; Sat, 28 Jan 2012 08:20:15 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id A18746CF; Sat, 28 Jan 2012 09:20:13 +0100 (CET) Date: Sat, 28 Jan 2012 09:19:00 +0100 From: Pawel Jakub Dawidek To: Kip Macy Message-ID: <20120128081859.GC2135@garage.freebsd.pl> References: <201201272018.q0RKIWUD055070@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5QAgd0e35j3NYeGe" Content-Disposition: inline In-Reply-To: <201201272018.q0RKIWUD055070@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230623 - in head/sys: amd64/amd64 cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 08:20:16 -0000 --5QAgd0e35j3NYeGe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 27, 2012 at 08:18:32PM +0000, Kip Macy wrote: > Author: kmacy > Date: Fri Jan 27 20:18:31 2012 > New Revision: 230623 > URL: http://svn.freebsd.org/changeset/base/230623 >=20 > Log: > exclude kmem_alloc'ed ARC data buffers from kernel minidumps on amd64 > excluding other allocations including UMA now entails the addition of > a single flag to kmem_alloc or uma zone create M_NODUMP and UMA_ZONE_NODUMP are very useful, not only for ZFS. I'll look into using it for GELI memory used to store keys. Could you please document those flags in malloc(9) and uma(9)? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --5QAgd0e35j3NYeGe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8jr3MACgkQForvXbEpPzTqVACeOGmROL7VidxYFlFhvtOx1qVI /3YAmwbVq4VZCZcWdLAbdf18L0M1WVkl =tTOD -----END PGP SIGNATURE----- --5QAgd0e35j3NYeGe-- From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 08:23:40 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99115106566B; Sat, 28 Jan 2012 08:23:40 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail04.syd.optusnet.com.au (mail04.syd.optusnet.com.au [211.29.132.185]) by mx1.freebsd.org (Postfix) with ESMTP id 353138FC0A; Sat, 28 Jan 2012 08:23:39 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail04.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0S8NYnO005126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Jan 2012 19:23:37 +1100 Date: Sat, 28 Jan 2012 19:23:34 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marius Strobl In-Reply-To: <201201272204.q0RM4hRH062478@svn.freebsd.org> Message-ID: <20120128184815.L1114@besplex.bde.org> References: <201201272204.q0RM4hRH062478@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230628 - head/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 08:23:40 -0000 On Fri, 27 Jan 2012, Marius Strobl wrote: > Log: > Mark cpu_{halt,reset}() as __dead2 as appropriate. > > Modified: > head/sys/sparc64/include/cpu.h > > Modified: head/sys/sparc64/include/cpu.h > ============================================================================== > --- head/sys/sparc64/include/cpu.h Fri Jan 27 21:52:59 2012 (r230627) > +++ head/sys/sparc64/include/cpu.h Fri Jan 27 22:04:43 2012 (r230628) > @@ -53,8 +53,8 @@ extern char btext[]; > extern char etext[]; > > void cheetah_init(u_int cpu_impl); > -void cpu_halt(void); > -void cpu_reset(void); > +void cpu_halt(void) __dead2; > +void cpu_reset(void) __dead2; > void fork_trampoline(void); > void swi_vm(void *v); > void zeus_init(u_int cpu_impl); This reminds me that these functions and many others shouldn't be in since they necessarily have a MI interface (so that MI code can call them). A few interfaces in need to be there so that the can be inlines or macros, but most don't. Especially these 2. Since they are extremely non-time- critical and not likely to be magical, they can be implemented as a wrapper extern function even if the MD code prefers to use an in inline or macro. Duplicating these 2 in ${N_ARCH} cpu.h files mainly allows some of the files to forget to declare them as __dead2. I put these in and didn't forget __dead2 for them. systm.h already has prototypes for 11 functions named cpu_*. These are unsorted of course. It also has prototypes for a few functions that are misnamed (without a cpu_ as a prefix, or perhaps without cpu_ or cpu at all) so that they are naturally unsorted and hard to find. No MD declaration of these 2 in -current except the above has the __dead2's. IIRC, I noticed that __dead2 was missing for them from the style bug that code after calls to them has /* NOTREACHED */ comments (shutdown_halt() still does, except in my version). __dead2 should have made most of these comments go away 15-20 years ago. A more important "cpu_" function whose comments annoy me is cpu_throw(). This has always been declared in an MI file (, which shows that we can't expect all these functions to be declared in if they are MI). Calls to cpu_throw() have the unnecessary comments /* doesn't return */ in 2 places (lint won't understand these, so if you are going to comment on the obvious then it should be /* NOTREACHED */), and a bogus "teapot" panic and a /* NOTREACHED */ comment in another place. The panic is so bogus that gcc removes it (as allowed by cpu_throw() being declared __dead2). The first 2 places are sched_throw() in 2 schedulers. This can't return, but isn't declared as __dead2. The other place is thread_exit(). This is one of very few extern functions that is declared as __dead2. Bruce From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 08:41:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6289B106566B; Sat, 28 Jan 2012 08:41:09 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 139188FC16; Sat, 28 Jan 2012 08:41:08 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 1A9006D8; Sat, 28 Jan 2012 09:41:07 +0100 (CET) Date: Sat, 28 Jan 2012 09:39:54 +0100 From: Pawel Jakub Dawidek To: Kip Macy Message-ID: <20120128083954.GD2135@garage.freebsd.pl> References: <201201272018.q0RKIWUD055070@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4zI0WCX1RcnW9Hbu" Content-Disposition: inline In-Reply-To: <201201272018.q0RKIWUD055070@svn.freebsd.org> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230623 - in head/sys: amd64/amd64 cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 08:41:09 -0000 --4zI0WCX1RcnW9Hbu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 27, 2012 at 08:18:32PM +0000, Kip Macy wrote: > Author: kmacy > Date: Fri Jan 27 20:18:31 2012 > New Revision: 230623 > URL: http://svn.freebsd.org/changeset/base/230623 >=20 > Log: > exclude kmem_alloc'ed ARC data buffers from kernel minidumps on amd64 > excluding other allocations including UMA now entails the addition of > a single flag to kmem_alloc or uma zone create How do you handle the case when there are two small allocations within one page, where one has the NODUMP flag and one doesn't have the flag? As for GELI and opencrypto what I'd love to have is a flag that will prevent dumping the memory and that will clear memory on free. How hard would that be? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --4zI0WCX1RcnW9Hbu Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8jtFkACgkQForvXbEpPzTo1gCfSemtzJ3/iKDXw1m589xMkbdM 2zgAn2/DanxY/wS/0rufsu94kUYGhPCs =NiNR -----END PGP SIGNATURE----- --4zI0WCX1RcnW9Hbu-- From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 08:48:38 2012 Return-Path: Delivered-To: svn-src-all@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 053C31065670; Sat, 28 Jan 2012 08:48:38 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 7A9908FC08; Sat, 28 Jan 2012 08:48:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q0S8mYL6014217; Sat, 28 Jan 2012 12:48:35 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q0S8mYfM014216; Sat, 28 Jan 2012 12:48:34 +0400 (MSK) (envelope-from ache) Date: Sat, 28 Jan 2012 12:48:33 +0400 From: Andrey Chernov To: Bruce Evans Message-ID: <20120128084832.GA13860@vniz.net> Mail-Followup-To: Andrey Chernov , Bruce Evans , John Baldwin , Mark Murray , David Schultz , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <20120126143819.GA88677@vniz.net> <20120126155626.GA92229@vniz.net> <201201261132.38320.jhb@freebsd.org> <20120126165521.GA92622@vniz.net> <20120126175021.GA93016@vniz.net> <20120127201855.K1604@besplex.bde.org> <20120128043118.GA12241@vniz.net> <20120128045854.GA12556@vniz.net> <20120128180310.F1114@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120128180310.F1114@besplex.bde.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@FreeBSD.ORG, John Baldwin , svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG, David Schultz , Mark Murray Subject: Re: svn commit: r230230 - head/sys/dev/random X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 08:48:38 -0000 On Sat, Jan 28, 2012 at 06:47:50PM +1100, Bruce Evans wrote: > > --- sys/libkern.h.old 2012-01-16 07:15:12.000000000 +0400 > > +++ sys/libkern.h 2012-01-28 08:49:19.000000000 +0400 > > @@ -70,6 +70,11 @@ static __inline int abs(int a) { return > > static __inline long labs(long a) { return (a < 0 ? -a : a); } > > static __inline quad_t qabs(quad_t a) { return (a < 0 ? -a : a); } > > > > +#define ARC4_ENTR_NONE 0 /* Don't have entropy yet. */ > > +#define ARC4_ENTR_HAVE 1 /* Have entropy. */ > > +#define ARC4_ENTR_SEED 2 /* Reseeding. */ > > +extern int arc4rand_iniseed_state; > > + > > /* Prototypes for non-quad routines. */ > > struct malloc_type; > > uint32_t arc4random(void); > > ... I will also ask for data and macros to be sorted into the data an > macro sections and not unsorted in between the first set of inlines > and the prototypes. (Whether the macros should be all in a macro > section or near the variables or prototypes that they are for is > unclear, especially since the current organization for this in this > file is random.) > > This file was last nearly sorted in FreeBSD-2.1. Now its organization > is partly to put macros and data together with inline functions that > use them. This gives lots of subsections which are not clearly delimited > and is not used in the prototype section, where it would split up that > section too much. It is unclear for me what exact place(s) you suggest for those defines/extern now, keeping in mind that I don't want to reorganize old code at this moment, so the patch should be at the minimum level. > > About atomic ops: arc4rand calls are protected with mutex and yarrow > > calls are protected, but they can works concurrently wich each > > other. So, if we have atomic ops, why not to use them to close one time > > window too? > > Hmm, it's tricky code either way. I use similar cmpsets in sio, and > also need a loop to synchronize the final state change. But when the > state is seen to be final, atomic ops are not needed to check that it > doesn't change (or to see that it is final), since it won't change again. > This gives a tiny optimization that would be larger here. This is mostly I can try to eliminate after-done repeating of those cmpsets using plain static variables in yarrow and arc4rand, but this code should be run under mutex. For arc4rand at least it means that yet one cmpset (non-repeated, now under mutext) should be added. Is such complications worth something? Are cmpsets overkills or require heavy processor resources? -- http://ache.vniz.net/ From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 09:24:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD3A4106566B; Sat, 28 Jan 2012 09:24:58 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 29B538FC0C; Sat, 28 Jan 2012 09:24:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0S9OwJu081759; Sat, 28 Jan 2012 09:24:58 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0S9OwXA081757; Sat, 28 Jan 2012 09:24:58 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201201280924.q0S9OwXA081757@svn.freebsd.org> From: Alexander Motin Date: Sat, 28 Jan 2012 09:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230641 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 09:24:59 -0000 Author: mav Date: Sat Jan 28 09:24:57 2012 New Revision: 230641 URL: http://svn.freebsd.org/changeset/base/230641 Log: Fix HBR enabling condition. cchs is from 0 to 7, not from 1 to 8. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Sat Jan 28 02:52:22 2012 (r230640) +++ head/sys/dev/sound/pci/hda/hdaa.c Sat Jan 28 09:24:57 2012 (r230641) @@ -1564,7 +1564,7 @@ hdaa_audio_setup(struct hdaa_chan *ch) HDA_PARAM_PIN_CAP_HBR(wp->wclass.pin.cap)) { wp->wclass.pin.ctrl &= ~HDA_CMD_SET_PIN_WIDGET_CTRL_VREF_ENABLE_MASK; - if ((ch->fmt & AFMT_AC3) && (cchn == 8)) + if ((ch->fmt & AFMT_AC3) && (cchn == 7)) wp->wclass.pin.ctrl |= 0x03; hda_command(ch->devinfo->dev, HDA_CMD_SET_PIN_WIDGET_CTRL(0, nid, From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 10:31:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AA031065673; Sat, 28 Jan 2012 10:31:51 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id C6BDE8FC15; Sat, 28 Jan 2012 10:31:50 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id q0SAVcs7089950; Sat, 28 Jan 2012 19:31:41 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Sat, 28 Jan 2012 19:30:30 +0900 (JST) Message-Id: <20120128.193030.322386357550021613.nyan@FreeBSD.org> To: nwhitehorn@freebsd.org From: TAKAHASHI Yoshihiro In-Reply-To: <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> References: <201201231544.q0NFirMh032859@svn.freebsd.org> <20120123160340.GI95413@hoeg.nl> <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Sat_Jan_28_19_30_30_2012_524)--" Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 10:31:51 -0000 ----Next_Part(Sat_Jan_28_19_30_30_2012_524)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit In article <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> Nathan Whitehorn writes: > I think we didn't make PC98 release media for 9.0, but that's a good > point. I'm out of commission right now due to an injury, so patches > would be welcome. >> >>> TERM=xterm >> >> This code is also used on pc98, right? I think on pc98 we still need >> to >> use TERM=cons25w, to support Japanese character sets and keyboard >> input. How about the attached patch? --- TAKAHASHI Yoshihiro ----Next_Part(Sat_Jan_28_19_30_30_2012_524)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="a.diff" Index: rc.local =================================================================== RCS file: /home/ncvs/src/release/rc.local,v retrieving revision 1.6 diff -u -r1.6 rc.local --- rc.local 23 Jan 2012 16:17:54 -0000 1.6 +++ rc.local 28 Jan 2012 10:26:06 -0000 @@ -8,10 +8,16 @@ : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} +MACHINE=`uname -m` + kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then # Syscons: use xterm, start interesting things on other VTYs - TERM=xterm + if [ ${MACHINE} = "pc98" ]; then + TERM=cons25w + else + TERM=xterm + fi if [ -z "$EXTERNAL_VTY_STARTED" ]; then # Init will clean these processes up if/when the system @@ -30,6 +36,9 @@ echo "Common console types are:" echo " ansi Standard ANSI terminal" echo " vt100 VT100 or compatible terminal" + if [ ${MACHINE} = "pc98" ]; then + echo " cons25w cons25w terminal" + fi echo " xterm xterm terminal emulator (or compatible)" echo echo -n "Console type [vt100]: " ----Next_Part(Sat_Jan_28_19_30_30_2012_524)---- From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 11:56:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9E1BD1065673; Sat, 28 Jan 2012 11:56:59 +0000 (UTC) (envelope-from conrads@cox.net) Received: from eastrmfepi107.cox.net (eastrmfepi107.cox.net [68.230.241.203]) by mx1.freebsd.org (Postfix) with ESMTP id 2170D8FC0A; Sat, 28 Jan 2012 11:56:58 +0000 (UTC) Received: from eastrmimpo305.cox.net ([68.230.241.237]) by eastrmfepo103.cox.net (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP id <20120128112248.HYGN28068.eastrmfepo103.cox.net@eastrmimpo305.cox.net>; Sat, 28 Jan 2012 06:22:48 -0500 Received: from serene.no-ip.org ([98.164.86.55]) by eastrmimpo305.cox.net with bizsmtp id SzNZ1i0021BeFqy02zNgfP; Sat, 28 Jan 2012 06:22:48 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020207.4F23DA88.0067,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=1.1 cv=7YxdblQhh6tVU6ZVMrnfXyGefIif2LYgDHDYNRNiwDM= c=1 sm=1 a=a6QSoZInB1cA:10 a=G8Uczd0VNMoA:10 a=kj9zAlcOel0A:10 a=fdHYxQQoAueMHNSmXppgDg==:17 a=6I5d2MoRAAAA:8 a=kviXuzpPAAAA:8 a=_ZxKozGpK30YBu05IRwA:9 a=CjuIK1q_8ugA:10 a=SV7veod9ZcQA:10 a=4vB-4DCPJfMA:10 a=fdHYxQQoAueMHNSmXppgDg==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; none Received: from cox.net (localhost [127.0.0.1]) by serene.no-ip.org (8.14.5/8.14.5) with ESMTP id q0SBMRlt041381; Sat, 28 Jan 2012 05:22:28 -0600 (CST) (envelope-from conrads@cox.net) Date: Sat, 28 Jan 2012 05:22:21 -0600 From: "Conrad J. Sabatier" To: Alexander Motin Message-ID: <20120128052221.7656742b@cox.net> In-Reply-To: <201201261030.q0QAUoAR076629@svn.freebsd.org> References: <201201261030.q0QAUoAR076629@svn.freebsd.org> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd10.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230574 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 11:56:59 -0000 On Thu, 26 Jan 2012 10:30:50 +0000 (UTC) Alexander Motin wrote: > Author: mav > Date: Thu Jan 26 10:30:50 2012 > New Revision: 230574 > URL: http://svn.freebsd.org/changeset/base/230574 > > Log: > Fix typo in r230571. > > Submitted by: trasz > > Modified: > head/sys/dev/sound/pci/hda/hdacc.c > > Modified: head/sys/dev/sound/pci/hda/hdacc.c > ============================================================================== > --- head/sys/dev/sound/pci/hda/hdacc.c Thu Jan 26 09:56:29 > 2012 (r230573) +++ head/sys/dev/sound/pci/hda/hdacc.c > Thu Jan 26 10:30:50 2012 (r230574) @@ -330,7 +330,7 @@ static > const struct { { HDA_CODEC_CHXXXX, 0, "Chrontel" }, > { HDA_CODEC_IDTXXXX, 0, "IDT" }, > { HDA_CODEC_INTELXXXX, 0, "Intel" }, > - { HDA_CODEC_MOTOXXXX, 0, "Motorolla" }, > + { HDA_CODEC_MOTOXXXX, 0, "Motorola" }, > { HDA_CODEC_NVIDIAXXXX, 0, "NVIDIA" }, > { HDA_CODEC_SIIXXXX, 0, "Silicon Image" }, > { HDA_CODEC_STACXXXX, 0, "Sigmatel" }, The misspelling "Motorolla" also appears in /sys/dev/sound/pci/hda/hdac.h -- Conrad J. Sabatier conrads@cox.net From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 12:36:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3BE4D1065675; Sat, 28 Jan 2012 12:36:12 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE4A8FC13; Sat, 28 Jan 2012 12:36:10 +0000 (UTC) Received: by eekb47 with SMTP id b47so992691eek.13 for ; Sat, 28 Jan 2012 04:36:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=ncg86tvVFiFU/MnyvAgj9LBTwq1HzLtFyJ7QtRJVCKI=; b=d/kAFNTAqc0IjblrAg0pmzkKi0eiE85pSVASePFk/pdu1v9vb6ZzcVVcOINbIukkcq hB/b1+k/+qELOzCOEPNfS2pFmEZF3LfhwnhXmeWP4Fq6tpNC4o/+Ii1DVDsPQgb/U6DD c4Hj+Rlle/XVTNXbBXVVtftBmj4ZhjE/yNNwQ= Received: by 10.14.8.210 with SMTP id 58mr1678038eer.94.1327754169869; Sat, 28 Jan 2012 04:36:09 -0800 (PST) Received: from [192.168.0.101] ([95.232.4.130]) by mx.google.com with ESMTPS id e12sm43076499eea.5.2012.01.28.04.36.06 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 28 Jan 2012 04:36:07 -0800 (PST) References: <201201272018.q0RKIWUD055070@svn.freebsd.org> <20120128083954.GD2135@garage.freebsd.pl> In-Reply-To: <20120128083954.GD2135@garage.freebsd.pl> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Message-Id: <6A52DB46-4897-4D35-B727-2C3D3D01CE9C@gmail.com> X-Mailer: iPad Mail (9A405) From: K Macy Date: Sat, 28 Jan 2012 13:36:05 +0100 To: Pawel Jakub Dawidek Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Kip Macy Subject: Re: svn commit: r230623 - in head/sys: amd64/amd64 cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 12:36:12 -0000 Il giorno 28/gen/2012, alle ore 09:39, Pawel Jakub Dawidek = ha scritto: > On Fri, Jan 27, 2012 at 08:18:32PM +0000, Kip Macy wrote: >> Author: kmacy >> Date: Fri Jan 27 20:18:31 2012 >> New Revision: 230623 >> URL: http://svn.freebsd.org/changeset/base/230623 >>=20 >> Log: >> exclude kmem_alloc'ed ARC data buffers from kernel minidumps on amd64 >> excluding other allocations including UMA now entails the addition of >> a single flag to kmem_alloc or uma zone create >=20 > How do you handle the case when there are two small allocations within > one page, where one has the NODUMP flag and one doesn't have the flag? Kmem_alloc and zone creation both work at granularities greater than or equa= l to a page. The per-page management of dump is why this flag is not availab= le to generic malloc. >=20 > As for GELI and opencrypto what I'd love to have is a flag that will > prevent dumping the memory and that will clear memory on free. How hard > would that be? >=20 I'll look into it. Off-hand I think it would be easy enough. Cheers,=20 Kip > --=20 > Pawel Jakub Dawidek http://www.wheelsystems.com > FreeBSD committer http://www.FreeBSD.org > Am I Evil? Yes, I Am! http://tupytaj.pl From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 12:37:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D1D9F1065672; Sat, 28 Jan 2012 12:37:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3E48FC18; Sat, 28 Jan 2012 12:37:54 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q0SCbmWQ015177 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 28 Jan 2012 14:37:49 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q0SCbmYD069884; Sat, 28 Jan 2012 14:37:48 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q0SCbmcm069883; Sat, 28 Jan 2012 14:37:48 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 28 Jan 2012 14:37:48 +0200 From: Kostik Belousov To: Bruce Evans , Gleb Smirnoff , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Message-ID: <20120128123748.GD2726@deviant.kiev.zoral.com.ua> References: <201201261159.q0QBxma2086162@svn.freebsd.org> <20120126233110.C960@besplex.bde.org> <20120126153641.GA68112@FreeBSD.org> <20120127194612.H1547@besplex.bde.org> <20120127091244.GZ2726@deviant.kiev.zoral.com.ua> <20120127194221.GA25723@zim.MIT.EDU> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WG0/bXtUnGTsWt66" Content-Disposition: inline In-Reply-To: <20120127194221.GA25723@zim.MIT.EDU> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r230583 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 12:37:56 -0000 --WG0/bXtUnGTsWt66 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 27, 2012 at 02:42:21PM -0500, David Schultz wrote: > On Fri, Jan 27, 2012, Kostik Belousov wrote: > > On Fri, Jan 27, 2012 at 07:50:30PM +1100, Bruce Evans wrote: > > > On Thu, 26 Jan 2012, Gleb Smirnoff wrote: > > >=20 > > > >On Thu, Jan 26, 2012 at 11:53:57PM +1100, Bruce Evans wrote: > > > >B> > @@ -1552,6 +1552,12 @@ aio_aqueue(struct thread *td, struct aio > > > >B> > return (error); > > > >B> > } > > > >B> > > > > >B> > + /* XXX: aio_nbytes is later casted to signed types. */ > > > >B> > + if ((int)aiocbe->uaiocb.aio_nbytes < 0) { > > > >B> > > > >B> This should avoid implementation-defined behaviour by checking if > > > >B> > > > >B> (uncast)aiocbe->uaiocb.aio_nbytes > INT_MAX. > > >=20 > > > >Is the attached patch okay? > > >=20 > > > Yes. It now matches the style used for read^Wsys_read() and friends. > > > This used to have to fit the count in "int uio_resid". uio_resid now > > > has type ssize_t, but for some reason the old INT_MAX limits remain. > >=20 > > Well, I can revive the patch. I still think it is good to get rid of > > the limit. >=20 > The correct limit on the maximum size of a single read/write is > SSIZE_MAX, but FreeBSD uses INT_MAX. It's not safe to raise the > limit yet, though, because of bugs in several filesystems. For > example, FFS copies uio_resid into a local variable of type int. > I have some old patches that fix some of these issues for FFS and > cd9660, but surely there are more places I didn't notice. >=20 Absolutely agree. http://people.freebsd.org/~kib/misc/uio_resid.5.patch > By the way, PR 147226 is about this. --WG0/bXtUnGTsWt66 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk8j7BwACgkQC3+MBN1Mb4gMhwCdGlXt/sCwdu41akDwe8BE0UNZ nD4AoOsD1S7HrVjHmYj7j41/iA6rJ3fv =aI3x -----END PGP SIGNATURE----- --WG0/bXtUnGTsWt66-- From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 13:41:35 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 054BA106564A; Sat, 28 Jan 2012 13:41:35 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8C488FC16; Sat, 28 Jan 2012 13:41:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SDfYlI088574; Sat, 28 Jan 2012 13:41:34 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SDfYeF088572; Sat, 28 Jan 2012 13:41:34 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201201281341.q0SDfYeF088572@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 28 Jan 2012 13:41:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230642 - head/sbin/mount_ntfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 13:41:35 -0000 Author: jh Date: Sat Jan 28 13:41:34 2012 New Revision: 230642 URL: http://svn.freebsd.org/changeset/base/230642 Log: Remove trailing whitespace. Modified: head/sbin/mount_ntfs/mount_ntfs.c Modified: head/sbin/mount_ntfs/mount_ntfs.c ============================================================================== --- head/sbin/mount_ntfs/mount_ntfs.c Sat Jan 28 09:24:57 2012 (r230641) +++ head/sbin/mount_ntfs/mount_ntfs.c Sat Jan 28 13:41:34 2012 (r230642) @@ -160,7 +160,7 @@ main(int argc, char *argv[]) } /* - * Resolve the mountpoint with realpath(3) and remove unnecessary + * Resolve the mountpoint with realpath(3) and remove unnecessary * slashes from the devicename if there are any. */ if (checkpath(dir, mntpath) != 0) From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 13:56:25 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3699106564A; Sat, 28 Jan 2012 13:56:25 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 7702F8FC0C; Sat, 28 Jan 2012 13:56:25 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 64B437B2; Sat, 28 Jan 2012 14:56:23 +0100 (CET) Date: Sat, 28 Jan 2012 14:55:10 +0100 From: Pawel Jakub Dawidek To: K Macy Message-ID: <20120128135509.GE2135@garage.freebsd.pl> References: <201201272018.q0RKIWUD055070@svn.freebsd.org> <20120128083954.GD2135@garage.freebsd.pl> <6A52DB46-4897-4D35-B727-2C3D3D01CE9C@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HeFlAV5LIbMFYYuh" Content-Disposition: inline In-Reply-To: <6A52DB46-4897-4D35-B727-2C3D3D01CE9C@gmail.com> X-OS: FreeBSD 9.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Kip Macy Subject: Re: svn commit: r230623 - in head/sys: amd64/amd64 cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 13:56:25 -0000 --HeFlAV5LIbMFYYuh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 28, 2012 at 01:36:05PM +0100, K Macy wrote: > Il giorno 28/gen/2012, alle ore 09:39, Pawel Jakub Dawidek ha scritto: > > How do you handle the case when there are two small allocations within > > one page, where one has the NODUMP flag and one doesn't have the flag? >=20 > Kmem_alloc and zone creation both work at granularities greater than or e= qual to a page. The per-page management of dump is why this flag is not ava= ilable to generic malloc. Hmm, kmem_alloc() in ZFS code is just a wrapper around generic malloc(9). You only added NODUMP flag for zio_data_buf_alloc(), but I think you can pass sizes smaller than eg. 4kB to that function (starting =66rom SPA_MINBLOCKSIZE, which is 512 bytes). How can you tell some other ZFS code that uses kmem_alloc() won't share the same page as small ZIO buffer? I'd like to use that flag with GELI with generic malloc(9). How can I do that? Maybe defining this property at MALLOC_DEFINE() time for the entire malloc type would be better? I could then use two separate malloc types in GELI: one for sensitive data and one for other data. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --HeFlAV5LIbMFYYuh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8j/j0ACgkQForvXbEpPzTDcACgrvJVC1UPYmM6u8s2QcdvZYwC WdAAoO1ib2hxKCBP94nWU+8x+TzPYZrt =Aw97 -----END PGP SIGNATURE----- --HeFlAV5LIbMFYYuh-- From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 14:00:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 86992106564A; Sat, 28 Jan 2012 14:00:21 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6FE858FC0A; Sat, 28 Jan 2012 14:00:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SE0LY9088995; Sat, 28 Jan 2012 14:00:21 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SE0LdE088986; Sat, 28 Jan 2012 14:00:21 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201201281400.q0SE0LdE088986@svn.freebsd.org> From: Attilio Rao Date: Sat, 28 Jan 2012 14:00:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230643 - in head/sys: dev/usb geom geom/mountver kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 14:00:21 -0000 Author: attilio Date: Sat Jan 28 14:00:21 2012 New Revision: 230643 URL: http://svn.freebsd.org/changeset/base/230643 Log: Avoid to check the same cache line/variable from all the locking primitives by breaking stop_scheduler into a per-thread variable. Also, store the new td_stopsched very close to td_*locks members as they will be accessed mostly in the same codepaths as td_stopsched and this results in avoiding a further cache-line pollution, possibly. STOP_SCHEDULER() was pondered to use a new 'thread' argument, in order to take advantage of already cached curthread, but in the end there should not really be a performance benefit, while introducing a KPI breakage. In collabouration with: flo Reviewed by: avg MFC after: 3 months (or never) X-MFC: r228424 Modified: head/sys/dev/usb/usb_transfer.c head/sys/geom/geom_bsd.c head/sys/geom/geom_mbr.c head/sys/geom/geom_pc98.c head/sys/geom/mountver/g_mountver.c head/sys/kern/kern_shutdown.c head/sys/sys/proc.h head/sys/sys/systm.h Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Sat Jan 28 13:41:34 2012 (r230642) +++ head/sys/dev/usb/usb_transfer.c Sat Jan 28 14:00:21 2012 (r230643) @@ -42,6 +42,7 @@ #include #include #include +#include #include #include Modified: head/sys/geom/geom_bsd.c ============================================================================== --- head/sys/geom/geom_bsd.c Sat Jan 28 13:41:34 2012 (r230642) +++ head/sys/geom/geom_bsd.c Sat Jan 28 14:00:21 2012 (r230643) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/geom/geom_mbr.c ============================================================================== --- head/sys/geom/geom_mbr.c Sat Jan 28 13:41:34 2012 (r230642) +++ head/sys/geom/geom_mbr.c Sat Jan 28 14:00:21 2012 (r230643) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/geom/geom_pc98.c ============================================================================== --- head/sys/geom/geom_pc98.c Sat Jan 28 13:41:34 2012 (r230642) +++ head/sys/geom/geom_pc98.c Sat Jan 28 14:00:21 2012 (r230643) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Sat Jan 28 13:41:34 2012 (r230642) +++ head/sys/geom/mountver/g_mountver.c Sat Jan 28 14:00:21 2012 (r230643) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat Jan 28 13:41:34 2012 (r230642) +++ head/sys/kern/kern_shutdown.c Sat Jan 28 14:00:21 2012 (r230643) @@ -145,7 +145,6 @@ SYSCTL_INT(_kern_shutdown, OID_AUTO, sho */ const char *panicstr; -int stop_scheduler; /* system stopped CPUs for panic */ int dumping; /* system is dumping */ int rebooting; /* system is rebooting */ static struct dumperinfo dumper; /* our selected dumper */ @@ -597,7 +596,7 @@ panic(const char *fmt, ...) * stop_scheduler_on_panic is true, then stop_scheduler will * always be set. Even if panic has been entered from kdb. */ - stop_scheduler = 1; + td->td_stopsched = 1; } #endif Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Jan 28 13:41:34 2012 (r230642) +++ head/sys/sys/proc.h Sat Jan 28 14:00:21 2012 (r230643) @@ -235,6 +235,7 @@ struct thread { short td_locks; /* (k) Count of non-spin locks. */ short td_rw_rlocks; /* (k) Count of rwlock read locks. */ short td_lk_slocks; /* (k) Count of lockmgr shared locks. */ + short td_stopsched; /* (k) Scheduler stopped. */ struct turnstile *td_blocked; /* (t) Lock thread is blocked on. */ const char *td_lockname; /* (t) Name of lock blocked on. */ LIST_HEAD(, turnstile) td_contested; /* (q) Contested locks. */ Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Sat Jan 28 13:41:34 2012 (r230642) +++ head/sys/sys/systm.h Sat Jan 28 14:00:21 2012 (r230643) @@ -47,7 +47,6 @@ extern int cold; /* nonzero if we are doing a cold boot */ extern int rebooting; /* kern_reboot() has been called. */ -extern int stop_scheduler; /* only one thread runs after panic */ extern const char *panicstr; /* panic message */ extern char version[]; /* system version */ extern char copyright[]; /* system copyright */ @@ -113,7 +112,7 @@ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUES * Otherwise, the kernel will deadlock since the scheduler isn't * going to run the thread that holds any lock we need. */ -#define SCHEDULER_STOPPED() __predict_false(stop_scheduler) +#define SCHEDULER_STOPPED() __predict_false(curthread->td_stopsched) /* * XXX the hints declarations are even more misplaced than most declarations From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 15:29:44 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 280081065672; Sat, 28 Jan 2012 15:29:44 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 13D318FC15; Sat, 28 Jan 2012 15:29:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SFThr2090803; Sat, 28 Jan 2012 15:29:43 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SFThNk090801; Sat, 28 Jan 2012 15:29:43 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201201281529.q0SFThNk090801@svn.freebsd.org> From: Maxim Konovalov Date: Sat, 28 Jan 2012 15:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230644 - head/games/pom X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 15:29:44 -0000 Author: maxim Date: Sat Jan 28 15:29:43 2012 New Revision: 230644 URL: http://svn.freebsd.org/changeset/base/230644 Log: o Preserve argv[0] to use it later in usage(). PR: bin/164570 Submitted by: Klaus Aehlig MFC after: 1 week Modified: head/games/pom/pom.c Modified: head/games/pom/pom.c ============================================================================== --- head/games/pom/pom.c Sat Jan 28 14:00:21 2012 (r230643) +++ head/games/pom/pom.c Sat Jan 28 15:29:43 2012 (r230644) @@ -86,6 +86,7 @@ main(int argc, char **argv) double days, today, tomorrow; int ch, cnt, pflag = 0; char *odate = NULL, *otime = NULL; + char *progname = argv[0]; while ((ch = getopt(argc, argv, "d:pt:")) != -1) switch (ch) { @@ -99,14 +100,14 @@ main(int argc, char **argv) otime = optarg; break; default: - usage(argv[0]); + usage(progname); } argc -= optind; argv += optind; if (argc) - usage(argv[0]); + usage(progname); /* Adjust based on users preferences */ time(&tt); From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 17:21:12 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BAA4106564A; Sat, 28 Jan 2012 17:21:12 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66EE28FC0A; Sat, 28 Jan 2012 17:21:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SHLCd6093153; Sat, 28 Jan 2012 17:21:12 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SHLC1v093151; Sat, 28 Jan 2012 17:21:12 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201201281721.q0SHLC1v093151@svn.freebsd.org> From: Kip Macy Date: Sat, 28 Jan 2012 17:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230645 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 17:21:12 -0000 Author: kmacy Date: Sat Jan 28 17:21:12 2012 New Revision: 230645 URL: http://svn.freebsd.org/changeset/base/230645 Log: document M_NODUMP flag Modified: head/share/man/man9/malloc.9 Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Sat Jan 28 15:29:43 2012 (r230644) +++ head/share/man/man9/malloc.9 Sat Jan 28 17:21:12 2012 (r230645) @@ -123,6 +123,9 @@ operational characteristics as follows: .Bl -tag -width indent .It Dv M_ZERO Causes the allocated memory to be set to all zeros. +.It Dv M_NODUMP +For allocations greater than page size, causes the allocated +memory to be excluded from kernel core dumps. .It Dv M_NOWAIT Causes .Fn malloc , From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 17:24:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EACBD106564A; Sat, 28 Jan 2012 17:24:02 +0000 (UTC) (envelope-from kmacybsd@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 774578FC15; Sat, 28 Jan 2012 17:24:02 +0000 (UTC) Received: by pbcc13 with SMTP id c13so3061429pbc.13 for ; Sat, 28 Jan 2012 09:24:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oMzzpDT+T/wcgaZaIAMe06ehnUUHu06O3efs5gOjBMw=; b=rLwXimBuV0fVPtdw0i9sdGqJRMqMegBLKU8yw5tiEpaTxEPFXThwA+hY1NC41DDU2n Y0RfmQFcsOoqzh/MHEJvQxPNP8XLcbVy+WaAJX2rpcJi1zsQWO/+/HxrkhSwZpxAi8LT qx9cLjkN7+ug/SZKZSxZkZTPQhTEP959eWgQk= MIME-Version: 1.0 Received: by 10.68.116.144 with SMTP id jw16mr24979893pbb.28.1327771442272; Sat, 28 Jan 2012 09:24:02 -0800 (PST) Sender: kmacybsd@gmail.com Received: by 10.68.33.228 with HTTP; Sat, 28 Jan 2012 09:24:02 -0800 (PST) In-Reply-To: <20120128083954.GD2135@garage.freebsd.pl> References: <201201272018.q0RKIWUD055070@svn.freebsd.org> <20120128083954.GD2135@garage.freebsd.pl> Date: Sat, 28 Jan 2012 18:24:02 +0100 X-Google-Sender-Auth: 9Ou6QvKD74Fg-XdveBzfEvf4aAA Message-ID: From: "K. Macy" To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230623 - in head/sys: amd64/amd64 cddl/compat/opensolaris/sys cddl/contrib/opensolaris/uts/common/fs/zfs sys vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 17:24:03 -0000 On Sat, Jan 28, 2012 at 9:39 AM, Pawel Jakub Dawidek wrot= e: > On Fri, Jan 27, 2012 at 08:18:32PM +0000, Kip Macy wrote: >> Author: kmacy >> Date: Fri Jan 27 20:18:31 2012 >> New Revision: 230623 >> URL: http://svn.freebsd.org/changeset/base/230623 >> >> Log: >> =A0 exclude kmem_alloc'ed ARC data buffers from kernel minidumps on amd6= 4 >> =A0 excluding other allocations including UMA now entails the addition o= f >> =A0 a single flag to kmem_alloc or uma zone create > Done for malloc.9, zone.9 doesn't document any of uma's flags and I'm not sufficiently well versed in nroff to add them with messing up the existing formatting. From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 17:27:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECC4A1065673; Sat, 28 Jan 2012 17:27:58 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7CCD8FC14; Sat, 28 Jan 2012 17:27:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SHRwuL093321; Sat, 28 Jan 2012 17:27:58 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SHRww7093319; Sat, 28 Jan 2012 17:27:58 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201201281727.q0SHRww7093319@svn.freebsd.org> From: Kip Macy Date: Sat, 28 Jan 2012 17:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230646 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 17:27:59 -0000 Author: kmacy Date: Sat Jan 28 17:27:58 2012 New Revision: 230646 URL: http://svn.freebsd.org/changeset/base/230646 Log: alphabetically sort optional flags and add documentation for VM_ALLOC_NODUMP Modified: head/share/man/man9/vm_page_alloc.9 Modified: head/share/man/man9/vm_page_alloc.9 ============================================================================== --- head/share/man/man9/vm_page_alloc.9 Sat Jan 28 17:21:12 2012 (r230645) +++ head/share/man/man9/vm_page_alloc.9 Sat Jan 28 17:27:58 2012 (r230646) @@ -90,23 +90,18 @@ than zero. .Pp The optional flags are: .Bl -tag -width ".Dv VM_ALLOC_IFNOTCACHED" -.It Dv VM_ALLOC_ZERO -Indicate a preference for a pre-zeroed page. -There is no guarantee that the returned page will be zeroed, but it -will have the -.Dv PG_ZERO -flag set if it is zeroed. +.It Dv VM_ALLOC_NOBUSY +The returned page will not have the +.Dv VPO_BUSY +flag set. +.It Dv VM_ALLOC_NODUMP +The returned page will not be included in any kernel core dumps +regardless of whether or not it is mapped in to KVA. .It Dv VM_ALLOC_NOOBJ Do not associate the allocated page with a vm object. The .Fa object argument is ignored. -.It Dv VM_ALLOC_NOBUSY -The returned page will not have the -.Dv VPO_BUSY -flag set. -.It Dv VM_ALLOC_WIRED -The returned page will be wired. .It Dv VM_ALLOC_IFCACHED Allocate the page only if it is cached. Otherwise, return @@ -117,6 +112,14 @@ Only allocate the page if it is not cach If the page at the specified .Fa pindex is cached, NULL is returned instead. +.It Dv VM_ALLOC_WIRED +The returned page will be wired. +.It Dv VM_ALLOC_ZERO +Indicate a preference for a pre-zeroed page. +There is no guarantee that the returned page will be zeroed, but it +will have the +.Dv PG_ZERO +flag set if it is zeroed. .El .El .Sh RETURN VALUES From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 17:41:42 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 862DC1065670; Sat, 28 Jan 2012 17:41:42 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 701388FC08; Sat, 28 Jan 2012 17:41:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SHfgZA093613; Sat, 28 Jan 2012 17:41:42 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SHfg9X093611; Sat, 28 Jan 2012 17:41:42 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201201281741.q0SHfg9X093611@svn.freebsd.org> From: Kip Macy Date: Sat, 28 Jan 2012 17:41:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230647 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 17:41:42 -0000 Author: kmacy Date: Sat Jan 28 17:41:42 2012 New Revision: 230647 URL: http://svn.freebsd.org/changeset/base/230647 Log: add tunable for developers working on areas outside of ZFS to further reduce core size by excluding ARC metadata buffers from core dumps Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Jan 28 17:27:58 2012 (r230646) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Jan 28 17:41:42 2012 (r230647) @@ -42,6 +42,10 @@ static int zio_use_uma = 0; TUNABLE_INT("vfs.zfs.zio.use_uma", &zio_use_uma); SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, use_uma, CTLFLAG_RDTUN, &zio_use_uma, 0, "Use uma(9) for ZIO allocations"); +static int zio_exclude_metadata = 0; +TUNABLE_INT("vfs.zfs.zio.exclude_metadata", &zio_exclude_metadata); +SYSCTL_INT(_vfs_zfs_zio, OID_AUTO, exclude_metadata, CTLFLAG_RDTUN, &zio_exclude_metadata, 0, + "Exclude metadata buffers from dumps as well"); /* * ========================================================================== @@ -217,13 +221,14 @@ void * zio_buf_alloc(size_t size) { size_t c = (size - 1) >> SPA_MINBLOCKSHIFT; + int flags = zio_exclude_metadata ? KM_NODEBUG : 0; ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); if (zio_use_uma) return (kmem_cache_alloc(zio_buf_cache[c], KM_PUSHPAGE)); else - return (kmem_alloc(size, KM_SLEEP)); + return (kmem_alloc(size, KM_SLEEP|flags)); } /* From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 18:35:11 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4398E106566B; Sat, 28 Jan 2012 18:35:11 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F2878FC0C; Sat, 28 Jan 2012 18:35:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SIZBg7094800; Sat, 28 Jan 2012 18:35:11 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SIZAD3094798; Sat, 28 Jan 2012 18:35:10 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201201281835.q0SIZAD3094798@svn.freebsd.org> From: Tijl Coosemans Date: Sat, 28 Jan 2012 18:35:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230648 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 18:35:11 -0000 Author: tijl Date: Sat Jan 28 18:35:10 2012 New Revision: 230648 URL: http://svn.freebsd.org/changeset/base/230648 Log: Move descriptions of file caching commands out of the file locking section. Approved by: kib (mentor) Modified: head/lib/libc/sys/fcntl.2 Modified: head/lib/libc/sys/fcntl.2 ============================================================================== --- head/lib/libc/sys/fcntl.2 Sat Jan 28 17:41:42 2012 (r230647) +++ head/lib/libc/sys/fcntl.2 Sat Jan 28 18:35:10 2012 (r230648) @@ -28,7 +28,7 @@ .\" @(#)fcntl.2 8.2 (Berkeley) 1/12/94 .\" $FreeBSD$ .\" -.Dd September 28, 2009 +.Dd January 28, 2012 .Dt FCNTL 2 .Os .Sh NAME @@ -143,6 +143,22 @@ process groups are specified by supplyin as negative, otherwise .Fa arg is interpreted as a process ID. +.It Dv F_READAHEAD +Set or clear the read ahead amount for sequential access to the third +argument, +.Fa arg , +which is rounded up to the nearest block size. +A zero value in +.Fa arg +turns off read ahead. +.It Dv F_RDAHEAD +Equivalent to Darwin counterpart which sets read ahead amount of 128KB +when the third argument, +.Fa arg +is non-zero. +A zero value in +.Fa arg +turns off read ahead. .El .Pp The flags for the @@ -241,22 +257,6 @@ will be interrupted if the signal handle .Dv SA_RESTART (see .Xr sigaction 2 ) . -.It Dv F_READAHEAD -Set or clear the read ahead amount for sequential access to the third -argument, -.Fa arg , -which is rounded up to the nearest block size. -A zero value in -.Fa arg -turns off read ahead. -.It Dv F_RDAHEAD -Equivalent to Darwin counterpart which sets read ahead amount of 128KB -when the third argument, -.Fa arg -is non-zero. -A zero value in -.Fa arg -turns off read ahead. .El .Pp When a shared lock has been set on a segment of a file, From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 18:49:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A53C6106564A; Sat, 28 Jan 2012 18:49:04 +0000 (UTC) (envelope-from tijl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 903BF8FC12; Sat, 28 Jan 2012 18:49:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SIn4uj095110; Sat, 28 Jan 2012 18:49:04 GMT (envelope-from tijl@svn.freebsd.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SIn4qv095108; Sat, 28 Jan 2012 18:49:04 GMT (envelope-from tijl@svn.freebsd.org) Message-Id: <201201281849.q0SIn4qv095108@svn.freebsd.org> From: Tijl Coosemans Date: Sat, 28 Jan 2012 18:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230649 - head/usr.bin/hexdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 18:49:04 -0000 Author: tijl Date: Sat Jan 28 18:49:04 2012 New Revision: 230649 URL: http://svn.freebsd.org/changeset/base/230649 Log: Fix decoding of escape sequences in format strings: - Zero-terminate the resulting string by letting the for-loop copy the terminating zero. - Exit the for-loop after handling a backslash at the end of the format string to fix a buffer overrun. - Remove some unnecessary comments and blank lines. [1] Requested by: bde [1] PR: bin/144722 Approved by: kib (mentor) Modified: head/usr.bin/hexdump/parse.c Modified: head/usr.bin/hexdump/parse.c ============================================================================== --- head/usr.bin/hexdump/parse.c Sat Jan 28 18:35:10 2012 (r230648) +++ head/usr.bin/hexdump/parse.c Sat Jan 28 18:49:04 2012 (r230649) @@ -451,21 +451,14 @@ escape(char *p1) char *p2; /* alphabetic escape sequences have to be done in place */ - for (p2 = p1; *p1; p1++, p2++) { - /* - * Let's take a peak at the next item and see whether or not - * we need to escape the value... - */ + for (p2 = p1;; p1++, p2++) { if (*p1 == '\\') { - p1++; - switch(*p1) { - /* A standalone `\' */ case '\0': *p2 = '\\'; *++p2 = '\0'; - break; + return; case 'a': /* *p2 = '\a'; */ *p2 = '\007'; @@ -492,12 +485,12 @@ escape(char *p1) *p2 = *p1; break; } - - } else + } else { *p2 = *p1; - + if (*p1 == '\0') + return; + } } - } void From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 19:22:50 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B2FA106567F; Sat, 28 Jan 2012 19:22:50 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m020-f182.google.com (mail-lpp01m020-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 783B88FC1C; Sat, 28 Jan 2012 19:22:49 +0000 (UTC) Received: by lbao2 with SMTP id o2so222052lba.13 for ; Sat, 28 Jan 2012 11:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=enC9GEBD4Znv8Ys9cHXExrcAWuY0v2HUw1C2y1l3zFA=; b=s94UWZNIcnEmjasG0CQ+XcAFzKF1ulVgcFuloqUuL0eCvWeLK0RPJMlAqXAgNCvHWO 1RmGPCWqz3HMMIzIzmPVcwPxlHmpDSfwjWPhrfSC/5UMoZCP9z25vVeSzcLn8feBwebl XL2yaATJLD25AmFKcuFaHKV/jgm6t6l1cbfB8= Received: by 10.112.103.8 with SMTP id fs8mr2710967lbb.39.1327778568177; Sat, 28 Jan 2012 11:22:48 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.112.101.66 with HTTP; Sat, 28 Jan 2012 11:22:18 -0800 (PST) In-Reply-To: <201201281849.q0SIn4qv095108@svn.freebsd.org> References: <201201281849.q0SIn4qv095108@svn.freebsd.org> From: Eitan Adler Date: Sat, 28 Jan 2012 14:22:18 -0500 X-Google-Sender-Auth: hSAp-migSBTDmpc-fFZ6a-nOYOg Message-ID: To: Tijl Coosemans Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230649 - head/usr.bin/hexdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 19:22:50 -0000 On Sat, Jan 28, 2012 at 1:49 PM, Tijl Coosemans wrote: > Author: tijl > Date: Sat Jan 28 18:49:04 2012 > New Revision: 230649 > URL: http://svn.freebsd.org/changeset/base/230649 > > Log: > =C2=A0Fix decoding of escape sequences in format strings: > =C2=A0- Zero-terminate the resulting string by letting the for-loop copy = the > =C2=A0 =C2=A0terminating zero. > =C2=A0- Exit the for-loop after handling a backslash at the end of the fo= rmat > =C2=A0 =C2=A0string to fix a buffer overrun. > =C2=A0- Remove some unnecessary comments and blank lines. [1] > > =C2=A0Requested by: bde [1] > =C2=A0PR: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 bin/144722 > =C2=A0Approved by: =C2=A0kib (mentor) Thanks! --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 19:32:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F71A106564A; Sat, 28 Jan 2012 19:32:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EDE6B8FC0C; Sat, 28 Jan 2012 19:32:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SJWSv5096131; Sat, 28 Jan 2012 19:32:28 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SJWSoj096129; Sat, 28 Jan 2012 19:32:28 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201281932.q0SJWSoj096129@svn.freebsd.org> From: Eitan Adler Date: Sat, 28 Jan 2012 19:32:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230650 - stable/9/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 19:32:29 -0000 Author: eadler Date: Sat Jan 28 19:32:28 2012 New Revision: 230650 URL: http://svn.freebsd.org/changeset/base/230650 Log: MFC r230109: - Document TheDraw splash screens in the default loader.conf Approved by: cperciva Modified: stable/9/sys/boot/forth/loader.conf Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/forth/loader.conf ============================================================================== --- stable/9/sys/boot/forth/loader.conf Sat Jan 28 18:49:04 2012 (r230649) +++ stable/9/sys/boot/forth/loader.conf Sat Jan 28 19:32:28 2012 (r230650) @@ -31,9 +31,10 @@ verbose_loading="NO" # Set to YES for v splash_bmp_load="NO" # Set this to YES for bmp splash screen! splash_pcx_load="NO" # Set this to YES for pcx splash screen! +splash_txt_load="NO" # Set this to YES for TheDraw splash screen! vesa_load="NO" # Set this to YES to load the vesa module bitmap_load="NO" # Set this to YES if you want splash screen! -bitmap_name="splash.bmp" # Set this to the name of the bmp or pcx file +bitmap_name="splash.bmp" # Set this to the name of the file bitmap_type="splash_image_data" # and place it on the module_path From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 19:33:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E920106567A; Sat, 28 Jan 2012 19:33:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 396928FC1B; Sat, 28 Jan 2012 19:33:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SJX2on096190; Sat, 28 Jan 2012 19:33:02 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SJX2qC096188; Sat, 28 Jan 2012 19:33:02 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201281933.q0SJX2qC096188@svn.freebsd.org> From: Eitan Adler Date: Sat, 28 Jan 2012 19:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230651 - stable/8/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 19:33:03 -0000 Author: eadler Date: Sat Jan 28 19:33:02 2012 New Revision: 230651 URL: http://svn.freebsd.org/changeset/base/230651 Log: MFC r230109: - Document TheDraw splash screens in the default loader.conf Approved by: cperciva Modified: stable/8/sys/boot/forth/loader.conf Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/boot/forth/loader.conf ============================================================================== --- stable/8/sys/boot/forth/loader.conf Sat Jan 28 19:32:28 2012 (r230650) +++ stable/8/sys/boot/forth/loader.conf Sat Jan 28 19:33:02 2012 (r230651) @@ -31,9 +31,10 @@ verbose_loading="NO" # Set to YES for v splash_bmp_load="NO" # Set this to YES for bmp splash screen! splash_pcx_load="NO" # Set this to YES for pcx splash screen! +splash_txt_load="NO" # Set this to YES for TheDraw splash screen! vesa_load="NO" # Set this to YES to load the vesa module bitmap_load="NO" # Set this to YES if you want splash screen! -bitmap_name="splash.bmp" # Set this to the name of the bmp or pcx file +bitmap_name="splash.bmp" # Set this to the name of the file bitmap_type="splash_image_data" # and place it on the module_path From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 19:33:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD429106566C; Sat, 28 Jan 2012 19:33:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7FAF8FC13; Sat, 28 Jan 2012 19:33:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SJXWjq096235; Sat, 28 Jan 2012 19:33:32 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SJXW9s096233; Sat, 28 Jan 2012 19:33:32 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201281933.q0SJXW9s096233@svn.freebsd.org> From: Eitan Adler Date: Sat, 28 Jan 2012 19:33:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230652 - stable/7/sys/boot/forth X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 19:33:32 -0000 Author: eadler Date: Sat Jan 28 19:33:32 2012 New Revision: 230652 URL: http://svn.freebsd.org/changeset/base/230652 Log: MFC r230109: - Document TheDraw splash screens in the default loader.conf Approved by: cperciva Modified: stable/7/sys/boot/forth/loader.conf Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/boot/forth/loader.conf ============================================================================== --- stable/7/sys/boot/forth/loader.conf Sat Jan 28 19:33:02 2012 (r230651) +++ stable/7/sys/boot/forth/loader.conf Sat Jan 28 19:33:32 2012 (r230652) @@ -31,9 +31,10 @@ verbose_loading="NO" # Set to YES for v splash_bmp_load="NO" # Set this to YES for bmp splash screen! splash_pcx_load="NO" # Set this to YES for pcx splash screen! +splash_txt_load="NO" # Set this to YES for TheDraw splash screen! vesa_load="NO" # Set this to YES to load the vesa module bitmap_load="NO" # Set this to YES if you want splash screen! -bitmap_name="splash.bmp" # Set this to the name of the bmp or pcx file +bitmap_name="splash.bmp" # Set this to the name of the file bitmap_type="splash_image_data" # and place it on the module_path From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 19:48:45 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E7D41065773; Sat, 28 Jan 2012 19:48:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 55A9E8FC16; Sat, 28 Jan 2012 19:48:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SJmjY2096616; Sat, 28 Jan 2012 19:48:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SJmjIL096609; Sat, 28 Jan 2012 19:48:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201281948.q0SJmjIL096609@svn.freebsd.org> From: Eitan Adler Date: Sat, 28 Jan 2012 19:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230653 - in stable/9: lib/libopie share/examples/diskless share/examples/ppp share/examples/printing tools/tools/nanobsd/pcengines/Files/root usr.sbin/pkg_install/add X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 19:48:45 -0000 Author: eadler Date: Sat Jan 28 19:48:44 2012 New Revision: 230653 URL: http://svn.freebsd.org/changeset/base/230653 Log: MFC r229831: - X11BASE has been deprecated for a long time and will die soon Approved by: cperciva Modified: stable/9/lib/libopie/config.h stable/9/share/examples/diskless/README.TEMPLATING stable/9/share/examples/ppp/ppp.linkdown.sample stable/9/share/examples/printing/hpvf stable/9/tools/tools/nanobsd/pcengines/Files/root/.cshrc stable/9/usr.sbin/pkg_install/add/main.c Directory Properties: stable/9/lib/libopie/ (props changed) stable/9/share/ (props changed) stable/9/share/examples/ (props changed) stable/9/tools/tools/nanobsd/ (props changed) stable/9/usr.sbin/pkg_install/ (props changed) Modified: stable/9/lib/libopie/config.h ============================================================================== --- stable/9/lib/libopie/config.h Sat Jan 28 19:33:32 2012 (r230652) +++ stable/9/lib/libopie/config.h Sat Jan 28 19:48:44 2012 (r230653) @@ -54,7 +54,7 @@ /* #undef DOANONYMOUS */ /* The default value of the PATH environment variable */ -#define DEFAULT_PATH "/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin" +#define DEFAULT_PATH "/usr/bin:/bin:/usr/sbin:/sbin" /* Defined if the file /etc/default/login exists (and, presumably, should be looked at by login) */ Modified: stable/9/share/examples/diskless/README.TEMPLATING ============================================================================== --- stable/9/share/examples/diskless/README.TEMPLATING Sat Jan 28 19:33:32 2012 (r230652) +++ stable/9/share/examples/diskless/README.TEMPLATING Sat Jan 28 19:48:44 2012 (r230653) @@ -94,8 +94,8 @@ be useful to set up clients and server f /usr/ports ( note 5 ) /usr/src ( note 5 ) /usr/local/crack ( note 5 ) - /usr/X11R6/lib/X11/xdm/xdm-errors ( note 6 ) - /usr/X11R6/lib/X11/xdm/xdm-pid ( note 6 ) + /usr/local/lib/X11/xdm/xdm-errors ( note 6 ) + /usr/local/lib/X11/xdm/xdm-pid ( note 6 ) /usr/local/etc/ssh_host_key ( note 6 ) /usr/local/etc/ssh_host_key.pub ( note 6 ) /usr/local/etc/ssh_random_seed ( note 6 ) @@ -120,7 +120,7 @@ be useful to set up clients and server f do not want to template such directories. note 6: Note that you can solve the problem of xdm and sshd creating - files in /usr. With xdm, edit /usr/X11R6/lib/xdm/xdm-config + files in /usr. With xdm, edit /usr/local/lib/xdm/xdm-config and change the errorLogFile and pidFile config lines. With sshd, add 'HostKey' and 'RandomSeed' directives to specify Modified: stable/9/share/examples/ppp/ppp.linkdown.sample ============================================================================== --- stable/9/share/examples/ppp/ppp.linkdown.sample Sat Jan 28 19:33:32 2012 (r230652) +++ stable/9/share/examples/ppp/ppp.linkdown.sample Sat Jan 28 19:48:44 2012 (r230653) @@ -23,7 +23,7 @@ # ``auplay'' (assuming NAS is installed and configured). # MYADDR: - !bg /usr/X11R6/bin/auplay /etc/ppp/linkdown.au + !bg /usr/local/bin/auplay /etc/ppp/linkdown.au # If you're running ``ppp -auto -nat dynamic-nat-auto'', and are # assigned a dynamic IP number by the peer, this may be worth while Modified: stable/9/share/examples/printing/hpvf ============================================================================== --- stable/9/share/examples/printing/hpvf Sat Jan 28 19:33:32 2012 (r230652) +++ stable/9/share/examples/printing/hpvf Sat Jan 28 19:48:44 2012 (r230653) @@ -1,10 +1,10 @@ #!/bin/sh # +# $FreeBSD$ +# # hpvf - Convert GIF files into HP/PCL, then print # Installed in /usr/local/libexec/hpvf -PATH=/usr/X11R6/bin:$PATH; export PATH - giftopnm | ppmtopgm | pgmtopbm | pbmtolj -resolution 300 \ && exit 0 \ || exit 2 Modified: stable/9/tools/tools/nanobsd/pcengines/Files/root/.cshrc ============================================================================== --- stable/9/tools/tools/nanobsd/pcengines/Files/root/.cshrc Sat Jan 28 19:33:32 2012 (r230652) +++ stable/9/tools/tools/nanobsd/pcengines/Files/root/.cshrc Sat Jan 28 19:48:44 2012 (r230653) @@ -14,7 +14,7 @@ alias ll ls -lA # A righteous umask umask 22 -set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin /usr/X11R6/bin $HOME/bin) +set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi setenv PAGER more Modified: stable/9/usr.sbin/pkg_install/add/main.c ============================================================================== --- stable/9/usr.sbin/pkg_install/add/main.c Sat Jan 28 19:33:32 2012 (r230652) +++ stable/9/usr.sbin/pkg_install/add/main.c Sat Jan 28 19:48:44 2012 (r230653) @@ -285,7 +285,7 @@ main(int argc, char **argv) } /* Make sure the sub-execs we invoke get found */ setenv("PATH", - "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/X11R6/bin", + "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin", 1); /* Set a reasonable umask */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 20:45:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71D9C1065677; Sat, 28 Jan 2012 20:45:48 +0000 (UTC) (envelope-from phk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5CCC28FC18; Sat, 28 Jan 2012 20:45:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SKjm5N097916; Sat, 28 Jan 2012 20:45:48 GMT (envelope-from phk@svn.freebsd.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SKjmSZ097914; Sat, 28 Jan 2012 20:45:48 GMT (envelope-from phk@svn.freebsd.org) Message-Id: <201201282045.q0SKjmSZ097914@svn.freebsd.org> From: Poul-Henning Kamp Date: Sat, 28 Jan 2012 20:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230654 - head/usr.bin/tip/tip X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 20:45:48 -0000 Author: phk Date: Sat Jan 28 20:45:47 2012 New Revision: 230654 URL: http://svn.freebsd.org/changeset/base/230654 Log: Make tip exit if the device disappears, for instance when unplugging or resetting USB serial devices. Somebody[tm] should rewrite tip(1) to use two thread instead of two processes or maybe even use that new-fangled "select(2)" or positively futuristic "poll(2)" system call. Modified: head/usr.bin/tip/tip/tip.c head/usr.bin/tip/tip/tipout.c Modified: head/usr.bin/tip/tip/tip.c ============================================================================== --- head/usr.bin/tip/tip/tip.c Sat Jan 28 19:48:44 2012 (r230653) +++ head/usr.bin/tip/tip/tip.c Sat Jan 28 20:45:47 2012 (r230654) @@ -584,7 +584,7 @@ parwrite(int fd, char *buf, size_t n) bp++; } if (write(fd, buf, n) < 0) { - if (errno == EIO) + if (errno == EIO || errno == ENXIO) tipabort("Lost carrier."); /* this is questionable */ perror("write"); Modified: head/usr.bin/tip/tip/tipout.c ============================================================================== --- head/usr.bin/tip/tip/tipout.c Sat Jan 28 19:48:44 2012 (r230653) +++ head/usr.bin/tip/tip/tipout.c Sat Jan 28 20:45:47 2012 (r230654) @@ -148,11 +148,12 @@ tipout(void) scnt = read(FD, buf, BUFSIZ); if (scnt <= 0) { /* lost carrier */ - if (scnt == 0 || (scnt < 0 && errno == EIO)) { + if (scnt == 0 || + (scnt < 0 && (errno == EIO || errno == ENXIO))) { sigemptyset(&mask); sigaddset(&mask, SIGTERM); sigprocmask(SIG_BLOCK, &mask, NULL); - intTERM(0); + intTERM(SIGHUP); /*NOTREACHED*/ } continue; From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 21:06:46 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54F91106564A; Sat, 28 Jan 2012 21:06:46 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 400288FC0A; Sat, 28 Jan 2012 21:06:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SL6kfm098578; Sat, 28 Jan 2012 21:06:46 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SL6kOY098576; Sat, 28 Jan 2012 21:06:46 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201201282106.q0SL6kOY098576@svn.freebsd.org> From: Sean Farley Date: Sat, 28 Jan 2012 21:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230655 - head/usr.sbin/cron/crontab X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 21:06:46 -0000 Author: scf Date: Sat Jan 28 21:06:45 2012 New Revision: 230655 URL: http://svn.freebsd.org/changeset/base/230655 Log: Since April 2, 2006, Indiana has observed DST. MFC after: 5 days Modified: head/usr.sbin/cron/crontab/crontab.5 Modified: head/usr.sbin/cron/crontab/crontab.5 ============================================================================== --- head/usr.sbin/cron/crontab/crontab.5 Sat Jan 28 20:45:47 2012 (r230654) +++ head/usr.sbin/cron/crontab/crontab.5 Sat Jan 28 21:06:45 2012 (r230655) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2005 +.Dd January 28, 2012 .Dt CRONTAB 5 .Os .Sh NAME @@ -301,7 +301,7 @@ affected. In general, it is not a good idea to schedule jobs during this period. .Pp -For US timezones (except parts of IN, AZ, and HI) the time shift occurs at +For US timezones (except parts of AZ and HI) the time shift occurs at 2AM local time. For others, the output of the .Xr zdump 8 From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 21:21:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 572E1106564A; Sat, 28 Jan 2012 21:21:06 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4178E8FC1D; Sat, 28 Jan 2012 21:21:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SLL6IY099040; Sat, 28 Jan 2012 21:21:06 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SLL6Lq099038; Sat, 28 Jan 2012 21:21:06 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201201282121.q0SLL6Lq099038@svn.freebsd.org> From: Sean Farley Date: Sat, 28 Jan 2012 21:21:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230656 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 21:21:06 -0000 Author: scf Date: Sat Jan 28 21:21:05 2012 New Revision: 230656 URL: http://svn.freebsd.org/changeset/base/230656 Log: msdos was renamed to msdosfs in 2001 by r77577. MFC after: 5 days Modified: head/share/man/man4/umass.4 Modified: head/share/man/man4/umass.4 ============================================================================== --- head/share/man/man4/umass.4 Sat Jan 28 21:06:45 2012 (r230655) +++ head/share/man/man4/umass.4 Sat Jan 28 21:21:05 2012 (r230656) @@ -231,7 +231,7 @@ based file systems when storing informat videos. These file systems can be accessed by specifying the file system type as -.Cm msdos +.Cm msdosfs when using .Xr mount 8 . .Sh SEE ALSO From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 21:37:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B549106566B; Sat, 28 Jan 2012 21:37:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D3708FC0C; Sat, 28 Jan 2012 21:37:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SLbY5j099556; Sat, 28 Jan 2012 21:37:34 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SLbYGB099554; Sat, 28 Jan 2012 21:37:34 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201282137.q0SLbYGB099554@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Jan 2012 21:37:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230657 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 21:37:34 -0000 Author: adrian Date: Sat Jan 28 21:37:33 2012 New Revision: 230657 URL: http://svn.freebsd.org/changeset/base/230657 Log: Two changes from my DFS work: * Grab the net80211com lock when calling ieee80211_dfs_notify_radar(). * Use the tsf extend function to turn the 64 bit base TSF into a per- frame 64 bit TSF. This will improve radiotap logging (which will now have a (more) correct per-frame TSF, rather then the single TSF64 value read at the beginning of ath_rx_proc(). Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jan 28 21:21:05 2012 (r230656) +++ head/sys/dev/ath/if_ath.c Sat Jan 28 21:37:33 2012 (r230657) @@ -3983,7 +3983,7 @@ ath_rx_proc(struct ath_softc *sc, int re int len, type, ngood; HAL_STATUS status; int16_t nf; - u_int64_t tsf; + u_int64_t tsf, rstamp; int npkts = 0; /* XXX we must not hold the ATH_LOCK here */ @@ -4054,6 +4054,12 @@ ath_rx_proc(struct ath_softc *sc, int re TAILQ_REMOVE(&sc->sc_rxbuf, bf, bf_list); npkts++; + /* + * Calculate the correct 64 bit TSF given + * the TSF64 register value and rs_tstamp. + */ + rstamp = ath_extend_tsf(sc, rs->rs_tstamp, tsf); + /* These aren't specifically errors */ #ifdef AH_SUPPORT_AR5416 if (rs->rs_flags & HAL_RX_GI) @@ -4085,7 +4091,7 @@ ath_rx_proc(struct ath_softc *sc, int re bf->bf_dmamap, BUS_DMASYNC_POSTREAD); /* Now pass it to the radar processing code */ - ath_dfs_process_phy_err(sc, mtod(m, char *), tsf, rs); + ath_dfs_process_phy_err(sc, mtod(m, char *), rstamp, rs); } /* Be suitably paranoid about receiving phy errors out of the stats array bounds */ @@ -4149,7 +4155,7 @@ rx_error: len = rs->rs_datalen; m->m_pkthdr.len = m->m_len = len; bf->bf_m = NULL; - ath_rx_tap(ifp, m, rs, tsf, nf); + ath_rx_tap(ifp, m, rs, rstamp, nf); ieee80211_radiotap_rx_all(ic, m); m_freem(m); } @@ -4246,7 +4252,7 @@ rx_accept: * noise setting is filled in above. */ if (ieee80211_radiotap_active(ic)) - ath_rx_tap(ifp, m, rs, tsf, nf); + ath_rx_tap(ifp, m, rs, rstamp, nf); /* * From this point on we assume the frame is at least @@ -6686,7 +6692,14 @@ ath_dfs_tasklet(void *p, int npending) */ if (ath_dfs_process_radar_event(sc, sc->sc_curchan)) { /* DFS event found, initiate channel change */ + /* + * XXX doesn't currently tell us whether the event + * XXX was found in the primary or extension + * XXX channel! + */ + IEEE80211_LOCK(ic); ieee80211_dfs_notify_radar(ic, sc->sc_curchan); + IEEE80211_UNLOCK(ic); } } From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 21:44:43 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 617181065677; Sat, 28 Jan 2012 21:44:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D4DD8FC0A; Sat, 28 Jan 2012 21:44:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SLihKi099840; Sat, 28 Jan 2012 21:44:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SLihnM099838; Sat, 28 Jan 2012 21:44:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201282144.q0SLihnM099838@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Jan 2012 21:44:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230658 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 21:44:43 -0000 Author: adrian Date: Sat Jan 28 21:44:42 2012 New Revision: 230658 URL: http://svn.freebsd.org/changeset/base/230658 Log: Change the prototype so the radar enable can fail. Modified: head/sys/dev/ath/if_athdfs.h Modified: head/sys/dev/ath/if_athdfs.h ============================================================================== --- head/sys/dev/ath/if_athdfs.h Sat Jan 28 21:37:33 2012 (r230657) +++ head/sys/dev/ath/if_athdfs.h Sat Jan 28 21:44:42 2012 (r230658) @@ -33,7 +33,7 @@ extern int ath_dfs_attach(struct ath_softc *sc); extern int ath_dfs_detach(struct ath_softc *sc); -extern void ath_dfs_radar_enable(struct ath_softc *, +extern int ath_dfs_radar_enable(struct ath_softc *, struct ieee80211_channel *chan); extern void ath_dfs_process_phy_err(struct ath_softc *sc, const char *buf, uint64_t tsf, struct ath_rx_status *rxstat); From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 21:44:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACEFF106564A; Sat, 28 Jan 2012 21:44:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97C088FC13; Sat, 28 Jan 2012 21:44:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SLipNv099880; Sat, 28 Jan 2012 21:44:51 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SLipsp099878; Sat, 28 Jan 2012 21:44:51 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201282144.q0SLipsp099878@svn.freebsd.org> From: Eitan Adler Date: Sat, 28 Jan 2012 21:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230659 - stable/9/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 21:44:51 -0000 Author: eadler Date: Sat Jan 28 21:44:51 2012 New Revision: 230659 URL: http://svn.freebsd.org/changeset/base/230659 Log: MFC r230327: Add support for Sony Ericsson GC89 EDGE/Wirelles LAN PC Card PR: kern/131933 Approved by: cperciva Modified: stable/9/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_pci.c Sat Jan 28 21:44:42 2012 (r230658) +++ stable/9/sys/dev/uart/uart_bus_pci.c Sat Jan 28 21:44:51 2012 (r230659) @@ -110,6 +110,7 @@ static struct pci_id pci_ns8250_ids[] = 8 * DEFAULT_RCLK }, { 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART", 0x10, 16384000 }, +{ 0x14e4, 0x4344, 0xffff, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, { 0x8086, 0x3b67, 0xffff, 0, "5 Series/3400 Series Chipset KT Controller", From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 21:45:21 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B45C10656D2; Sat, 28 Jan 2012 21:45:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E5568FC1C; Sat, 28 Jan 2012 21:45:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SLjLu7099941; Sat, 28 Jan 2012 21:45:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SLjLox099939; Sat, 28 Jan 2012 21:45:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201282145.q0SLjLox099939@svn.freebsd.org> From: Eitan Adler Date: Sat, 28 Jan 2012 21:45:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230660 - stable/8/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 21:45:21 -0000 Author: eadler Date: Sat Jan 28 21:45:20 2012 New Revision: 230660 URL: http://svn.freebsd.org/changeset/base/230660 Log: MFC r230327: Add support for Sony Ericsson GC89 EDGE/Wirelles LAN PC Card PR: kern/131933 Approved by: cperciva Modified: stable/8/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_pci.c Sat Jan 28 21:44:51 2012 (r230659) +++ stable/8/sys/dev/uart/uart_bus_pci.c Sat Jan 28 21:45:20 2012 (r230660) @@ -110,6 +110,7 @@ static struct pci_id pci_ns8250_ids[] = 8 * DEFAULT_RCLK }, { 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART", 0x10, 16384000 }, +{ 0x14e4, 0x4344, 0xffff, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x8086, 0x1c3d, 0xffff, 0, "Intel AMT - KT Controller", 0x10 }, { 0x8086, 0x3b67, 0xffff, 0, "5 Series/3400 Series Chipset KT Controller", From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 21:45:41 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 391D6106566C; Sat, 28 Jan 2012 21:45:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 231FA8FC08; Sat, 28 Jan 2012 21:45:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SLjeNM099986; Sat, 28 Jan 2012 21:45:40 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SLjeWP099984; Sat, 28 Jan 2012 21:45:40 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201201282145.q0SLjeWP099984@svn.freebsd.org> From: Eitan Adler Date: Sat, 28 Jan 2012 21:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230661 - stable/7/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 21:45:41 -0000 Author: eadler Date: Sat Jan 28 21:45:40 2012 New Revision: 230661 URL: http://svn.freebsd.org/changeset/base/230661 Log: MFC r230327: Add support for Sony Ericsson GC89 EDGE/Wirelles LAN PC Card PR: kern/131933 Approved by: cperciva Modified: stable/7/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/7/sys/dev/uart/uart_bus_pci.c Sat Jan 28 21:45:20 2012 (r230660) +++ stable/7/sys/dev/uart/uart_bus_pci.c Sat Jan 28 21:45:40 2012 (r230661) @@ -108,6 +108,7 @@ static struct pci_id pci_ns8250_ids[] = 8 * DEFAULT_RCLK }, { 0x1415, 0x950b, 0xffff, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART", 0x10, 16384000 }, +{ 0x14e4, 0x4344, 0xffff, 0, "Sony Ericsson GC89 PC Card", 0x10}, { 0x151f, 0x0000, 0xffff, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 22:07:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3317B1065680; Sat, 28 Jan 2012 22:07:02 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id D9C9D8FC15; Sat, 28 Jan 2012 22:07:01 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E5C6225D3870; Sat, 28 Jan 2012 22:07:00 +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 2BDB4BDA2B3; Sat, 28 Jan 2012 22:07:00 +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 lfr+WgDqiHH0; Sat, 28 Jan 2012 22:06:59 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 2C0EDBDA2B5; Sat, 28 Jan 2012 22:06:59 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201201282144.q0SLihnM099838@svn.freebsd.org> Date: Sat, 28 Jan 2012 22:06:58 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201201282144.q0SLihnM099838@svn.freebsd.org> To: Adrian Chadd X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230658 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 22:07:02 -0000 On 28. Jan 2012, at 21:44 , Adrian Chadd wrote: > Author: adrian > Date: Sat Jan 28 21:44:42 2012 > New Revision: 230658 > URL: http://svn.freebsd.org/changeset/base/230658 >=20 > Log: > Change the prototype so the radar enable can fail. Forgot to also check in the implementation change? >=20 > Modified: > head/sys/dev/ath/if_athdfs.h >=20 > Modified: head/sys/dev/ath/if_athdfs.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/ath/if_athdfs.h Sat Jan 28 21:37:33 2012 = (r230657) > +++ head/sys/dev/ath/if_athdfs.h Sat Jan 28 21:44:42 2012 = (r230658) > @@ -33,7 +33,7 @@ >=20 > extern int ath_dfs_attach(struct ath_softc *sc); > extern int ath_dfs_detach(struct ath_softc *sc); > -extern void ath_dfs_radar_enable(struct ath_softc *, > +extern int ath_dfs_radar_enable(struct ath_softc *, > struct ieee80211_channel *chan); > extern void ath_dfs_process_phy_err(struct ath_softc *sc, const = char *buf, > uint64_t tsf, struct ath_rx_status *rxstat); --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 22:22:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6EE90106566C; Sat, 28 Jan 2012 22:22:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3EAB18FC13; Sat, 28 Jan 2012 22:22:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SMM6eY001316; Sat, 28 Jan 2012 22:22:06 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SMM6VY001314; Sat, 28 Jan 2012 22:22:06 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282222.q0SMM6VY001314@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 22:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230662 - head/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 22:22:06 -0000 Author: marius Date: Sat Jan 28 22:22:05 2012 New Revision: 230662 URL: http://svn.freebsd.org/changeset/base/230662 Log: Fully disable interrupts while we fiddle with the FP context in the VIS-based block copy/zero implementations. While with 4BSD it's sufficient to just disable the tick interrupts, with ULE+PREEMPTION it's otherwise also possible that these are preempted via IPIs. Modified: head/sys/sparc64/sparc64/support.S Modified: head/sys/sparc64/sparc64/support.S ============================================================================== --- head/sys/sparc64/sparc64/support.S Sat Jan 28 21:45:40 2012 (r230661) +++ head/sys/sparc64/sparc64/support.S Sat Jan 28 22:22:05 2012 (r230662) @@ -580,8 +580,8 @@ fpu_fault_begin: * void spitfire_block_copy(void *src, void *dst, size_t len) */ ENTRY(spitfire_block_copy) - rdpr %pil, %o3 - wrpr %g0, PIL_TICK, %pil + rdpr %pstate, %o3 + wrpr %g0, PSTATE_NORMAL, %pstate wr %g0, ASI_BLK_S, %asi wr %g0, FPRS_FEF, %fprs @@ -603,7 +603,7 @@ ENTRY(spitfire_block_copy) or %o4, PCB_FEF, %o4 stx %o4, [PCB_REG + PCB_FLAGS] -1: wrpr %o3, 0, %pil +1: wrpr %o3, 0, %pstate ldda [%o0] %asi, %f0 add %o0, 64, %o0 @@ -653,8 +653,8 @@ END(spitfire_block_copy) ENTRY(zeus_block_copy) prefetch [%o0 + (0 * 64)], 0 - rdpr %pil, %o3 - wrpr %g0, PIL_TICK, %pil + rdpr %pstate, %o3 + wrpr %g0, PSTATE_NORMAL, %pstate wr %g0, ASI_BLK_S, %asi wr %g0, FPRS_FEF, %fprs @@ -676,7 +676,7 @@ ENTRY(zeus_block_copy) or %o4, PCB_FEF, %o4 stx %o4, [PCB_REG + PCB_FLAGS] -1: wrpr %o3, 0, %pil +1: wrpr %o3, 0, %pstate ldd [%o0 + (0 * 8)], %f0 prefetch [%o0 + (1 * 64)], 0 @@ -764,8 +764,8 @@ END(zeus_block_copy) */ ALTENTRY(zeus_block_zero) ENTRY(spitfire_block_zero) - rdpr %pil, %o3 - wrpr %g0, PIL_TICK, %pil + rdpr %pstate, %o3 + wrpr %g0, PSTATE_NORMAL, %pstate wr %g0, ASI_BLK_S, %asi wr %g0, FPRS_FEF, %fprs @@ -787,7 +787,7 @@ ENTRY(spitfire_block_zero) or %o4, PCB_FEF, %o4 stx %o4, [PCB_REG + PCB_FLAGS] -1: wrpr %o3, 0, %pil +1: wrpr %o3, 0, %pstate fzero %f0 fzero %f2 From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 22:22:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC7C81065672; Sat, 28 Jan 2012 22:22:49 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 365558FC13; Sat, 28 Jan 2012 22:22:48 +0000 (UTC) Received: by vcmm1 with SMTP id m1so3197475vcm.13 for ; Sat, 28 Jan 2012 14:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=khHznTwnQEg5dd6YbivUMgQ8h1F5zDtBAvDCydDLUIE=; b=vLFt0zthrHBIwtdLMchQ+UJkZDJ8SqzHSEyKG+Rx2Ep4TuFKtWsbabVsZ0HfC47T5t e5Kw2HkyoMXk/fPovs82fLRrgWXrZJYF9tYYBSg2U/s/lAToI4nAj28BjvxPm7x055Bv fYnCibcalY1cY2Uj8/Lls7F7yobWWB2dyiUpo= MIME-Version: 1.0 Received: by 10.52.26.206 with SMTP id n14mr5916710vdg.51.1327789368366; Sat, 28 Jan 2012 14:22:48 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.52.172.37 with HTTP; Sat, 28 Jan 2012 14:22:48 -0800 (PST) In-Reply-To: References: <201201282144.q0SLihnM099838@svn.freebsd.org> Date: Sat, 28 Jan 2012 14:22:48 -0800 X-Google-Sender-Auth: Bln3laZXFvElrNyKWB9dKBn3UBg Message-ID: From: Adrian Chadd To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230658 - head/sys/dev/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 22:22:49 -0000 Oops! Sorry, I err, will do that in a sec. Adrian On 28 January 2012 14:06, Bjoern A. Zeeb wrote: > > On 28. Jan 2012, at 21:44 , Adrian Chadd wrote: > > > Author: adrian > > Date: Sat Jan 28 21:44:42 2012 > > New Revision: 230658 > > URL: http://svn.freebsd.org/changeset/base/230658 > > > > Log: > > Change the prototype so the radar enable can fail. > > Forgot to also check in the implementation change? > > > > > > Modified: > > head/sys/dev/ath/if_athdfs.h > > > > Modified: head/sys/dev/ath/if_athdfs.h > > > ============================================================================== > > --- head/sys/dev/ath/if_athdfs.h Sat Jan 28 21:37:33 2012 > (r230657) > > +++ head/sys/dev/ath/if_athdfs.h Sat Jan 28 21:44:42 2012 > (r230658) > > @@ -33,7 +33,7 @@ > > > > extern int ath_dfs_attach(struct ath_softc *sc); > > extern int ath_dfs_detach(struct ath_softc *sc); > > -extern void ath_dfs_radar_enable(struct ath_softc *, > > +extern int ath_dfs_radar_enable(struct ath_softc *, > > struct ieee80211_channel *chan); > > extern void ath_dfs_process_phy_err(struct ath_softc *sc, const > char *buf, > > uint64_t tsf, struct ath_rx_status *rxstat); > > -- > Bjoern A. Zeeb You have to have visions! > It does not matter how good you are. It matters what good you do! > > From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 22:24:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97C43106566B; Sat, 28 Jan 2012 22:24:59 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F148FC0C; Sat, 28 Jan 2012 22:24:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SMOxcZ001433; Sat, 28 Jan 2012 22:24:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SMOx4d001431; Sat, 28 Jan 2012 22:24:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201201282224.q0SMOx4d001431@svn.freebsd.org> From: Adrian Chadd Date: Sat, 28 Jan 2012 22:24:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230663 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 22:24:59 -0000 Author: adrian Date: Sat Jan 28 22:24:59 2012 New Revision: 230663 URL: http://svn.freebsd.org/changeset/base/230663 Log: Oops, commit a missing implementation change. Whilst I'm here, add a comment about what would happen in this function if hypothetically you had a radar pattern matching detector written. Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Sat Jan 28 22:22:05 2012 (r230662) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Sat Jan 28 22:24:59 2012 (r230663) @@ -95,12 +95,19 @@ ath_dfs_detach(struct ath_softc *sc) /* * Enable radar check */ -void +int ath_dfs_radar_enable(struct ath_softc *sc, struct ieee80211_channel *chan) { /* Check if the current channel is radar-enabled */ if (! IEEE80211_IS_CHAN_DFS(chan)) - return; + return (0); + + /* + * Enabling the radar parameters and setting sc->sc_dodfs = 1 + * would occur here. + */ + + return (1); } /* From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 22:42:34 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DF97106566C; Sat, 28 Jan 2012 22:42:34 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E3B48FC08; Sat, 28 Jan 2012 22:42:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SMgYL0001995; Sat, 28 Jan 2012 22:42:34 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SMgY5o001992; Sat, 28 Jan 2012 22:42:34 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282242.q0SMgY5o001992@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 22:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230664 - head/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 22:42:34 -0000 Author: marius Date: Sat Jan 28 22:42:33 2012 New Revision: 230664 URL: http://svn.freebsd.org/changeset/base/230664 Log: As it turns out r227960 may still be insufficient with PREEMPTION so try harder to get the CDMA sync interrupt delivered and also in a more efficient way: - wrap the whole process of sending and receiving the CDMA sync interrupt in a critical section so we don't get preempted, - send the CDMA sync interrupt to the CPU that is actually waiting for it to happen so we don't take a detour via another CPU, - instead of waiting for up to 15 seconds for the interrupt to trigger try the whole process for up to 15 times using a one second timeout (the code was also changed to just ignore belated interrupts of a previous tries should they appear). According to testing done by Peter Jeremy with the debugging also added as part of this commit the first two changes apparently are sufficient to now properly get the CDMA sync interrupts delivered at the first try though. Modified: head/sys/sparc64/pci/schizo.c head/sys/sparc64/pci/schizovar.h Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Sat Jan 28 22:24:59 2012 (r230663) +++ head/sys/sparc64/pci/schizo.c Sat Jan 28 22:42:33 2012 (r230664) @@ -178,6 +178,8 @@ struct schizo_icarg { bus_addr_t sica_clr; }; +#define SCHIZO_CDMA_TIMEOUT 1 /* 1 second per try */ +#define SCHIZO_CDMA_TRIES 15 #define SCHIZO_PERF_CNT_QLTY 100 #define SCHIZO_SPC_BARRIER(spc, sc, offs, len, flags) \ @@ -706,13 +708,15 @@ schizo_attach(device_t dev) i = INTINO(bus_get_resource_start(dev, SYS_RES_IRQ, 4)); if (i == STX_CDMA_A_INO || i == STX_CDMA_B_INO) { - (void)schizo_get_intrmap(sc, i, NULL, - &sc->sc_cdma_clr); + sc->sc_cdma_vec = INTMAP_VEC(sc->sc_ign, i); + (void)schizo_get_intrmap(sc, i, + &sc->sc_cdma_map, &sc->sc_cdma_clr); schizo_set_intr(sc, 4, i, schizo_cdma); } else { i = STX_CDMA_A_INO + sc->sc_half; + sc->sc_cdma_vec = INTMAP_VEC(sc->sc_ign, i); if (bus_set_resource(dev, SYS_RES_IRQ, 5, - INTMAP_VEC(sc->sc_ign, i), 1) != 0) + sc->sc_cdma_vec, 1) != 0) panic("%s: failed to add CDMA " "interrupt", __func__); j = schizo_intr_register(sc, i); @@ -720,8 +724,8 @@ schizo_attach(device_t dev) panic("%s: could not register " "interrupt controller for CDMA " "(%d)", __func__, j); - (void)schizo_get_intrmap(sc, i, NULL, - &sc->sc_cdma_clr); + (void)schizo_get_intrmap(sc, i, + &sc->sc_cdma_map, &sc->sc_cdma_clr); schizo_set_intr(sc, 5, i, schizo_cdma); } } else { @@ -988,7 +992,8 @@ schizo_cdma(void *arg) { struct schizo_softc *sc = arg; - atomic_store_rel_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_RECEIVED); + atomic_cmpset_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_PENDING, + SCHIZO_CDMA_STATE_RECEIVED); return (FILTER_HANDLED); } @@ -1153,7 +1158,10 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus struct timeval cur, end; struct schizo_iommu_state *sis = dt->dt_cookie; struct schizo_softc *sc = sis->sis_sc; - int res; + int i, res; +#ifdef INVARIANTS + register_t pil; +#endif if ((map->dm_flags & DMF_STREAMED) != 0) { iommu_dma_methods.dm_dmamap_sync(dt, map, op); @@ -1170,20 +1178,36 @@ schizo_dmamap_sync(bus_dma_tag_t dt, bus * but given that these disable interrupts we have to emulate * one. */ + critical_enter(); + KASSERT((rdpr(pstate) & PSTATE_IE) != 0, + ("%s: interrupts disabled", __func__)); + KASSERT((pil = rdpr(pil)) <= PIL_BRIDGE, + ("%s: PIL too low (%ld)", __func__, pil)); for (; atomic_cmpset_acq_32(&sc->sc_cdma_state, SCHIZO_CDMA_STATE_IDLE, SCHIZO_CDMA_STATE_PENDING) == 0;) ; - SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, INTCLR_RECEIVED); - microuptime(&cur); - end.tv_sec = 15; - end.tv_usec = 0; - timevaladd(&end, &cur); - for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, - SCHIZO_CDMA_STATE_RECEIVED, SCHIZO_CDMA_STATE_IDLE)) == - 0 && timevalcmp(&cur, &end, <=);) + SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_map, + INTMAP_ENABLE(sc->sc_cdma_vec, PCPU_GET(mid))); + for (i = 0; i < SCHIZO_CDMA_TRIES; i++) { + if (i > 0) + printf("%s: try %d\n", __func__, i); + SCHIZO_PCI_WRITE_8(sc, sc->sc_cdma_clr, + INTCLR_RECEIVED); microuptime(&cur); + end.tv_sec = SCHIZO_CDMA_TIMEOUT; + end.tv_usec = 0; + timevaladd(&end, &cur); + for (; (res = atomic_cmpset_rel_32(&sc->sc_cdma_state, + SCHIZO_CDMA_STATE_RECEIVED, + SCHIZO_CDMA_STATE_IDLE)) == 0 && + timevalcmp(&cur, &end, <=);) + microuptime(&cur); + if (res != 0) + break; + } if (res == 0) panic("%s: DMA does not sync", __func__); + critical_exit(); } if ((op & BUS_DMASYNC_PREWRITE) != 0) @@ -1352,7 +1376,7 @@ schizo_alloc_resource(device_t bus, devi panic("%s: XXX: interrupt range", __func__); start = end = INTMAP_VEC(sc->sc_ign, end); return (bus_generic_alloc_resource(bus, child, type, rid, - start, end, count, flags)); + start, end, count, flags)); case SYS_RES_MEMORY: rm = &sc->sc_pci_mem_rman; break; Modified: head/sys/sparc64/pci/schizovar.h ============================================================================== --- head/sys/sparc64/pci/schizovar.h Sat Jan 28 22:24:59 2012 (r230663) +++ head/sys/sparc64/pci/schizovar.h Sat Jan 28 22:42:33 2012 (r230664) @@ -59,7 +59,9 @@ struct schizo_softc { #define SCHIZO_FLAGS_BSWAR (1 << 0) #define SCHIZO_FLAGS_XMODE (1 << 1) + bus_addr_t sc_cdma_map; bus_addr_t sc_cdma_clr; + uint32_t sc_cdma_vec; uint32_t sc_cdma_state; #define SCHIZO_CDMA_STATE_IDLE (1 << 0) #define SCHIZO_CDMA_STATE_PENDING (1 << 1) From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:12:55 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F448106564A; Sat, 28 Jan 2012 23:12:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 87D168FC08; Sat, 28 Jan 2012 23:12:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNCtv5003019; Sat, 28 Jan 2012 23:12:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNCtQ5003013; Sat, 28 Jan 2012 23:12:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282312.q0SNCtQ5003013@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230665 - in stable/9/sys: cam conf modules/cam sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:12:55 -0000 Author: marius Date: Sat Jan 28 23:12:55 2012 New Revision: 230665 URL: http://svn.freebsd.org/changeset/base/230665 Log: MFC: r228022, r228026 For sparc64 also adjust the geometry of da(4) driven disks to not overflow the 16-bit cylinders field of the VTOC8 disk label (at around 502GB). The geometry chosen for disks above that limit allows to use disks up to 2TB, which is the limit of the extended VTOC8 format. The geometry used for disks smaller than the 16-bit cylinders limit stays the same as used by cam_calc_geometry(9) for extended translation. Thanks to Hans-Joerg Sirtl for providing hardware for testing this change. Added: stable/9/sys/sparc64/sparc64/cam_machdep.c - copied unchanged from r228022, head/sys/sparc64/sparc64/cam_machdep.c Modified: stable/9/sys/cam/cam_xpt.c stable/9/sys/conf/files.sparc64 stable/9/sys/modules/cam/Makefile stable/9/sys/sparc64/include/md_var.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Sat Jan 28 22:42:33 2012 (r230664) +++ stable/9/sys/cam/cam_xpt.c Sat Jan 28 23:12:55 2012 (r230665) @@ -66,7 +66,10 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include /* geometry translation */ #include /* for xpt_print below */ + #include "opt_cam.h" /* @@ -2456,7 +2459,7 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_CMP; break; } -#ifdef PC98 +#if defined(PC98) || defined(__sparc64__) /* * In a PC-98 system, geometry translation depens on * the "real" device geometry obtained from mode page 4. @@ -2465,6 +2468,9 @@ xpt_action_default(union ccb *start_ccb) * stored in host memory. If the translation is available * in host memory, use it. If not, rely on the default * translation the device driver performs. + * For sparc64, we may need adjust the geometry of large + * disks in order to fit the limitations of the 16-bit + * fields of the VTOC8 disk label. */ if (scsi_da_bios_params(&start_ccb->ccg) != 0) { start_ccb->ccb_h.status = CAM_REQ_CMP; Modified: stable/9/sys/conf/files.sparc64 ============================================================================== --- stable/9/sys/conf/files.sparc64 Sat Jan 28 22:42:33 2012 (r230664) +++ stable/9/sys/conf/files.sparc64 Sat Jan 28 23:12:55 2012 (r230665) @@ -90,6 +90,7 @@ sparc64/sparc64/ata_machdep.c optional a sparc64/sparc64/autoconf.c standard sparc64/sparc64/bus_machdep.c standard sparc64/sparc64/cache.c standard +sparc64/sparc64/cam_machdep.c optional scbus sparc64/sparc64/cheetah.c standard sparc64/sparc64/clock.c standard sparc64/sparc64/counter.c standard Modified: stable/9/sys/modules/cam/Makefile ============================================================================== --- stable/9/sys/modules/cam/Makefile Sat Jan 28 22:42:33 2012 (r230664) +++ stable/9/sys/modules/cam/Makefile Sat Jan 28 23:12:55 2012 (r230665) @@ -16,8 +16,11 @@ SRCS+= opt_pt.h SRCS+= opt_sa.h SRCS+= opt_ses.h SRCS+= device_if.h bus_if.h vnode_if.h -SRCS+= cam.c cam_periph.c cam_queue.c -SRCS+= cam_sim.c cam_xpt.c +SRCS+= cam.c +.if exists($S/${MACHINE}/${MACHINE}/cam_machdep.c) +SRCS+= cam_machdep.c +.endif +SRCS+= cam_periph.c cam_queue.c cam_sim.c cam_xpt.c SRCS+= scsi_all.c scsi_cd.c scsi_ch.c SRCS+= scsi_da.c SRCS+= scsi_pass.c @@ -32,7 +35,7 @@ SRCS+= ata_all.c SRCS+= ata_xpt.c SRCS+= ata_da.c .if exists($S/${MACHINE}/${MACHINE}/ata_machdep.c) -SRCS+= ata_machdep.c +SRCS+= ata_machdep.c .endif SRCS+= ata_pmp.c Modified: stable/9/sys/sparc64/include/md_var.h ============================================================================== --- stable/9/sys/sparc64/include/md_var.h Sat Jan 28 22:42:33 2012 (r230664) +++ stable/9/sys/sparc64/include/md_var.h Sat Jan 28 23:12:55 2012 (r230665) @@ -65,10 +65,11 @@ extern cpu_block_copy_t *cpu_block_copy; extern cpu_block_zero_t *cpu_block_zero; /* - * Given that the Sun disk label only uses 16-bit fields for cylinders, - * heads and sectors we might need to adjust the geometry of large IDE - * disks. + * Given that the VTOC8 disk label only uses 16-bit fields for cylinders, + * heads and sectors we might need to adjust the geometry of large disks. */ +struct ccb_calc_geometry; +int scsi_da_bios_params(struct ccb_calc_geometry *ccg); struct disk; void sparc64_ata_disk_firmware_geom_adjust(struct disk *disk); #define ata_disk_firmware_geom_adjust(disk) \ Copied: stable/9/sys/sparc64/sparc64/cam_machdep.c (from r228022, head/sys/sparc64/sparc64/cam_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/sparc64/sparc64/cam_machdep.c Sat Jan 28 23:12:55 2012 (r230665, copy of r228022, head/sys/sparc64/sparc64/cam_machdep.c) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * 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 + +int +scsi_da_bios_params(struct ccb_calc_geometry *ccg) +{ + uint32_t secs_per_cylinder, size_mb; + + /* + * The VTOC8 disk label only uses 16-bit fields for cylinders, heads + * and sectors so the geometry of large disks has to be adjusted. + * We generally use the sizing used by cam_calc_geometry(9), except + * when it would overflow the cylinders, in which case we use 255 + * heads and sectors. This allows disks up to the 2TB limit of the + * extended VTOC8. + * XXX this doesn't match the sizing used by OpenSolaris, as that + * would exceed the 8-bit ccg->heads and ccg->secs_per_track. + */ + if (ccg->block_size == 0) + return (0); + size_mb = (1024L * 1024L) / ccg->block_size; + if (size_mb == 0) + return (0); + size_mb = ccg->volume_size / size_mb; + if (ccg->volume_size > (uint64_t)65535 * 255 * 63) { + ccg->heads = 255; + ccg->secs_per_track = 255; + } else if (size_mb > 1024) { + ccg->heads = 255; + ccg->secs_per_track = 63; + } else { + ccg->heads = 64; + ccg->secs_per_track = 32; + } + secs_per_cylinder = ccg->heads * ccg->secs_per_track; + if (secs_per_cylinder == 0) + return (0); + ccg->cylinders = ccg->volume_size / secs_per_cylinder; + return (1); +} From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:13:01 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33DEB106566C; Sat, 28 Jan 2012 23:13:01 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1BE808FC0A; Sat, 28 Jan 2012 23:13:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SND0cQ003061; Sat, 28 Jan 2012 23:13:00 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SND0gb003055; Sat, 28 Jan 2012 23:13:00 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282313.q0SND0gb003055@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230666 - in stable/8/sys: cam conf modules/cam sparc64/include sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:13:01 -0000 Author: marius Date: Sat Jan 28 23:13:00 2012 New Revision: 230666 URL: http://svn.freebsd.org/changeset/base/230666 Log: MFC: r228022, r228026 For sparc64 also adjust the geometry of da(4) driven disks to not overflow the 16-bit cylinders field of the VTOC8 disk label (at around 502GB). The geometry chosen for disks above that limit allows to use disks up to 2TB, which is the limit of the extended VTOC8 format. The geometry used for disks smaller than the 16-bit cylinders limit stays the same as used by cam_calc_geometry(9) for extended translation. Thanks to Hans-Joerg Sirtl for providing hardware for testing this change. Added: stable/8/sys/sparc64/sparc64/cam_machdep.c - copied unchanged from r228022, head/sys/sparc64/sparc64/cam_machdep.c Modified: stable/8/sys/cam/cam_xpt.c stable/8/sys/conf/files.sparc64 stable/8/sys/modules/cam/Makefile stable/8/sys/sparc64/include/md_var.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Sat Jan 28 23:12:55 2012 (r230665) +++ stable/8/sys/cam/cam_xpt.c Sat Jan 28 23:13:00 2012 (r230666) @@ -67,7 +67,10 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include /* geometry translation */ #include /* for xpt_print below */ + #include "opt_cam.h" /* @@ -2404,7 +2407,7 @@ xpt_action_default(union ccb *start_ccb) start_ccb->ccb_h.status = CAM_REQ_CMP; break; } -#ifdef PC98 +#if defined(PC98) || defined(__sparc64__) /* * In a PC-98 system, geometry translation depens on * the "real" device geometry obtained from mode page 4. @@ -2413,6 +2416,9 @@ xpt_action_default(union ccb *start_ccb) * stored in host memory. If the translation is available * in host memory, use it. If not, rely on the default * translation the device driver performs. + * For sparc64, we may need adjust the geometry of large + * disks in order to fit the limitations of the 16-bit + * fields of the VTOC8 disk label. */ if (scsi_da_bios_params(&start_ccb->ccg) != 0) { start_ccb->ccb_h.status = CAM_REQ_CMP; Modified: stable/8/sys/conf/files.sparc64 ============================================================================== --- stable/8/sys/conf/files.sparc64 Sat Jan 28 23:12:55 2012 (r230665) +++ stable/8/sys/conf/files.sparc64 Sat Jan 28 23:13:00 2012 (r230666) @@ -89,6 +89,7 @@ sparc64/sparc64/ata_machdep.c optional a sparc64/sparc64/autoconf.c standard sparc64/sparc64/bus_machdep.c standard sparc64/sparc64/cache.c standard +sparc64/sparc64/cam_machdep.c optional scbus sparc64/sparc64/cheetah.c standard sparc64/sparc64/clock.c standard sparc64/sparc64/counter.c standard Modified: stable/8/sys/modules/cam/Makefile ============================================================================== --- stable/8/sys/modules/cam/Makefile Sat Jan 28 23:12:55 2012 (r230665) +++ stable/8/sys/modules/cam/Makefile Sat Jan 28 23:13:00 2012 (r230666) @@ -15,8 +15,11 @@ SRCS+= opt_pt.h SRCS+= opt_sa.h SRCS+= opt_ses.h SRCS+= device_if.h bus_if.h vnode_if.h -SRCS+= cam.c cam_periph.c cam_queue.c -SRCS+= cam_sim.c cam_xpt.c +SRCS+= cam.c +.if exists($S/${MACHINE}/${MACHINE}/cam_machdep.c) +SRCS+= cam_machdep.c +.endif +SRCS+= cam_periph.c cam_queue.c cam_sim.c cam_xpt.c SRCS+= scsi_all.c scsi_cd.c scsi_ch.c SRCS+= scsi_da.c SRCS+= scsi_pass.c @@ -30,7 +33,7 @@ SRCS+= ata_all.c SRCS+= ata_xpt.c SRCS+= ata_da.c .if exists($S/${MACHINE}/${MACHINE}/ata_machdep.c) -SRCS+= ata_machdep.c +SRCS+= ata_machdep.c .endif SRCS+= ata_pmp.c Modified: stable/8/sys/sparc64/include/md_var.h ============================================================================== --- stable/8/sys/sparc64/include/md_var.h Sat Jan 28 23:12:55 2012 (r230665) +++ stable/8/sys/sparc64/include/md_var.h Sat Jan 28 23:13:00 2012 (r230666) @@ -65,10 +65,11 @@ extern cpu_block_copy_t *cpu_block_copy; extern cpu_block_zero_t *cpu_block_zero; /* - * Given that the Sun disk label only uses 16-bit fields for cylinders, - * heads and sectors we might need to adjust the geometry of large IDE - * disks. + * Given that the VTOC8 disk label only uses 16-bit fields for cylinders, + * heads and sectors we might need to adjust the geometry of large disks. */ +struct ccb_calc_geometry; +int scsi_da_bios_params(struct ccb_calc_geometry *ccg); struct disk; void sparc64_ata_disk_firmware_geom_adjust(struct disk *disk); #define ata_disk_firmware_geom_adjust(disk) \ Copied: stable/8/sys/sparc64/sparc64/cam_machdep.c (from r228022, head/sys/sparc64/sparc64/cam_machdep.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/sparc64/cam_machdep.c Sat Jan 28 23:13:00 2012 (r230666, copy of r228022, head/sys/sparc64/sparc64/cam_machdep.c) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2011 Marius Strobl + * 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 + +int +scsi_da_bios_params(struct ccb_calc_geometry *ccg) +{ + uint32_t secs_per_cylinder, size_mb; + + /* + * The VTOC8 disk label only uses 16-bit fields for cylinders, heads + * and sectors so the geometry of large disks has to be adjusted. + * We generally use the sizing used by cam_calc_geometry(9), except + * when it would overflow the cylinders, in which case we use 255 + * heads and sectors. This allows disks up to the 2TB limit of the + * extended VTOC8. + * XXX this doesn't match the sizing used by OpenSolaris, as that + * would exceed the 8-bit ccg->heads and ccg->secs_per_track. + */ + if (ccg->block_size == 0) + return (0); + size_mb = (1024L * 1024L) / ccg->block_size; + if (size_mb == 0) + return (0); + size_mb = ccg->volume_size / size_mb; + if (ccg->volume_size > (uint64_t)65535 * 255 * 63) { + ccg->heads = 255; + ccg->secs_per_track = 255; + } else if (size_mb > 1024) { + ccg->heads = 255; + ccg->secs_per_track = 63; + } else { + ccg->heads = 64; + ccg->secs_per_track = 32; + } + secs_per_cylinder = ccg->heads * ccg->secs_per_track; + if (secs_per_cylinder == 0) + return (0); + ccg->cylinders = ccg->volume_size / secs_per_cylinder; + return (1); +} From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:15:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D5991065673; Sat, 28 Jan 2012 23:15:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCCA58FC19; Sat, 28 Jan 2012 23:15:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNF22h003190; Sat, 28 Jan 2012 23:15:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNF2A6003188; Sat, 28 Jan 2012 23:15:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282315.q0SNF2A6003188@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230667 - stable/9/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:15:03 -0000 Author: marius Date: Sat Jan 28 23:15:02 2012 New Revision: 230667 URL: http://svn.freebsd.org/changeset/base/230667 Log: MFC: r225886 - Right-justify backslashes as suggested by style(9). - Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with the names of the other macros in this file an adjust accordingly. Modified: stable/9/sys/sparc64/include/asmacros.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/asmacros.h ============================================================================== --- stable/9/sys/sparc64/include/asmacros.h Sat Jan 28 23:13:00 2012 (r230666) +++ stable/9/sys/sparc64/include/asmacros.h Sat Jan 28 23:15:02 2012 (r230667) @@ -49,98 +49,98 @@ /* * Atomically decrement an integer in memory. */ -#define ATOMIC_DEC_INT(r1, r2, r3) \ - lduw [r1], r2 ; \ -9: sub r2, 1, r3 ; \ - casa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_DEC_INT(r1, r2, r3) \ + lduw [r1], r2 ; \ +9: sub r2, 1, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* * Atomically increment an integer in memory. */ -#define ATOMIC_INC_INT(r1, r2, r3) \ - lduw [r1], r2 ; \ -9: add r2, 1, r3 ; \ - casa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_INC_INT(r1, r2, r3) \ + lduw [r1], r2 ; \ +9: add r2, 1, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* - * Atomically increment an u_long in memory. + * Atomically increment a long in memory. */ -#define ATOMIC_INC_ULONG(r1, r2, r3) \ - ldx [r1], r2 ; \ -9: add r2, 1, r3 ; \ - casxa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_INC_LONG(r1, r2, r3) \ + ldx [r1], r2 ; \ +9: add r2, 1, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* * Atomically clear a number of bits of an integer in memory. */ -#define ATOMIC_CLEAR_INT(r1, r2, r3, bits) \ - lduw [r1], r2 ; \ -9: andn r2, bits, r3 ; \ - casa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_CLEAR_INT(r1, r2, r3, bits) \ + lduw [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* - * Atomically clear a number of bits of an u_long in memory. + * Atomically clear a number of bits of a long in memory. */ -#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ - ldx [r1], r2 ; \ -9: andn r2, bits, r3 ; \ - casxa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ + ldx [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 #define PCPU(member) PCPU_REG + PC_ ## member -#define PCPU_ADDR(member, reg) \ +#define PCPU_ADDR(member, reg) \ add PCPU_REG, PC_ ## member, reg -#define DEBUGGER() \ +#define DEBUGGER() \ ta %xcc, 1 -#define PANIC(msg, r1) \ - .sect .rodata ; \ -9: .asciz msg ; \ - .previous ; \ - SET(9b, r1, %o0) ; \ - call panic ; \ +#define PANIC(msg, r1) \ + .sect .rodata ; \ +9: .asciz msg ; \ + .previous ; \ + SET(9b, r1, %o0) ; \ + call panic ; \ nop #ifdef INVARIANTS -#define KASSERT(r1, msg) \ - brnz,pt r1, 8f ; \ - nop ; \ - PANIC(msg, r1) ; \ +#define KASSERT(r1, msg) \ + brnz,pt r1, 8f ; \ + nop ; \ + PANIC(msg, r1) ; \ 8: #else #define KASSERT(r1, msg) #endif -#define PUTS(msg, r1) \ - .sect .rodata ; \ -9: .asciz msg ; \ - .previous ; \ - SET(9b, r1, %o0) ; \ - call printf ; \ +#define PUTS(msg, r1) \ + .sect .rodata ; \ +9: .asciz msg ; \ + .previous ; \ + SET(9b, r1, %o0) ; \ + call printf ; \ nop #define _ALIGN_DATA .align 8 -#define DATA(name) \ - .data ; \ - _ALIGN_DATA ; \ - .globl name ; \ - .type name, @object ; \ +#define DATA(name) \ + .data ; \ + _ALIGN_DATA ; \ + .globl name ; \ + .type name, @object ; \ name: #define EMPTY From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:15:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 65AEA106564A; Sat, 28 Jan 2012 23:15:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 494C88FC16; Sat, 28 Jan 2012 23:15:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNF5Kl003227; Sat, 28 Jan 2012 23:15:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNF5Ii003225; Sat, 28 Jan 2012 23:15:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282315.q0SNF5Ii003225@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230668 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:15:05 -0000 Author: marius Date: Sat Jan 28 23:15:04 2012 New Revision: 230668 URL: http://svn.freebsd.org/changeset/base/230668 Log: MFC: r225886 - Right-justify backslashes as suggested by style(9). - Rename ATOMIC_INC_ULONG to ATOMIC_INC_LONG in order to be consistent with the names of the other macros in this file an adjust accordingly. Modified: stable/8/sys/sparc64/include/asmacros.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/include/asmacros.h ============================================================================== --- stable/8/sys/sparc64/include/asmacros.h Sat Jan 28 23:15:02 2012 (r230667) +++ stable/8/sys/sparc64/include/asmacros.h Sat Jan 28 23:15:04 2012 (r230668) @@ -49,98 +49,98 @@ /* * Atomically decrement an integer in memory. */ -#define ATOMIC_DEC_INT(r1, r2, r3) \ - lduw [r1], r2 ; \ -9: sub r2, 1, r3 ; \ - casa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_DEC_INT(r1, r2, r3) \ + lduw [r1], r2 ; \ +9: sub r2, 1, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* * Atomically increment an integer in memory. */ -#define ATOMIC_INC_INT(r1, r2, r3) \ - lduw [r1], r2 ; \ -9: add r2, 1, r3 ; \ - casa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_INC_INT(r1, r2, r3) \ + lduw [r1], r2 ; \ +9: add r2, 1, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* - * Atomically increment an u_long in memory. + * Atomically increment a long in memory. */ -#define ATOMIC_INC_ULONG(r1, r2, r3) \ - ldx [r1], r2 ; \ -9: add r2, 1, r3 ; \ - casxa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_INC_LONG(r1, r2, r3) \ + ldx [r1], r2 ; \ +9: add r2, 1, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* * Atomically clear a number of bits of an integer in memory. */ -#define ATOMIC_CLEAR_INT(r1, r2, r3, bits) \ - lduw [r1], r2 ; \ -9: andn r2, bits, r3 ; \ - casa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_CLEAR_INT(r1, r2, r3, bits) \ + lduw [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 /* - * Atomically clear a number of bits of an u_long in memory. + * Atomically clear a number of bits of a long in memory. */ -#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ - ldx [r1], r2 ; \ -9: andn r2, bits, r3 ; \ - casxa [r1] ASI_N, r2, r3 ; \ - cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ +#define ATOMIC_CLEAR_LONG(r1, r2, r3, bits) \ + ldx [r1], r2 ; \ +9: andn r2, bits, r3 ; \ + casxa [r1] ASI_N, r2, r3 ; \ + cmp r2, r3 ; \ + bne,pn %icc, 9b ; \ mov r3, r2 #define PCPU(member) PCPU_REG + PC_ ## member -#define PCPU_ADDR(member, reg) \ +#define PCPU_ADDR(member, reg) \ add PCPU_REG, PC_ ## member, reg -#define DEBUGGER() \ +#define DEBUGGER() \ ta %xcc, 1 -#define PANIC(msg, r1) \ - .sect .rodata ; \ -9: .asciz msg ; \ - .previous ; \ - SET(9b, r1, %o0) ; \ - call panic ; \ +#define PANIC(msg, r1) \ + .sect .rodata ; \ +9: .asciz msg ; \ + .previous ; \ + SET(9b, r1, %o0) ; \ + call panic ; \ nop #ifdef INVARIANTS -#define KASSERT(r1, msg) \ - brnz,pt r1, 8f ; \ - nop ; \ - PANIC(msg, r1) ; \ +#define KASSERT(r1, msg) \ + brnz,pt r1, 8f ; \ + nop ; \ + PANIC(msg, r1) ; \ 8: #else #define KASSERT(r1, msg) #endif -#define PUTS(msg, r1) \ - .sect .rodata ; \ -9: .asciz msg ; \ - .previous ; \ - SET(9b, r1, %o0) ; \ - call printf ; \ +#define PUTS(msg, r1) \ + .sect .rodata ; \ +9: .asciz msg ; \ + .previous ; \ + SET(9b, r1, %o0) ; \ + call printf ; \ nop #define _ALIGN_DATA .align 8 -#define DATA(name) \ - .data ; \ - _ALIGN_DATA ; \ - .globl name ; \ - .type name, @object ; \ +#define DATA(name) \ + .data ; \ + _ALIGN_DATA ; \ + .globl name ; \ + .type name, @object ; \ name: #define EMPTY From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:16:48 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 67C6E1065673; Sat, 28 Jan 2012 23:16:48 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50DD98FC19; Sat, 28 Jan 2012 23:16:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNGmcI003391; Sat, 28 Jan 2012 23:16:48 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNGm8B003389; Sat, 28 Jan 2012 23:16:48 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282316.q0SNGm8B003389@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230669 - stable/9/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:16:48 -0000 Author: marius Date: Sat Jan 28 23:16:47 2012 New Revision: 230669 URL: http://svn.freebsd.org/changeset/base/230669 Log: MFC: r225887 Use the extended integer condition code when comparing 64-bit values. Given that ATOMIC_INC_LONG currently is unused this happened to not be fatal. Modified: stable/9/sys/sparc64/include/asmacros.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/asmacros.h ============================================================================== --- stable/9/sys/sparc64/include/asmacros.h Sat Jan 28 23:15:04 2012 (r230668) +++ stable/9/sys/sparc64/include/asmacros.h Sat Jan 28 23:16:47 2012 (r230669) @@ -76,7 +76,7 @@ 9: add r2, 1, r3 ; \ casxa [r1] ASI_N, r2, r3 ; \ cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ + bne,pn %xcc, 9b ; \ mov r3, r2 /* From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:16:49 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7C861065674; Sat, 28 Jan 2012 23:16:49 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9369D8FC22; Sat, 28 Jan 2012 23:16:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNGnop003421; Sat, 28 Jan 2012 23:16:49 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNGnG6003419; Sat, 28 Jan 2012 23:16:49 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282316.q0SNGnG6003419@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:16:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230670 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:16:49 -0000 Author: marius Date: Sat Jan 28 23:16:49 2012 New Revision: 230670 URL: http://svn.freebsd.org/changeset/base/230670 Log: MFC: r225887 Use the extended integer condition code when comparing 64-bit values. Given that ATOMIC_INC_LONG currently is unused this happened to not be fatal. Modified: stable/8/sys/sparc64/include/asmacros.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/include/asmacros.h ============================================================================== --- stable/8/sys/sparc64/include/asmacros.h Sat Jan 28 23:16:47 2012 (r230669) +++ stable/8/sys/sparc64/include/asmacros.h Sat Jan 28 23:16:49 2012 (r230670) @@ -76,7 +76,7 @@ 9: add r2, 1, r3 ; \ casxa [r1] ASI_N, r2, r3 ; \ cmp r2, r3 ; \ - bne,pn %icc, 9b ; \ + bne,pn %xcc, 9b ; \ mov r3, r2 /* From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:17:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09C39106566B; Sat, 28 Jan 2012 23:17:59 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E860C8FC13; Sat, 28 Jan 2012 23:17:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNHwQZ003514; Sat, 28 Jan 2012 23:17:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNHwP7003512; Sat, 28 Jan 2012 23:17:58 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282317.q0SNHwP7003512@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230671 - stable/9/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:17:59 -0000 Author: marius Date: Sat Jan 28 23:17:58 2012 New Revision: 230671 URL: http://svn.freebsd.org/changeset/base/230671 Log: MFC: r225888 Add a comment about why contrary to what once would think running all of userland with total store order actually is appropriate. Modified: stable/9/sys/sparc64/sparc64/machdep.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/9/sys/sparc64/sparc64/machdep.c Sat Jan 28 23:16:49 2012 (r230670) +++ stable/9/sys/sparc64/sparc64/machdep.c Sat Jan 28 23:17:58 2012 (r230671) @@ -1015,6 +1015,10 @@ exec_setregs(struct thread *td, struct i tf->tf_out[6] = sp - SPOFF - sizeof(struct frame); tf->tf_tnpc = imgp->entry_addr + 4; tf->tf_tpc = imgp->entry_addr; + /* + * While we could adhere to the memory model indicated in the ELF + * header, it turns out that just always using TSO performs best. + */ tf->tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_MM_TSO; td->td_retval[0] = tf->tf_out[0]; From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:18:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA4FE1065673; Sat, 28 Jan 2012 23:18:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A472F8FC0A; Sat, 28 Jan 2012 23:18:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNI2IR003552; Sat, 28 Jan 2012 23:18:02 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNI2nt003550; Sat, 28 Jan 2012 23:18:02 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282318.q0SNI2nt003550@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230672 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:18:02 -0000 Author: marius Date: Sat Jan 28 23:18:02 2012 New Revision: 230672 URL: http://svn.freebsd.org/changeset/base/230672 Log: MFC: r225888 Add a comment about why contrary to what once would think running all of userland with total store order actually is appropriate. Modified: stable/8/sys/sparc64/sparc64/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Sat Jan 28 23:17:58 2012 (r230671) +++ stable/8/sys/sparc64/sparc64/machdep.c Sat Jan 28 23:18:02 2012 (r230672) @@ -1014,6 +1014,10 @@ exec_setregs(struct thread *td, u_long e tf->tf_out[6] = sp - SPOFF - sizeof(struct frame); tf->tf_tnpc = entry + 4; tf->tf_tpc = entry; + /* + * While we could adhere to the memory model indicated in the ELF + * header, it turns out that just always using TSO performs best. + */ tf->tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_MM_TSO; td->td_retval[0] = tf->tf_out[0]; From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:24:03 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B59F8106564A; Sat, 28 Jan 2012 23:24:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 94C208FC12; Sat, 28 Jan 2012 23:24:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNO3O1003825; Sat, 28 Jan 2012 23:24:03 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNO3Qa003822; Sat, 28 Jan 2012 23:24:03 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282324.q0SNO3Qa003822@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:24:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230673 - stable/9/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:24:03 -0000 Author: marius Date: Sat Jan 28 23:24:03 2012 New Revision: 230673 URL: http://svn.freebsd.org/changeset/base/230673 Log: MFC: r225889, r228222 In total store which we use for running the kernel and all of the userland atomic operations behave as if they were followed by a CPU memory barrier so there's no need to include ones in the acquire variants of atomic(9) and it's sufficient to just use include compiler memory barriers to satisfy the requirements of atomic(9). Removing the CPU memory barriers results in a small performance improvement, specifically this is sufficient to compensate the performance loss seen in the worldstone benchmark seen when using SCHED_ULE instead of SCHED_4BSD. This change is inspired by Linux even more radically doing the equivalent thing some time ago. Thanks go to Peter Jeremy for additional testing. Modified: stable/9/sys/sparc64/include/atomic.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/atomic.h ============================================================================== --- stable/9/sys/sparc64/include/atomic.h Sat Jan 28 23:18:02 2012 (r230672) +++ stable/9/sys/sparc64/include/atomic.h Sat Jan 28 23:24:03 2012 (r230673) @@ -74,12 +74,16 @@ * * the return value of cas is used to avoid the extra reload. * - * The memory barriers provided by the acq and rel variants are intended - * to be sufficient for use of relaxed memory ordering. Due to the - * suggested assembly syntax of the membar operands containing a # - * character, they cannot be used in macros. The cmask and mmask bits + * We only include a memory barrier in the rel variants as in total store + * order which we use for running the kernel and all of the userland atomic + * loads and stores behave as if the were followed by a membar with a mask + * of #LoadLoad | #LoadStore | #StoreStore. In order to be also sufficient + * for use of relaxed memory ordering, the atomic_cas() in the acq variants + * additionally would have to be followed by a membar #LoadLoad | #LoadStore. + * Due to the suggested assembly syntax of the membar operands containing a + * # character, they cannot be used in macros. The cmask and mmask bits thus * are hard coded in machine/cpufunc.h and used here through macros. - * Hopefully sun will choose not to change the bit numbers. + * Hopefully the bit numbers won't change in the future. */ #define itype(sz) uint ## sz ## _t @@ -93,7 +97,7 @@ #define atomic_cas_acq(p, e, s, sz) ({ \ itype(sz) v; \ v = atomic_cas(p, e, s, sz); \ - membar(LoadLoad | LoadStore); \ + __asm __volatile("" : : : "memory"); \ v; \ }) @@ -118,7 +122,7 @@ #define atomic_op_acq(p, op, v, sz) ({ \ itype(sz) t; \ t = atomic_op(p, op, v, sz); \ - membar(LoadLoad | LoadStore); \ + __asm __volatile("" : : : "memory"); \ t; \ }) @@ -135,7 +139,7 @@ #define atomic_load_acq(p, sz) ({ \ itype(sz) v; \ v = atomic_load(p, sz); \ - membar(LoadLoad | LoadStore); \ + __asm __volatile("" : : : "memory"); \ v; \ }) From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:24:09 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3A92106566B; Sat, 28 Jan 2012 23:24:08 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C33658FC16; Sat, 28 Jan 2012 23:24:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNO80i003863; Sat, 28 Jan 2012 23:24:08 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNO8a3003861; Sat, 28 Jan 2012 23:24:08 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282324.q0SNO8a3003861@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230674 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:24:09 -0000 Author: marius Date: Sat Jan 28 23:24:08 2012 New Revision: 230674 URL: http://svn.freebsd.org/changeset/base/230674 Log: MFC: r225889, r228222 In total store which we use for running the kernel and all of the userland atomic operations behave as if they were followed by a CPU memory barrier so there's no need to include ones in the acquire variants of atomic(9) and it's sufficient to just use include compiler memory barriers to satisfy the requirements of atomic(9). Removing the CPU memory barriers results in a small performance improvement, specifically this is sufficient to compensate the performance loss seen in the worldstone benchmark seen when using SCHED_ULE instead of SCHED_4BSD. This change is inspired by Linux even more radically doing the equivalent thing some time ago. Thanks go to Peter Jeremy for additional testing. Modified: stable/8/sys/sparc64/include/atomic.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/include/atomic.h ============================================================================== --- stable/8/sys/sparc64/include/atomic.h Sat Jan 28 23:24:03 2012 (r230673) +++ stable/8/sys/sparc64/include/atomic.h Sat Jan 28 23:24:08 2012 (r230674) @@ -74,12 +74,16 @@ * * the return value of cas is used to avoid the extra reload. * - * The memory barriers provided by the acq and rel variants are intended - * to be sufficient for use of relaxed memory ordering. Due to the - * suggested assembly syntax of the membar operands containing a # - * character, they cannot be used in macros. The cmask and mmask bits + * We only include a memory barrier in the rel variants as in total store + * order which we use for running the kernel and all of the userland atomic + * loads and stores behave as if the were followed by a membar with a mask + * of #LoadLoad | #LoadStore | #StoreStore. In order to be also sufficient + * for use of relaxed memory ordering, the atomic_cas() in the acq variants + * additionally would have to be followed by a membar #LoadLoad | #LoadStore. + * Due to the suggested assembly syntax of the membar operands containing a + * # character, they cannot be used in macros. The cmask and mmask bits thus * are hard coded in machine/cpufunc.h and used here through macros. - * Hopefully sun will choose not to change the bit numbers. + * Hopefully the bit numbers won't change in the future. */ #define itype(sz) uint ## sz ## _t @@ -93,7 +97,7 @@ #define atomic_cas_acq(p, e, s, sz) ({ \ itype(sz) v; \ v = atomic_cas(p, e, s, sz); \ - membar(LoadLoad | LoadStore); \ + __asm __volatile("" : : : "memory"); \ v; \ }) @@ -118,7 +122,7 @@ #define atomic_op_acq(p, op, v, sz) ({ \ itype(sz) t; \ t = atomic_op(p, op, v, sz); \ - membar(LoadLoad | LoadStore); \ + __asm __volatile("" : : : "memory"); \ t; \ }) @@ -135,7 +139,7 @@ #define atomic_load_acq(p, sz) ({ \ itype(sz) v; \ v = atomic_load(p, sz); \ - membar(LoadLoad | LoadStore); \ + __asm __volatile("" : : : "memory"); \ v; \ }) From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:25:29 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 813F3106566B; Sat, 28 Jan 2012 23:25:29 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A88B8FC0C; Sat, 28 Jan 2012 23:25:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNPTBT003967; Sat, 28 Jan 2012 23:25:29 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNPTAV003965; Sat, 28 Jan 2012 23:25:29 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282325.q0SNPTAV003965@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230675 - stable/9/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:25:29 -0000 Author: marius Date: Sat Jan 28 23:25:28 2012 New Revision: 230675 URL: http://svn.freebsd.org/changeset/base/230675 Log: MFC: r225890 - Add protective parentheses to macros as far as possible. - Move {r,w,}mb() to the top of this file where they live on most of the other architectures. Modified: stable/9/sys/sparc64/include/atomic.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/include/atomic.h ============================================================================== --- stable/9/sys/sparc64/include/atomic.h Sat Jan 28 23:24:08 2012 (r230674) +++ stable/9/sys/sparc64/include/atomic.h Sat Jan 28 23:25:28 2012 (r230675) @@ -33,6 +33,10 @@ #include +#define mb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") +#define wmb() mb() +#define rmb() mb() + /* Userland needs different ASI's. */ #ifdef _KERNEL #define __ASI_ATOMIC ASI_N @@ -40,10 +44,6 @@ #define __ASI_ATOMIC ASI_P #endif -#define mb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") -#define wmb() mb() -#define rmb() mb() - /* * Various simple arithmetic on memory which is atomic in the presence * of interrupts and multiple processors. See atomic(9) for details. @@ -88,15 +88,15 @@ #define itype(sz) uint ## sz ## _t -#define atomic_cas_32(p, e, s) casa(p, e, s, __ASI_ATOMIC) -#define atomic_cas_64(p, e, s) casxa(p, e, s, __ASI_ATOMIC) +#define atomic_cas_32(p, e, s) casa((p), (e), (s), __ASI_ATOMIC) +#define atomic_cas_64(p, e, s) casxa((p), (e), (s), __ASI_ATOMIC) #define atomic_cas(p, e, s, sz) \ - atomic_cas_ ## sz(p, e, s) + atomic_cas_ ## sz((p), (e), (s)) #define atomic_cas_acq(p, e, s, sz) ({ \ itype(sz) v; \ - v = atomic_cas(p, e, s, sz); \ + v = atomic_cas((p), (e), (s), sz); \ __asm __volatile("" : : : "memory"); \ v; \ }) @@ -104,15 +104,15 @@ #define atomic_cas_rel(p, e, s, sz) ({ \ itype(sz) v; \ membar(LoadStore | StoreStore); \ - v = atomic_cas(p, e, s, sz); \ + v = atomic_cas((p), (e), (s), sz); \ v; \ }) #define atomic_op(p, op, v, sz) ({ \ itype(sz) e, r, s; \ - for (e = *(volatile itype(sz) *)p;; e = r) { \ - s = e op v; \ - r = atomic_cas_ ## sz(p, e, s); \ + for (e = *(volatile itype(sz) *)(p);; e = r) { \ + s = e op (v); \ + r = atomic_cas_ ## sz((p), e, s); \ if (r == e) \ break; \ } \ @@ -121,7 +121,7 @@ #define atomic_op_acq(p, op, v, sz) ({ \ itype(sz) t; \ - t = atomic_op(p, op, v, sz); \ + t = atomic_op((p), op, (v), sz); \ __asm __volatile("" : : : "memory"); \ t; \ }) @@ -129,24 +129,24 @@ #define atomic_op_rel(p, op, v, sz) ({ \ itype(sz) t; \ membar(LoadStore | StoreStore); \ - t = atomic_op(p, op, v, sz); \ + t = atomic_op((p), op, (v), sz); \ t; \ }) #define atomic_load(p, sz) \ - atomic_cas(p, 0, 0, sz) + atomic_cas((p), 0, 0, sz) #define atomic_load_acq(p, sz) ({ \ itype(sz) v; \ - v = atomic_load(p, sz); \ + v = atomic_load((p), sz); \ __asm __volatile("" : : : "memory"); \ v; \ }) #define atomic_load_clear(p, sz) ({ \ itype(sz) e, r; \ - for (e = *(volatile itype(sz) *)p;; e = r) { \ - r = atomic_cas(p, e, 0, sz); \ + for (e = *(volatile itype(sz) *)(p);; e = r) { \ + r = atomic_cas((p), e, 0, sz); \ if (r == e) \ break; \ } \ @@ -155,8 +155,8 @@ #define atomic_store(p, v, sz) do { \ itype(sz) e, r; \ - for (e = *(volatile itype(sz) *)p;; e = r) { \ - r = atomic_cas(p, e, v, sz); \ + for (e = *(volatile itype(sz) *)(p);; e = r) { \ + r = atomic_cas((p), e, (v), sz); \ if (r == e) \ break; \ } \ @@ -164,7 +164,7 @@ #define atomic_store_rel(p, v, sz) do { \ membar(LoadStore | StoreStore); \ - atomic_store(p, v, sz); \ + atomic_store((p), (v), sz); \ } while (0) #define ATOMIC_GEN(name, ptype, vtype, atype, sz) \ @@ -172,109 +172,109 @@ static __inline vtype \ atomic_add_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, +, v, sz)); \ + return ((vtype)atomic_op((p), +, (v), sz)); \ } \ static __inline vtype \ atomic_add_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, +, v, sz)); \ + return ((vtype)atomic_op_acq((p), +, (v), sz)); \ } \ static __inline vtype \ atomic_add_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, +, v, sz)); \ + return ((vtype)atomic_op_rel((p), +, (v), sz)); \ } \ \ static __inline vtype \ atomic_clear_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, &, ~v, sz)); \ + return ((vtype)atomic_op((p), &, ~(v), sz)); \ } \ static __inline vtype \ atomic_clear_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, &, ~v, sz)); \ + return ((vtype)atomic_op_acq((p), &, ~(v), sz)); \ } \ static __inline vtype \ atomic_clear_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, &, ~v, sz)); \ + return ((vtype)atomic_op_rel((p), &, ~(v), sz)); \ } \ \ static __inline int \ atomic_cmpset_ ## name(volatile ptype p, vtype e, vtype s) \ { \ - return (((vtype)atomic_cas(p, e, s, sz)) == e); \ + return (((vtype)atomic_cas((p), (e), (s), sz)) == (e)); \ } \ static __inline int \ atomic_cmpset_acq_ ## name(volatile ptype p, vtype e, vtype s) \ { \ - return (((vtype)atomic_cas_acq(p, e, s, sz)) == e); \ + return (((vtype)atomic_cas_acq((p), (e), (s), sz)) == (e)); \ } \ static __inline int \ atomic_cmpset_rel_ ## name(volatile ptype p, vtype e, vtype s) \ { \ - return (((vtype)atomic_cas_rel(p, e, s, sz)) == e); \ + return (((vtype)atomic_cas_rel((p), (e), (s), sz)) == (e)); \ } \ \ static __inline vtype \ atomic_load_ ## name(volatile ptype p) \ { \ - return ((vtype)atomic_cas(p, 0, 0, sz)); \ + return ((vtype)atomic_cas((p), 0, 0, sz)); \ } \ static __inline vtype \ atomic_load_acq_ ## name(volatile ptype p) \ { \ - return ((vtype)atomic_cas_acq(p, 0, 0, sz)); \ + return ((vtype)atomic_cas_acq((p), 0, 0, sz)); \ } \ \ static __inline vtype \ atomic_readandclear_ ## name(volatile ptype p) \ { \ - return ((vtype)atomic_load_clear(p, sz)); \ + return ((vtype)atomic_load_clear((p), sz)); \ } \ \ static __inline vtype \ atomic_set_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, |, v, sz)); \ + return ((vtype)atomic_op((p), |, (v), sz)); \ } \ static __inline vtype \ atomic_set_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, |, v, sz)); \ + return ((vtype)atomic_op_acq((p), |, (v), sz)); \ } \ static __inline vtype \ atomic_set_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, |, v, sz)); \ + return ((vtype)atomic_op_rel((p), |, (v), sz)); \ } \ \ static __inline vtype \ atomic_subtract_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, -, v, sz)); \ + return ((vtype)atomic_op((p), -, (v), sz)); \ } \ static __inline vtype \ atomic_subtract_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, -, v, sz)); \ + return ((vtype)atomic_op_acq((p), -, (v), sz)); \ } \ static __inline vtype \ atomic_subtract_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, -, v, sz)); \ + return ((vtype)atomic_op_rel((p), -, (v), sz)); \ } \ \ static __inline void \ atomic_store_ ## name(volatile ptype p, vtype v) \ { \ - atomic_store(p, v, sz); \ + atomic_store((p), (v), sz); \ } \ static __inline void \ atomic_store_rel_ ## name(volatile ptype p, vtype v) \ { \ - atomic_store_rel(p, v, sz); \ + atomic_store_rel((p), (v), sz); \ } ATOMIC_GEN(int, u_int *, u_int, u_int, 32); From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:25:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D9E7106564A; Sat, 28 Jan 2012 23:25:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 063858FC08; Sat, 28 Jan 2012 23:25:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNPV37004000; Sat, 28 Jan 2012 23:25:31 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNPV98003998; Sat, 28 Jan 2012 23:25:31 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282325.q0SNPV98003998@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:25:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230676 - stable/8/sys/sparc64/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:25:32 -0000 Author: marius Date: Sat Jan 28 23:25:31 2012 New Revision: 230676 URL: http://svn.freebsd.org/changeset/base/230676 Log: MFC: r225890 - Add protective parentheses to macros as far as possible. - Move {r,w,}mb() to the top of this file where they live on most of the other architectures. Modified: stable/8/sys/sparc64/include/atomic.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/include/atomic.h ============================================================================== --- stable/8/sys/sparc64/include/atomic.h Sat Jan 28 23:25:28 2012 (r230675) +++ stable/8/sys/sparc64/include/atomic.h Sat Jan 28 23:25:31 2012 (r230676) @@ -33,6 +33,10 @@ #include +#define mb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") +#define wmb() mb() +#define rmb() mb() + /* Userland needs different ASI's. */ #ifdef _KERNEL #define __ASI_ATOMIC ASI_N @@ -40,10 +44,6 @@ #define __ASI_ATOMIC ASI_P #endif -#define mb() __asm__ __volatile__ ("membar #MemIssue": : :"memory") -#define wmb() mb() -#define rmb() mb() - /* * Various simple arithmetic on memory which is atomic in the presence * of interrupts and multiple processors. See atomic(9) for details. @@ -88,15 +88,15 @@ #define itype(sz) uint ## sz ## _t -#define atomic_cas_32(p, e, s) casa(p, e, s, __ASI_ATOMIC) -#define atomic_cas_64(p, e, s) casxa(p, e, s, __ASI_ATOMIC) +#define atomic_cas_32(p, e, s) casa((p), (e), (s), __ASI_ATOMIC) +#define atomic_cas_64(p, e, s) casxa((p), (e), (s), __ASI_ATOMIC) #define atomic_cas(p, e, s, sz) \ - atomic_cas_ ## sz(p, e, s) + atomic_cas_ ## sz((p), (e), (s)) #define atomic_cas_acq(p, e, s, sz) ({ \ itype(sz) v; \ - v = atomic_cas(p, e, s, sz); \ + v = atomic_cas((p), (e), (s), sz); \ __asm __volatile("" : : : "memory"); \ v; \ }) @@ -104,15 +104,15 @@ #define atomic_cas_rel(p, e, s, sz) ({ \ itype(sz) v; \ membar(LoadStore | StoreStore); \ - v = atomic_cas(p, e, s, sz); \ + v = atomic_cas((p), (e), (s), sz); \ v; \ }) #define atomic_op(p, op, v, sz) ({ \ itype(sz) e, r, s; \ - for (e = *(volatile itype(sz) *)p;; e = r) { \ - s = e op v; \ - r = atomic_cas_ ## sz(p, e, s); \ + for (e = *(volatile itype(sz) *)(p);; e = r) { \ + s = e op (v); \ + r = atomic_cas_ ## sz((p), e, s); \ if (r == e) \ break; \ } \ @@ -121,7 +121,7 @@ #define atomic_op_acq(p, op, v, sz) ({ \ itype(sz) t; \ - t = atomic_op(p, op, v, sz); \ + t = atomic_op((p), op, (v), sz); \ __asm __volatile("" : : : "memory"); \ t; \ }) @@ -129,24 +129,24 @@ #define atomic_op_rel(p, op, v, sz) ({ \ itype(sz) t; \ membar(LoadStore | StoreStore); \ - t = atomic_op(p, op, v, sz); \ + t = atomic_op((p), op, (v), sz); \ t; \ }) #define atomic_load(p, sz) \ - atomic_cas(p, 0, 0, sz) + atomic_cas((p), 0, 0, sz) #define atomic_load_acq(p, sz) ({ \ itype(sz) v; \ - v = atomic_load(p, sz); \ + v = atomic_load((p), sz); \ __asm __volatile("" : : : "memory"); \ v; \ }) #define atomic_load_clear(p, sz) ({ \ itype(sz) e, r; \ - for (e = *(volatile itype(sz) *)p;; e = r) { \ - r = atomic_cas(p, e, 0, sz); \ + for (e = *(volatile itype(sz) *)(p);; e = r) { \ + r = atomic_cas((p), e, 0, sz); \ if (r == e) \ break; \ } \ @@ -155,8 +155,8 @@ #define atomic_store(p, v, sz) do { \ itype(sz) e, r; \ - for (e = *(volatile itype(sz) *)p;; e = r) { \ - r = atomic_cas(p, e, v, sz); \ + for (e = *(volatile itype(sz) *)(p);; e = r) { \ + r = atomic_cas((p), e, (v), sz); \ if (r == e) \ break; \ } \ @@ -164,7 +164,7 @@ #define atomic_store_rel(p, v, sz) do { \ membar(LoadStore | StoreStore); \ - atomic_store(p, v, sz); \ + atomic_store((p), (v), sz); \ } while (0) #define ATOMIC_GEN(name, ptype, vtype, atype, sz) \ @@ -172,109 +172,109 @@ static __inline vtype \ atomic_add_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, +, v, sz)); \ + return ((vtype)atomic_op((p), +, (v), sz)); \ } \ static __inline vtype \ atomic_add_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, +, v, sz)); \ + return ((vtype)atomic_op_acq((p), +, (v), sz)); \ } \ static __inline vtype \ atomic_add_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, +, v, sz)); \ + return ((vtype)atomic_op_rel((p), +, (v), sz)); \ } \ \ static __inline vtype \ atomic_clear_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, &, ~v, sz)); \ + return ((vtype)atomic_op((p), &, ~(v), sz)); \ } \ static __inline vtype \ atomic_clear_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, &, ~v, sz)); \ + return ((vtype)atomic_op_acq((p), &, ~(v), sz)); \ } \ static __inline vtype \ atomic_clear_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, &, ~v, sz)); \ + return ((vtype)atomic_op_rel((p), &, ~(v), sz)); \ } \ \ static __inline int \ atomic_cmpset_ ## name(volatile ptype p, vtype e, vtype s) \ { \ - return (((vtype)atomic_cas(p, e, s, sz)) == e); \ + return (((vtype)atomic_cas((p), (e), (s), sz)) == (e)); \ } \ static __inline int \ atomic_cmpset_acq_ ## name(volatile ptype p, vtype e, vtype s) \ { \ - return (((vtype)atomic_cas_acq(p, e, s, sz)) == e); \ + return (((vtype)atomic_cas_acq((p), (e), (s), sz)) == (e)); \ } \ static __inline int \ atomic_cmpset_rel_ ## name(volatile ptype p, vtype e, vtype s) \ { \ - return (((vtype)atomic_cas_rel(p, e, s, sz)) == e); \ + return (((vtype)atomic_cas_rel((p), (e), (s), sz)) == (e)); \ } \ \ static __inline vtype \ atomic_load_ ## name(volatile ptype p) \ { \ - return ((vtype)atomic_cas(p, 0, 0, sz)); \ + return ((vtype)atomic_cas((p), 0, 0, sz)); \ } \ static __inline vtype \ atomic_load_acq_ ## name(volatile ptype p) \ { \ - return ((vtype)atomic_cas_acq(p, 0, 0, sz)); \ + return ((vtype)atomic_cas_acq((p), 0, 0, sz)); \ } \ \ static __inline vtype \ atomic_readandclear_ ## name(volatile ptype p) \ { \ - return ((vtype)atomic_load_clear(p, sz)); \ + return ((vtype)atomic_load_clear((p), sz)); \ } \ \ static __inline vtype \ atomic_set_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, |, v, sz)); \ + return ((vtype)atomic_op((p), |, (v), sz)); \ } \ static __inline vtype \ atomic_set_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, |, v, sz)); \ + return ((vtype)atomic_op_acq((p), |, (v), sz)); \ } \ static __inline vtype \ atomic_set_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, |, v, sz)); \ + return ((vtype)atomic_op_rel((p), |, (v), sz)); \ } \ \ static __inline vtype \ atomic_subtract_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op(p, -, v, sz)); \ + return ((vtype)atomic_op((p), -, (v), sz)); \ } \ static __inline vtype \ atomic_subtract_acq_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_acq(p, -, v, sz)); \ + return ((vtype)atomic_op_acq((p), -, (v), sz)); \ } \ static __inline vtype \ atomic_subtract_rel_ ## name(volatile ptype p, atype v) \ { \ - return ((vtype)atomic_op_rel(p, -, v, sz)); \ + return ((vtype)atomic_op_rel((p), -, (v), sz)); \ } \ \ static __inline void \ atomic_store_ ## name(volatile ptype p, vtype v) \ { \ - atomic_store(p, v, sz); \ + atomic_store((p), (v), sz); \ } \ static __inline void \ atomic_store_rel_ ## name(volatile ptype p, vtype v) \ { \ - atomic_store_rel(p, v, sz); \ + atomic_store_rel((p), (v), sz); \ } ATOMIC_GEN(int, u_int *, u_int, u_int, 32); From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:26:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 749031065670; Sat, 28 Jan 2012 23:26:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43F738FC14; Sat, 28 Jan 2012 23:26:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNQpgv004108; Sat, 28 Jan 2012 23:26:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNQp4s004106; Sat, 28 Jan 2012 23:26:51 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282326.q0SNQp4s004106@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230677 - stable/9/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:26:51 -0000 Author: marius Date: Sat Jan 28 23:26:50 2012 New Revision: 230677 URL: http://svn.freebsd.org/changeset/base/230677 Log: MFC: r225891 Re-reading the Schizo errata suggests that it's actually tolerable to also use the streaming buffer of pre version 5/revision 2.3 hardware as long as we stay away from context flushes (which iommu(4) so far doesn't take advantage of). OpenSolaris does the same. Modified: stable/9/sys/sparc64/pci/schizo.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/pci/schizo.c ============================================================================== --- stable/9/sys/sparc64/pci/schizo.c Sat Jan 28 23:25:31 2012 (r230676) +++ stable/9/sys/sparc64/pci/schizo.c Sat Jan 28 23:26:50 2012 (r230677) @@ -500,7 +500,8 @@ schizo_attach(device_t dev) * Set up the IOMMU. Schizo, Tomatillo and XMITS all have * one per PBM. Schizo and XMITS additionally have a streaming * buffer, in Schizo version < 5 (i.e. revision < 2.3) it's - * affected by several errata and basically unusable though. + * affected by several errata though. However, except for context + * flushes, taking advantage of it should be okay even with those. */ memcpy(&sc->sc_dma_methods, &iommu_dma_methods, sizeof(sc->sc_dma_methods)); @@ -508,8 +509,7 @@ schizo_attach(device_t dev) sc->sc_is.sis_is.is_flags = IOMMU_PRESERVE_PROM; sc->sc_is.sis_is.is_pmaxaddr = IOMMU_MAXADDR(STX_IOMMU_BITS); sc->sc_is.sis_is.is_sb[0] = sc->sc_is.sis_is.is_sb[1] = 0; - if (OF_getproplen(node, "no-streaming-cache") < 0 && - !(sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver < 5)) + if (OF_getproplen(node, "no-streaming-cache") < 0) sc->sc_is.sis_is.is_sb[0] = STX_PCI_STRBUF; #define TSBCASE(x) \ From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:26:56 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D87B1065673; Sat, 28 Jan 2012 23:26:56 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67AB28FC0A; Sat, 28 Jan 2012 23:26:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNQuWV004145; Sat, 28 Jan 2012 23:26:56 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNQug5004143; Sat, 28 Jan 2012 23:26:56 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282326.q0SNQug5004143@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230678 - stable/8/sys/sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:26:56 -0000 Author: marius Date: Sat Jan 28 23:26:55 2012 New Revision: 230678 URL: http://svn.freebsd.org/changeset/base/230678 Log: MFC: r225891 Re-reading the Schizo errata suggests that it's actually tolerable to also use the streaming buffer of pre version 5/revision 2.3 hardware as long as we stay away from context flushes (which iommu(4) so far doesn't take advantage of). OpenSolaris does the same. Modified: stable/8/sys/sparc64/pci/schizo.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/pci/schizo.c ============================================================================== --- stable/8/sys/sparc64/pci/schizo.c Sat Jan 28 23:26:50 2012 (r230677) +++ stable/8/sys/sparc64/pci/schizo.c Sat Jan 28 23:26:55 2012 (r230678) @@ -501,7 +501,8 @@ schizo_attach(device_t dev) * Set up the IOMMU. Schizo, Tomatillo and XMITS all have * one per PBM. Schizo and XMITS additionally have a streaming * buffer, in Schizo version < 5 (i.e. revision < 2.3) it's - * affected by several errata and basically unusable though. + * affected by several errata though. However, except for context + * flushes, taking advantage of it should be okay even with those. */ memcpy(&sc->sc_dma_methods, &iommu_dma_methods, sizeof(sc->sc_dma_methods)); @@ -509,8 +510,7 @@ schizo_attach(device_t dev) sc->sc_is.sis_is.is_flags = IOMMU_PRESERVE_PROM; sc->sc_is.sis_is.is_pmaxaddr = IOMMU_MAXADDR(STX_IOMMU_BITS); sc->sc_is.sis_is.is_sb[0] = sc->sc_is.sis_is.is_sb[1] = 0; - if (OF_getproplen(node, "no-streaming-cache") < 0 && - !(sc->sc_mode == SCHIZO_MODE_SCZ && sc->sc_ver < 5)) + if (OF_getproplen(node, "no-streaming-cache") < 0) sc->sc_is.sis_is.is_sb[0] = STX_PCI_STRBUF; #define TSBCASE(x) \ From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:30:39 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBFF91065670; Sat, 28 Jan 2012 23:30:39 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C741B8FC0C; Sat, 28 Jan 2012 23:30:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNUdV6004342; Sat, 28 Jan 2012 23:30:39 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNUdJx004339; Sat, 28 Jan 2012 23:30:39 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <201201282330.q0SNUdJx004339@svn.freebsd.org> From: Kip Macy Date: Sat, 28 Jan 2012 23:30:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230679 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:30:40 -0000 Author: kmacy Date: Sat Jan 28 23:30:39 2012 New Revision: 230679 URL: http://svn.freebsd.org/changeset/base/230679 Log: update .Dd Modified: head/share/man/man9/malloc.9 head/share/man/man9/vm_page_alloc.9 Modified: head/share/man/man9/malloc.9 ============================================================================== --- head/share/man/man9/malloc.9 Sat Jan 28 23:26:55 2012 (r230678) +++ head/share/man/man9/malloc.9 Sat Jan 28 23:30:39 2012 (r230679) @@ -29,7 +29,7 @@ .\" $NetBSD: malloc.9,v 1.3 1996/11/11 00:05:11 lukem Exp $ .\" $FreeBSD$ .\" -.Dd October 23, 2008 +.Dd January 28, 2012 .Dt MALLOC 9 .Os .Sh NAME Modified: head/share/man/man9/vm_page_alloc.9 ============================================================================== --- head/share/man/man9/vm_page_alloc.9 Sat Jan 28 23:26:55 2012 (r230678) +++ head/share/man/man9/vm_page_alloc.9 Sat Jan 28 23:30:39 2012 (r230679) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2010 +.Dd January 28, 2012 .Dt VM_PAGE_ALLOC 9 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:33:51 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4911A1065674; Sat, 28 Jan 2012 23:33:51 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3338B8FC15; Sat, 28 Jan 2012 23:33:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNXpdh004490; Sat, 28 Jan 2012 23:33:51 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNXoYX004488; Sat, 28 Jan 2012 23:33:50 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282333.q0SNXoYX004488@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:33:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230680 - stable/9/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:33:51 -0000 Author: marius Date: Sat Jan 28 23:33:50 2012 New Revision: 230680 URL: http://svn.freebsd.org/changeset/base/230680 Log: MFC: r225899 Also allocate space for the PIL counters. Given that no machine actually uses IV_MAX interrupt vectors this wasn't a problem in practice though. Modified: stable/9/sys/sparc64/sparc64/exception.S Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/9/sys/sparc64/sparc64/exception.S Sat Jan 28 23:30:39 2012 (r230679) +++ stable/9/sys/sparc64/sparc64/exception.S Sat Jan 28 23:33:50 2012 (r230680) @@ -373,15 +373,15 @@ END(rsf_fatal) _ALIGN_DATA .globl intrnames, sintrnames intrnames: - .space IV_MAX * (MAXCOMLEN + 1) + .space (IV_MAX + PIL_MAX) * (MAXCOMLEN + 1) sintrnames: - .quad IV_MAX * (MAXCOMLEN + 1) + .quad (IV_MAX + PIL_MAX) * (MAXCOMLEN + 1) .globl intrcnt, sintrcnt intrcnt: - .space IV_MAX * 8 + .space (IV_MAX + PIL_MAX) * 8 sintrcnt: - .quad IV_MAX * 8 + .quad (IV_MAX + PIL_MAX) * 8 .text From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:33:54 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 145DD106566B; Sat, 28 Jan 2012 23:33:54 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F297B8FC17; Sat, 28 Jan 2012 23:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNXrTa004525; Sat, 28 Jan 2012 23:33:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNXraS004523; Sat, 28 Jan 2012 23:33:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282333.q0SNXraS004523@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230681 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:33:54 -0000 Author: marius Date: Sat Jan 28 23:33:53 2012 New Revision: 230681 URL: http://svn.freebsd.org/changeset/base/230681 Log: MFC: r225899 Also allocate space for the PIL counters. Given that no machine actually uses IV_MAX interrupt vectors this wasn't a problem in practice though. Modified: stable/8/sys/sparc64/sparc64/exception.S Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sparc64/exception.S ============================================================================== --- stable/8/sys/sparc64/sparc64/exception.S Sat Jan 28 23:33:50 2012 (r230680) +++ stable/8/sys/sparc64/sparc64/exception.S Sat Jan 28 23:33:53 2012 (r230681) @@ -373,11 +373,11 @@ END(rsf_fatal) _ALIGN_DATA .globl intrnames, eintrnames intrnames: - .space IV_MAX * (MAXCOMLEN + 1) + .space (IV_MAX + PIL_MAX) * (MAXCOMLEN + 1) eintrnames: .globl intrcnt, eintrcnt intrcnt: - .space IV_MAX * 8 + .space (IV_MAX + PIL_MAX) * 8 eintrcnt: .text From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:35:24 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C76A51065672; Sat, 28 Jan 2012 23:35:24 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B08188FC08; Sat, 28 Jan 2012 23:35:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNZO7l004626; Sat, 28 Jan 2012 23:35:24 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNZOCd004624; Sat, 28 Jan 2012 23:35:24 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282335.q0SNZOCd004624@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:35:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230682 - stable/9/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:35:24 -0000 Author: marius Date: Sat Jan 28 23:35:24 2012 New Revision: 230682 URL: http://svn.freebsd.org/changeset/base/230682 Log: MFC: r225900 Nuke SUN4U #ifdef's which with the demise of sun4v no longer serve any purpose. Modified: stable/9/sys/sparc64/sparc64/genassym.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/sparc64/genassym.c ============================================================================== --- stable/9/sys/sparc64/sparc64/genassym.c Sat Jan 28 23:33:53 2012 (r230681) +++ stable/9/sys/sparc64/sparc64/genassym.c Sat Jan 28 23:35:24 2012 (r230682) @@ -43,9 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef SUN4U #include -#endif #include #include #include @@ -62,9 +60,7 @@ ASSYM(TAR_VPN_SHIFT, TAR_VPN_SHIFT); ASSYM(_NCPUBITS, _NCPUBITS); -#ifdef SUN4U ASSYM(TLB_DEMAP_ALL, TLB_DEMAP_ALL); -#endif ASSYM(TLB_DEMAP_CONTEXT, TLB_DEMAP_CONTEXT); ASSYM(TLB_DEMAP_NUCLEUS, TLB_DEMAP_NUCLEUS); ASSYM(TLB_DEMAP_PAGE, TLB_DEMAP_PAGE); @@ -82,21 +78,17 @@ ASSYM(PAGE_SIZE_4M, PAGE_SIZE_4M); #ifdef SMP ASSYM(CSA_PCPU, offsetof(struct cpu_start_args, csa_pcpu)); ASSYM(CSA_STATE, offsetof(struct cpu_start_args, csa_state)); -#ifdef SUN4U ASSYM(CSA_MID, offsetof(struct cpu_start_args, csa_mid)); ASSYM(CSA_STICK, offsetof(struct cpu_start_args, csa_stick)); ASSYM(CSA_TICK, offsetof(struct cpu_start_args, csa_tick)); ASSYM(CSA_TTES, offsetof(struct cpu_start_args, csa_ttes)); ASSYM(CSA_VER, offsetof(struct cpu_start_args, csa_ver)); #endif -#endif -#ifdef SUN4U ASSYM(DC_SIZE, offsetof(struct cacheinfo, dc_size)); ASSYM(DC_LINESIZE, offsetof(struct cacheinfo, dc_linesize)); ASSYM(IC_SIZE, offsetof(struct cacheinfo, ic_size)); ASSYM(IC_LINESIZE, offsetof(struct cacheinfo, ic_linesize)); -#endif ASSYM(KTR_SIZEOF, sizeof(struct ktr_entry)); ASSYM(KTR_LINE, offsetof(struct ktr_entry, ktr_line)); @@ -112,7 +104,6 @@ ASSYM(KTR_PARM5, offsetof(struct ktr_ent ASSYM(KTR_PARM6, offsetof(struct ktr_entry, ktr_parms[5])); ASSYM(TTE_SHIFT, TTE_SHIFT); -#ifdef SUN4U ASSYM(TTE_VPN, offsetof(struct tte, tte_vpn)); ASSYM(TTE_DATA, offsetof(struct tte, tte_data)); @@ -132,7 +123,6 @@ ASSYM(TLB_CXR_PGSZ_MASK, TLB_CXR_PGSZ_MA ASSYM(TLB_DIRECT_ADDRESS_MASK, TLB_DIRECT_ADDRESS_MASK); ASSYM(TLB_DIRECT_TO_TTE_MASK, TLB_DIRECT_TO_TTE_MASK); ASSYM(TV_SIZE_BITS, TV_SIZE_BITS); -#endif ASSYM(V_INTR, offsetof(struct vmmeter, v_intr)); @@ -146,14 +136,12 @@ ASSYM(PC_IRFREE, offsetof(struct pcpu, p ASSYM(PC_CNT, offsetof(struct pcpu, pc_cnt)); ASSYM(PC_SIZEOF, sizeof(struct pcpu)); -#ifdef SUN4U ASSYM(PC_CACHE, offsetof(struct pcpu, pc_cache)); ASSYM(PC_MID, offsetof(struct pcpu, pc_mid)); ASSYM(PC_PMAP, offsetof(struct pcpu, pc_pmap)); ASSYM(PC_TLB_CTX, offsetof(struct pcpu, pc_tlb_ctx)); ASSYM(PC_TLB_CTX_MAX, offsetof(struct pcpu, pc_tlb_ctx_max)); ASSYM(PC_TLB_CTX_MIN, offsetof(struct pcpu, pc_tlb_ctx_min)); -#endif ASSYM(IR_NEXT, offsetof(struct intr_request, ir_next)); ASSYM(IR_FUNC, offsetof(struct intr_request, ir_func)); @@ -161,7 +149,7 @@ ASSYM(IR_ARG, offsetof(struct intr_reque ASSYM(IR_PRI, offsetof(struct intr_request, ir_pri)); ASSYM(IR_VEC, offsetof(struct intr_request, ir_vec)); -#if defined(SUN4U) && defined(SMP) +#ifdef SMP ASSYM(ICA_PA, offsetof(struct ipi_cache_args, ica_pa)); ASSYM(IRA_MASK, offsetof(struct ipi_rd_args, ira_mask)); @@ -239,14 +227,12 @@ ASSYM(TF_FPRS, offsetof(struct trapframe ASSYM(TF_FSR, offsetof(struct trapframe, tf_fsr)); ASSYM(TF_GSR, offsetof(struct trapframe, tf_gsr)); ASSYM(TF_PIL, offsetof(struct trapframe, tf_pil)); -#ifdef SUN4U ASSYM(TF_LEVEL, offsetof(struct trapframe, tf_level)); ASSYM(TF_SFAR, offsetof(struct trapframe, tf_sfar)); ASSYM(TF_SFSR, offsetof(struct trapframe, tf_sfsr)); ASSYM(TF_TAR, offsetof(struct trapframe, tf_tar)); ASSYM(TF_TYPE, offsetof(struct trapframe, tf_type)); ASSYM(TF_Y, offsetof(struct trapframe, tf_y)); -#endif ASSYM(TF_TNPC, offsetof(struct trapframe, tf_tnpc)); ASSYM(TF_TPC, offsetof(struct trapframe, tf_tpc)); ASSYM(TF_TSTATE, offsetof(struct trapframe, tf_tstate)); From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:37:05 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D6771065672; Sat, 28 Jan 2012 23:37:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 682238FC12; Sat, 28 Jan 2012 23:37:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNb5PZ004755; Sat, 28 Jan 2012 23:37:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNb5ke004752; Sat, 28 Jan 2012 23:37:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282337.q0SNb5ke004752@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230683 - stable/9/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:37:05 -0000 Author: marius Date: Sat Jan 28 23:37:04 2012 New Revision: 230683 URL: http://svn.freebsd.org/changeset/base/230683 Log: MFC: r225901 Remove obsolete macros. Modified: stable/9/sys/sparc64/sparc64/pmap.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/9/sys/sparc64/sparc64/pmap.c Sat Jan 28 23:35:24 2012 (r230682) +++ stable/9/sys/sparc64/sparc64/pmap.c Sat Jan 28 23:37:04 2012 (r230683) @@ -100,12 +100,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define PMAP_DEBUG - -#ifndef PMAP_SHPGPERPROC -#define PMAP_SHPGPERPROC 200 -#endif - /* XXX */ #include "opt_sched.h" #ifndef SCHED_4BSD From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:37:06 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 375F6106564A; Sat, 28 Jan 2012 23:37:06 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 21D448FC13; Sat, 28 Jan 2012 23:37:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNb5nV004770; Sat, 28 Jan 2012 23:37:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNb59n004768; Sat, 28 Jan 2012 23:37:05 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282337.q0SNb59n004768@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:37:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230684 - stable/8/sys/sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:37:06 -0000 Author: marius Date: Sat Jan 28 23:37:05 2012 New Revision: 230684 URL: http://svn.freebsd.org/changeset/base/230684 Log: MFC: r225901 Remove obsolete macros. Modified: stable/8/sys/sparc64/sparc64/pmap.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sparc64/sparc64/pmap.c ============================================================================== --- stable/8/sys/sparc64/sparc64/pmap.c Sat Jan 28 23:37:04 2012 (r230683) +++ stable/8/sys/sparc64/sparc64/pmap.c Sat Jan 28 23:37:05 2012 (r230684) @@ -100,12 +100,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define PMAP_DEBUG - -#ifndef PMAP_SHPGPERPROC -#define PMAP_SHPGPERPROC 200 -#endif - /* XXX */ #include "opt_sched.h" #ifndef SCHED_4BSD From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:45:32 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FA6C106564A; Sat, 28 Jan 2012 23:45:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67DB58FC12; Sat, 28 Jan 2012 23:45:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNjWDA005129; Sat, 28 Jan 2012 23:45:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNjWCN005121; Sat, 28 Jan 2012 23:45:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282345.q0SNjWCN005121@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230685 - in stable/8/sys: conf dev/uart sparc64/conf sparc64/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:45:32 -0000 Author: marius Date: Sat Jan 28 23:45:31 2012 New Revision: 230685 URL: http://svn.freebsd.org/changeset/base/230685 Log: MFC: r206451, r206453 Add sbbc(4), a driver for the BootBus controller found in Serengeti and StarCat systems which provides time-of-day services for both as well as console service for Serengeti, i.e. Sun Fire V1280. While the latter is described with a device type of serial in the OFW device tree, it isn't actually an UART. Nevertheless the console service is handled by uart(4) as this allowed to re-use quite a bit of MD and MI code. Actually, this idea is stolen from Linux which interfaces the sun4v hypervisor console with the Linux counterpart of uart(4). Added: stable/8/sys/sparc64/pci/sbbc.c - copied, changed from r206451, head/sys/sparc64/pci/sbbc.c Modified: stable/8/sys/conf/files.sparc64 stable/8/sys/dev/uart/uart.h stable/8/sys/dev/uart/uart_cpu_sparc64.c stable/8/sys/sparc64/conf/GENERIC stable/8/sys/sparc64/conf/NOTES Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/files.sparc64 ============================================================================== --- stable/8/sys/conf/files.sparc64 Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/conf/files.sparc64 Sat Jan 28 23:45:31 2012 (r230685) @@ -81,6 +81,7 @@ sparc64/pci/ofw_pcib_subr.c optional pci sparc64/pci/ofw_pcibus.c optional pci sparc64/pci/ofw_pci_if.m optional pci sparc64/pci/psycho.c optional pci +sparc64/pci/sbbc.c optional uart sbbc sparc64/pci/schizo.c optional pci sparc64/sbus/dma_sbus.c optional sbus sparc64/sbus/sbus.c optional sbus Modified: stable/8/sys/dev/uart/uart.h ============================================================================== --- stable/8/sys/dev/uart/uart.h Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/dev/uart/uart.h Sat Jan 28 23:45:31 2012 (r230685) @@ -67,6 +67,7 @@ struct uart_class; extern struct uart_class uart_ns8250_class __attribute__((weak)); extern struct uart_class uart_quicc_class __attribute__((weak)); extern struct uart_class uart_sab82532_class __attribute__((weak)); +extern struct uart_class uart_sbbc_class __attribute__((weak)); extern struct uart_class uart_z8530_class __attribute__((weak)); #ifdef PC98 Modified: stable/8/sys/dev/uart/uart_cpu_sparc64.c ============================================================================== --- stable/8/sys/dev/uart/uart_cpu_sparc64.c Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/dev/uart/uart_cpu_sparc64.c Sat Jan 28 23:45:31 2012 (r230685) @@ -133,6 +133,14 @@ uart_cpu_getdev_console(phandle_t option return (-1); if (strcmp(buf, "serial") != 0) return (-1); + /* For a Serengeti console device point to the bootbus controller. */ + if (OF_getprop(input, "name", buf, sizeof(buf)) > 0 && + !strcmp(buf, "sgcn")) { + if ((chosen = OF_finddevice("/chosen")) == -1) + return (-1); + if (OF_getprop(chosen, "iosram", &input, sizeof(input)) == -1) + return (-1); + } return (input); } @@ -259,6 +267,9 @@ uart_cpu_getdev(int devtype, struct uart !strcmp(compat, "su16552")) { class = &uart_ns8250_class; di->bas.chan = 0; + } else if (!strcmp(compat, "sgsbbc")) { + class = &uart_sbbc_class; + di->bas.chan = 0; } if (class == NULL) return (ENXIO); Modified: stable/8/sys/sparc64/conf/GENERIC ============================================================================== --- stable/8/sys/sparc64/conf/GENERIC Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/sparc64/conf/GENERIC Sat Jan 28 23:45:31 2012 (r230685) @@ -146,6 +146,9 @@ device mk48txx # Mostek MK48Txx clocks device rtc # rtc (really a front-end for the MC146818) device mc146818 # Motorola MC146818 and compatible clocks device epic # Sun Fire V215/V245 LEDs +device sbbc # Sun BootBus controller (time-of-day clock for + # Serengeti and StarCat, console for Serengeti, + # requires device uart) # Serial (COM) ports device puc # Multi-channel uarts Modified: stable/8/sys/sparc64/conf/NOTES ============================================================================== --- stable/8/sys/sparc64/conf/NOTES Sat Jan 28 23:37:05 2012 (r230684) +++ stable/8/sys/sparc64/conf/NOTES Sat Jan 28 23:45:31 2012 (r230685) @@ -37,6 +37,7 @@ device eeprom # eeprom (really a front device mk48txx # Mostek MK48Txx clocks device rtc # rtc (really a front-end for the MC146818) device mc146818 # Motorola MC146818 and compatible clocks +device sbbc # Sun BootBus controller # # Optional devices: Copied and modified: stable/8/sys/sparc64/pci/sbbc.c (from r206451, head/sys/sparc64/pci/sbbc.c) ============================================================================== --- head/sys/sparc64/pci/sbbc.c Sat Apr 10 11:52:12 2010 (r206451, copy source) +++ stable/8/sys/sparc64/pci/sbbc.c Sat Jan 28 23:45:31 2012 (r230685) @@ -1,5 +1,5 @@ /* $OpenBSD: sbbc.c,v 1.7 2009/11/09 17:53:39 nicm Exp $ */ -/* +/*- * Copyright (c) 2008 Mark Kettenis * * Permission to use, copy, modify, and distribute this software for any From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:46:37 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58CA4106564A; Sat, 28 Jan 2012 23:46:37 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 378B08FC08; Sat, 28 Jan 2012 23:46:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNkbrF005215; Sat, 28 Jan 2012 23:46:37 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNkb26005212; Sat, 28 Jan 2012 23:46:37 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282346.q0SNkb26005212@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:46:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230686 - in stable/8/sys: conf sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:46:37 -0000 Author: marius Date: Sat Jan 28 23:46:36 2012 New Revision: 230686 URL: http://svn.freebsd.org/changeset/base/230686 Log: MFC: r203845 Add ssm(4), which serves as a glue device allowing devices beneath the scalable shared memory node, which is used in large UltraSPARC III based machines to group snooping-coherency domains together, like schizo(4) to be treated like nexus(4) children. Added: stable/8/sys/sparc64/sparc64/ssm.c - copied unchanged from r203845, head/sys/sparc64/sparc64/ssm.c Modified: stable/8/sys/conf/files.sparc64 Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/conf/files.sparc64 ============================================================================== --- stable/8/sys/conf/files.sparc64 Sat Jan 28 23:45:31 2012 (r230685) +++ stable/8/sys/conf/files.sparc64 Sat Jan 28 23:46:36 2012 (r230686) @@ -128,6 +128,7 @@ sparc64/sparc64/rwindow.c standard sparc64/sparc64/sc_machdep.c optional sc sparc64/sparc64/schppm.c standard sparc64/sparc64/spitfire.c standard +sparc64/sparc64/ssm.c standard sparc64/sparc64/stack_machdep.c optional ddb | stack sparc64/sparc64/support.S standard \ compile-with "${NORMAL_S} -mcpu=ultrasparc" Copied: stable/8/sys/sparc64/sparc64/ssm.c (from r203845, head/sys/sparc64/sparc64/ssm.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/sparc64/sparc64/ssm.c Sat Jan 28 23:46:36 2012 (r230686, copy of r203845, head/sys/sparc64/sparc64/ssm.c) @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2010 Marius Strobl + * 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$"); + +/* + * Glue allowing devices beneath the scalable shared memory node to be + * treated like nexus(4) children + */ + +#include +#include +#include +#include +#include + +#include + +#include + +static device_probe_t ssm_probe; + +static device_method_t ssm_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ssm_probe), + + /* Bus interface */ + + /* ofw_bus interface */ + + KOBJMETHOD_END +}; + +static devclass_t ssm_devclass; + +DEFINE_CLASS_1(ssm, ssm_driver, ssm_methods, 1 /* no softc */, nexus_driver); +EARLY_DRIVER_MODULE(ssm, nexus, ssm_driver, ssm_devclass, 0, 0, BUS_PASS_BUS); +MODULE_DEPEND(ssm, nexus, 1, 1, 1); +MODULE_VERSION(ssm, 1); + +static int +ssm_probe(device_t dev) +{ + + if (strcmp(ofw_bus_get_name(dev), "ssm") == 0) { + device_set_desc(dev, "Scalable Shared Memory"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} From owner-svn-src-all@FreeBSD.ORG Sat Jan 28 23:53:07 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F6C11065670; Sat, 28 Jan 2012 23:53:07 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85C718FC16; Sat, 28 Jan 2012 23:53:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0SNr785005510; Sat, 28 Jan 2012 23:53:07 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0SNr7e6005493; Sat, 28 Jan 2012 23:53:07 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201282353.q0SNr7e6005493@svn.freebsd.org> From: Marius Strobl Date: Sat, 28 Jan 2012 23:53:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230687 - in stable/9/sys: dev/ata dev/ata/chipsets dev/fb dev/le sparc64/central sparc64/conf sparc64/ebus sparc64/fhc sparc64/include sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jan 2012 23:53:07 -0000 Author: marius Date: Sat Jan 28 23:53:06 2012 New Revision: 230687 URL: http://svn.freebsd.org/changeset/base/230687 Log: MFC: r225931, r225932, r227000 Make sparc64 compatible with NEW_PCIB and enable it: - Implement bus_adjust_resource() methods as far as necessary and in non-PCI bridge drivers as far as feasible without rototilling them. - As NEW_PCIB does a layering violation by activating resources at layers above pci(4) without previously bubbling up their allocation there, move the assignment of bus tags and handles from the bus_alloc_resource() to the bus_activate_resource() methods like at least the other NEW_PCIB enabled architectures do. This is somewhat unfortunate as previously sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY resources should be mapped into KVA, which is only necessary if their going to be accessed via the pointer returned from rman_get_virtual() but not for bus_space(9) as the later always uses physical access on sparc64. Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver also may deliberately not map them in if the firmware already has done so, possibly in a special way. So in order to still allow a driver to decide whether a SYS_RES_MEMORY resource should be mapped into KVA we let it indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as actually documented in the bus_space(9) page. This is implemented by allocating a separate bus tag per SYS_RES_MEMORY resource and passing the resource via the previously unused bus tag cookie so we later on can call rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now also allows to actually indicate that a SYS_RES_MEMORY resource should be mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and BUS_SPACE_MAP_READONLY respectively. - Do some minor cleanup like taking advantage of rman_init_from_resource(), factor out the common part of bus tag allocation into a newly added sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace some homegrown versions with the generic counterparts etc. - While at it, let apb_attach() (which can't use the generic NEW_PCIB code as APB bridges just don't have the base and limit registers implemented) regarding the config space registers cached in pcib_softc and the SYSCTL reporting nodes set up. Modified: stable/9/sys/dev/ata/ata-pci.c stable/9/sys/dev/ata/chipsets/ata-promise.c stable/9/sys/dev/ata/chipsets/ata-siliconimage.c stable/9/sys/dev/fb/machfb.c stable/9/sys/dev/le/lebuffer_sbus.c stable/9/sys/sparc64/central/central.c stable/9/sys/sparc64/conf/DEFAULTS stable/9/sys/sparc64/ebus/ebus.c stable/9/sys/sparc64/fhc/fhc.c stable/9/sys/sparc64/include/bus.h stable/9/sys/sparc64/include/bus_private.h stable/9/sys/sparc64/pci/apb.c stable/9/sys/sparc64/pci/fire.c stable/9/sys/sparc64/pci/firevar.h stable/9/sys/sparc64/pci/ofw_pcib_subr.c stable/9/sys/sparc64/pci/psycho.c stable/9/sys/sparc64/pci/psychovar.h stable/9/sys/sparc64/pci/sbbc.c stable/9/sys/sparc64/pci/schizo.c stable/9/sys/sparc64/pci/schizovar.h stable/9/sys/sparc64/sbus/dma_sbus.c stable/9/sys/sparc64/sbus/sbus.c stable/9/sys/sparc64/sparc64/bus_machdep.c stable/9/sys/sparc64/sparc64/nexus.c stable/9/sys/sparc64/sparc64/upa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) Modified: stable/9/sys/dev/ata/ata-pci.c ============================================================================== --- stable/9/sys/dev/ata/ata-pci.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/dev/ata/ata-pci.c Sat Jan 28 23:53:06 2012 (r230687) @@ -148,10 +148,20 @@ ata_pci_detach(device_t dev) } if (ctlr->chipdeinit != NULL) ctlr->chipdeinit(dev); - if (ctlr->r_res2) + if (ctlr->r_res2) { +#ifdef __sparc64__ + bus_space_unmap(rman_get_bustag(ctlr->r_res2), + rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2)); +#endif bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2); - if (ctlr->r_res1) + } + if (ctlr->r_res1) { +#ifdef __sparc64__ + bus_space_unmap(rman_get_bustag(ctlr->r_res1), + rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1)); +#endif bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1); + } return 0; } @@ -770,7 +780,6 @@ driver_t ata_pcichannel_driver = { DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0); - /* * misc support fucntions */ @@ -931,4 +940,3 @@ ata_mode2idx(int mode) return (mode & ATA_MODE_MASK) + 5; return (mode & ATA_MODE_MASK) - ATA_PIO0; } - Modified: stable/9/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-promise.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/dev/ata/chipsets/ata-promise.c Sat Jan 28 23:53:06 2012 (r230687) @@ -94,7 +94,6 @@ static void ata_promise_next_hpkt(struct #define PR_SATA 0x40 #define PR_SATA2 0x80 - /* * Promise chipset support functions */ @@ -250,6 +249,14 @@ ata_promise_chipinit(device_t dev) &ctlr->r_rid1, RF_ACTIVE))) goto failnfree; +#ifdef __sparc64__ + if (ctlr->chip->cfg2 == PR_SX4X && + !bus_space_map(rman_get_bustag(ctlr->r_res1), + rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1), + BUS_SPACE_MAP_LINEAR, NULL)) + goto failnfree; +#endif + ctlr->r_type2 = SYS_RES_MEMORY; ctlr->r_rid2 = PCIR_BAR(3); if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, Modified: stable/9/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/dev/ata/chipsets/ata-siliconimage.c Sat Jan 28 23:53:06 2012 (r230687) @@ -80,7 +80,6 @@ static void ata_siiprb_dmainit(device_t #define SII_BUG 0x04 #define SII_4CH 0x08 - /* * Silicon Image Inc. (SiI) (former CMD) chipset support functions */ @@ -141,6 +140,17 @@ ata_sii_chipinit(device_t dev) bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,ctlr->r_res1); return ENXIO; } +#ifdef __sparc64__ + if (!bus_space_map(rman_get_bustag(ctlr->r_res2), + rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2), + BUS_SPACE_MAP_LINEAR, NULL)) { + bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, + ctlr->r_res1); + bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, + ctlr->r_res2); + return (ENXIO); + } +#endif ctlr->ch_attach = ata_siiprb_ch_attach; ctlr->ch_detach = ata_siiprb_ch_detach; ctlr->reset = ata_siiprb_reset; @@ -432,7 +442,6 @@ ata_sii_setmode(device_t dev, int target return (mode); } - struct ata_siiprb_dma_prdentry { u_int64_t addr; u_int32_t count; Modified: stable/9/sys/dev/fb/machfb.c ============================================================================== --- stable/9/sys/dev/fb/machfb.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/dev/fb/machfb.c Sat Jan 28 23:53:06 2012 (r230687) @@ -87,7 +87,9 @@ struct machfb_softc { struct resource *sc_vmemres; bus_space_tag_t sc_memt; bus_space_tag_t sc_regt; + bus_space_tag_t sc_vmemt; bus_space_handle_t sc_memh; + bus_space_handle_t sc_vmemh; bus_space_handle_t sc_regh; u_long sc_mem; u_long sc_vmem; @@ -1175,68 +1177,52 @@ machfb_pci_attach(device_t dev) adp = &sc->sc_va; vi = &adp->va_info; - /* - * Allocate resources regardless of whether we are the console - * and already obtained the bus tag and handle for the framebuffer - * in machfb_configure() or not so the resources are marked as - * taken in the respective RMAN. - */ - - /* Enable memory and IO access. */ - pci_write_config(dev, PCIR_COMMAND, - pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_PORTEN | - PCIM_CMD_MEMEN, 2); - - /* - * NB: we need to take care that the framebuffer isn't mapped - * in twice as besides wasting resources this isn't possible with - * all MMUs. - */ rid = PCIR_BAR(0); - if ((sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &rid, 0)) == NULL) { + if ((sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate memory resources\n"); return (ENXIO); } + sc->sc_memt = rman_get_bustag(sc->sc_memres); + sc->sc_memh = rman_get_bushandle(sc->sc_memres); + sc->sc_mem = rman_get_start(sc->sc_memres); + vi->vi_buffer = sc->sc_memh; + vi->vi_buffer_size = rman_get_size(sc->sc_memres); if (OF_getprop(sc->sc_node, "address", &u32, sizeof(u32)) > 0 && - vtophys(u32) == rman_get_bushandle(sc->sc_memres)) + vtophys(u32) == sc->sc_memh) adp->va_mem_base = u32; else { - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(sc->sc_memres), sc->sc_memres); - rid = PCIR_BAR(0); - if ((sc->sc_memres = bus_alloc_resource_any(dev, - SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) { - device_printf(dev, - "cannot allocate memory resources\n"); - return (ENXIO); + if (bus_space_map(sc->sc_memt, vi->vi_buffer, + vi->vi_buffer_size, BUS_SPACE_MAP_LINEAR, + &sc->sc_memh) != 0) { + device_printf(dev, "cannot map memory resources\n"); + error = ENXIO; + goto fail_memres; } adp->va_mem_base = (vm_offset_t)rman_get_virtual(sc->sc_memres); } - sc->sc_memt = rman_get_bustag(sc->sc_memres); - sc->sc_memh = rman_get_bushandle(sc->sc_memres); - sc->sc_regt = sc->sc_memt; - bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF, - MACH64_REG_SIZE, &sc->sc_regh); - adp->va_mem_size = rman_get_size(sc->sc_memres); + adp->va_mem_size = vi->vi_buffer_size; adp->va_buffer = adp->va_mem_base; adp->va_buffer_size = adp->va_mem_size; - sc->sc_mem = rman_get_start(sc->sc_memres); - vi->vi_buffer = sc->sc_memh; - vi->vi_buffer_size = adp->va_buffer_size; + sc->sc_regt = sc->sc_memt; + if (bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF, + MACH64_REG_SIZE, &sc->sc_regh) != 0) { + device_printf(dev, "cannot allocate register resources\n"); + error = ENXIO; + goto fail_memmap; + } /* * Depending on the firmware version the VGA I/O and/or memory - * resources of the Mach64 chips come up disabled. We generally - * enable them above (pci(4) actually already did this unless - * pci_enable_io_modes is not set) but this doesn't necessarily - * mean that we get valid ones. Invalid resources seem to have - * in common that they start at address 0. We don't allocate - * them in this case in order to avoid warnings in apb(4) and - * crashes when using these invalid resources. X.Org is aware - * of this and doesn't use the VGA resources in this case (but - * demands them if they are valid). + * resources of the Mach64 chips come up disabled. These will be + * enabled by pci(4) when activating the resource in question but + * this doesn't necessarily mean that the resource is valid. + * Invalid resources seem to have in common that they start at + * address 0. We don't allocate the VGA memory in this case in + * order to avoid warnings in apb(4) and crashes when using this + * invalid resources. X.Org is aware of this and doesn't use the + * VGA memory resource in this case (but demands it if it's valid). */ rid = PCIR_BAR(2); if (bus_get_resource_start(dev, SYS_RES_MEMORY, rid) != 0) { @@ -1245,21 +1231,31 @@ machfb_pci_attach(device_t dev) device_printf(dev, "cannot allocate VGA memory resources\n"); error = ENXIO; - goto fail_memres; + goto fail_memmap; + } + sc->sc_vmemt = rman_get_bustag(sc->sc_vmemres); + sc->sc_vmemh = rman_get_bushandle(sc->sc_vmemres); + sc->sc_vmem = rman_get_start(sc->sc_vmemres); + vi->vi_registers = sc->sc_vmemh; + vi->vi_registers_size = rman_get_size(sc->sc_vmemres); + if (bus_space_map(sc->sc_vmemt, vi->vi_registers, + vi->vi_registers_size, BUS_SPACE_MAP_LINEAR, + &sc->sc_vmemh) != 0) { + device_printf(dev, + "cannot map VGA memory resources\n"); + error = ENXIO; + goto fail_vmemres; } adp->va_registers = (vm_offset_t)rman_get_virtual(sc->sc_vmemres); - adp->va_registers_size = rman_get_size(sc->sc_vmemres); - sc->sc_vmem = rman_get_start(sc->sc_vmemres); - vi->vi_registers = rman_get_bushandle(sc->sc_vmemres); - vi->vi_registers_size = adp->va_registers_size; + adp->va_registers_size = vi->vi_registers_size; } if (!(sc->sc_flags & MACHFB_CONSOLE)) { if ((sw = vid_get_switch(MACHFB_DRIVER_NAME)) == NULL) { device_printf(dev, "cannot get video switch\n"); error = ENODEV; - goto fail_vmemres; + goto fail_vmemmap; } /* * During device configuration we don't necessarily probe @@ -1275,7 +1271,7 @@ machfb_pci_attach(device_t dev) break; if ((error = sw->init(i, adp, 0)) != 0) { device_printf(dev, "cannot initialize adapter\n"); - goto fail_vmemres; + goto fail_vmemmap; } } @@ -1283,8 +1279,8 @@ machfb_pci_attach(device_t dev) * Test whether the aperture is byte swapped or not, set * va_window and va_window_size as appropriate. Note that * the aperture could be mapped either big or little endian - * on independently of the endianess of the host so this - * has to be a runtime test. + * independently of the endianess of the host so this has + * to be a runtime test. */ p32 = (uint32_t *)adp->va_buffer; u32 = *p32; @@ -1346,10 +1342,16 @@ machfb_pci_attach(device_t dev) return (0); + fail_vmemmap: + if (adp->va_registers != 0) + bus_space_unmap(sc->sc_vmemt, sc->sc_vmemh, + vi->vi_registers_size); fail_vmemres: if (sc->sc_vmemres != NULL) bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->sc_vmemres), sc->sc_vmemres); + fail_memmap: + bus_space_unmap(sc->sc_memt, sc->sc_memh, vi->vi_buffer_size); fail_memres: bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->sc_memres), sc->sc_memres); Modified: stable/9/sys/dev/le/lebuffer_sbus.c ============================================================================== --- stable/9/sys/dev/le/lebuffer_sbus.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/dev/le/lebuffer_sbus.c Sat Jan 28 23:53:06 2012 (r230687) @@ -81,6 +81,7 @@ static device_method_t lebuffer_methods[ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/9/sys/sparc64/central/central.c ============================================================================== --- stable/9/sys/sparc64/central/central.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/sparc64/central/central.c Sat Jan 28 23:53:06 2012 (r230687) @@ -60,6 +60,7 @@ static device_attach_t central_attach; static bus_print_child_t central_print_child; static bus_probe_nomatch_t central_probe_nomatch; static bus_alloc_resource_t central_alloc_resource; +static bus_adjust_resource_t central_adjust_resource; static bus_get_resource_list_t central_get_resource_list; static ofw_bus_get_devinfo_t central_get_devinfo; @@ -79,6 +80,7 @@ static device_method_t central_methods[] DEVMETHOD(bus_alloc_resource, central_alloc_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, central_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -180,6 +182,15 @@ central_attach(device_t dev) } static int +central_adjust_resource(device_t bus __unused, device_t child __unused, + int type __unused, struct resource *r __unused, u_long start __unused, + u_long end __unused) +{ + + return (ENXIO); +} + +static int central_print_child(device_t dev, device_t child) { int rv; Modified: stable/9/sys/sparc64/conf/DEFAULTS ============================================================================== --- stable/9/sys/sparc64/conf/DEFAULTS Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/sparc64/conf/DEFAULTS Sat Jan 28 23:53:06 2012 (r230687) @@ -19,3 +19,5 @@ options GEOM_PART_VTOC8 # Let sunkbd emulate an AT keyboard by default. options SUNKBD_EMULATE_ATKBD + +options NEW_PCIB Modified: stable/9/sys/sparc64/ebus/ebus.c ============================================================================== --- stable/9/sys/sparc64/ebus/ebus.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/sparc64/ebus/ebus.c Sat Jan 28 23:53:06 2012 (r230687) @@ -136,6 +136,8 @@ static device_attach_t ebus_pci_attach; static bus_print_child_t ebus_print_child; static bus_probe_nomatch_t ebus_probe_nomatch; static bus_alloc_resource_t ebus_alloc_resource; +static bus_activate_resource_t ebus_activate_resource; +static bus_adjust_resource_t ebus_adjust_resource; static bus_release_resource_t ebus_release_resource; static bus_setup_intr_t ebus_setup_intr; static bus_get_resource_list_t ebus_get_resource_list; @@ -161,8 +163,9 @@ static device_method_t ebus_nexus_method DEVMETHOD(bus_print_child, ebus_print_child), DEVMETHOD(bus_probe_nomatch, ebus_probe_nomatch), DEVMETHOD(bus_alloc_resource, ebus_alloc_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_activate_resource, ebus_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, ebus_adjust_resource), DEVMETHOD(bus_release_resource, ebus_release_resource), DEVMETHOD(bus_setup_intr, ebus_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -342,16 +345,10 @@ ebus_pci_attach(device_t dev) eri->eri_res = res; eri->eri_rman.rm_type = RMAN_ARRAY; eri->eri_rman.rm_descr = "EBus range"; - if (rman_init(&eri->eri_rman) != 0) { + if (rman_init_from_resource(&eri->eri_rman, res) != 0) { printf("%s: failed to initialize rman!", __func__); goto fail; } - if (rman_manage_region(&eri->eri_rman, rman_get_start(res), - rman_get_end(res)) != 0) { - printf("%s: failed to register region!", __func__); - rman_fini(&eri->eri_rman); - goto fail; - } } return (ebus_attach(dev, sc, node)); @@ -423,12 +420,10 @@ ebus_alloc_resource(device_t bus, device struct resource_list *rl; struct resource_list_entry *rle = NULL; struct resource *res; - struct ebus_rinfo *ri; + struct ebus_rinfo *eri; struct ebus_nexus_ranges *enr; - bus_space_tag_t bt; - bus_space_handle_t bh; uint64_t cend, cstart, offset; - int i, isdefault, passthrough, ridx, rv; + int i, isdefault, passthrough, ridx; isdefault = (start == 0UL && end == ~0UL); passthrough = (device_get_parent(child) != bus); @@ -459,23 +454,17 @@ ebus_alloc_resource(device_t bus, device */ (void)ofw_isa_range_map(sc->sc_range, sc->sc_nrange, &start, &end, &ridx); - ri = &sc->sc_rinfo[ridx]; - res = rman_reserve_resource(&ri->eri_rman, start, end, - count, flags, child); + eri = &sc->sc_rinfo[ridx]; + res = rman_reserve_resource(&eri->eri_rman, start, + end, count, flags & ~RF_ACTIVE, child); if (res == NULL) return (NULL); rman_set_rid(res, *rid); - bt = rman_get_bustag(ri->eri_res); - rman_set_bustag(res, bt); - rv = bus_space_subregion(bt, - rman_get_bushandle(ri->eri_res), - rman_get_start(res) - rman_get_start(ri->eri_res), - count, &bh); - if (rv != 0) { + if ((flags & RF_ACTIVE) != 0 && bus_activate_resource( + child, type, *rid, res) != 0) { rman_release_resource(res); return (NULL); } - rman_set_bushandle(res, bh); } else { /* Map EBus ranges to nexus ranges. */ for (i = 0; i < sc->sc_nrange; i++) { @@ -496,7 +485,6 @@ ebus_alloc_resource(device_t bus, device break; } } - } if (!passthrough) rle->res = res; @@ -509,6 +497,48 @@ ebus_alloc_resource(device_t bus, device } static int +ebus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + struct ebus_softc *sc; + struct ebus_rinfo *eri; + bus_space_tag_t bt; + bus_space_handle_t bh; + int i, rv; + + sc = device_get_softc(bus); + if ((sc->sc_flags & EBUS_PCI) != 0 && type == SYS_RES_MEMORY) { + for (i = 0; i < sc->sc_nrange; i++) { + eri = &sc->sc_rinfo[i]; + if (rman_is_region_manager(res, &eri->eri_rman) != 0) { + bt = rman_get_bustag(eri->eri_res); + rv = bus_space_subregion(bt, + rman_get_bushandle(eri->eri_res), + rman_get_start(res) - + rman_get_start(eri->eri_res), + rman_get_size(res), &bh); + if (rv != 0) + return (rv); + rman_set_bustag(res, bt); + rman_set_bushandle(res, bh); + return (rman_activate_resource(res)); + } + } + return (EINVAL); + } + return (bus_generic_activate_resource(bus, child, type, rid, res)); +} + +static int +ebus_adjust_resource(device_t bus __unused, device_t child __unused, + int type __unused, struct resource *res __unused, u_long start __unused, + u_long end __unused) +{ + + return (ENXIO); +} + +static int ebus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { @@ -519,13 +549,15 @@ ebus_release_resource(device_t bus, devi passthrough = (device_get_parent(child) != bus); rl = BUS_GET_RESOURCE_LIST(bus, child); - switch (type) { - case SYS_RES_MEMORY: - sc = device_get_softc(bus); - if ((sc->sc_flags & EBUS_PCI) == 0) - return (resource_list_release(rl, bus, child, type, - rid, res)); - if ((rv = rman_release_resource(res)) != 0) + sc = device_get_softc(bus); + if ((sc->sc_flags & EBUS_PCI) != 0 && type == SYS_RES_MEMORY) { + if ((rman_get_flags(res) & RF_ACTIVE) != 0 ){ + rv = bus_deactivate_resource(child, type, rid, res); + if (rv != 0) + return (rv); + } + rv = rman_release_resource(res); + if (rv != 0) return (rv); if (!passthrough) { rle = resource_list_find(rl, type, rid); @@ -535,13 +567,9 @@ ebus_release_resource(device_t bus, devi ("%s: resource entry is not busy", __func__)); rle->res = NULL; } - break; - case SYS_RES_IRQ: - return (resource_list_release(rl, bus, child, type, rid, res)); - default: - panic("%s: unsupported resource type %d", __func__, type); + return (0); } - return (0); + return (resource_list_release(rl, bus, child, type, rid, res)); } static int Modified: stable/9/sys/sparc64/fhc/fhc.c ============================================================================== --- stable/9/sys/sparc64/fhc/fhc.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/sparc64/fhc/fhc.c Sat Jan 28 23:53:06 2012 (r230687) @@ -69,6 +69,7 @@ static bus_print_child_t fhc_print_child static bus_probe_nomatch_t fhc_probe_nomatch; static bus_setup_intr_t fhc_setup_intr; static bus_alloc_resource_t fhc_alloc_resource; +static bus_adjust_resource_t fhc_adjust_resource; static bus_get_resource_list_t fhc_get_resource_list; static ofw_bus_get_devinfo_t fhc_get_devinfo; @@ -93,6 +94,7 @@ static device_method_t fhc_methods[] = { DEVMETHOD(bus_alloc_resource, fhc_alloc_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, fhc_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_setup_intr, fhc_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -475,6 +477,15 @@ fhc_alloc_resource(device_t bus, device_ return (res); } +static int +fhc_adjust_resource(device_t bus __unused, device_t child __unused, + int type __unused, struct resource *r __unused, u_long start __unused, + u_long end __unused) +{ + + return (ENXIO); +} + static struct resource_list * fhc_get_resource_list(device_t bus, device_t child) { Modified: stable/9/sys/sparc64/include/bus.h ============================================================================== --- stable/9/sys/sparc64/include/bus.h Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/sparc64/include/bus.h Sat Jan 28 23:53:06 2012 (r230687) @@ -122,32 +122,15 @@ static int bus_space_subregion(bus_space /* * Map a region of device bus space into CPU virtual address space. */ - -static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, - bus_size_t size, int flags, bus_space_handle_t *bshp); - -static __inline int -bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, bus_space_handle_t *bshp) -{ - - *bshp = addr; - return (0); -} +int bus_space_map(bus_space_tag_t tag, bus_addr_t address, bus_size_t size, + int flags, bus_space_handle_t *handlep); /* * Unmap a region of device bus space. */ -static __inline void bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, +void bus_space_unmap(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t size); -static __inline void -bus_space_unmap(bus_space_tag_t t __unused, bus_space_handle_t bsh __unused, - bus_size_t size __unused) -{ - -} - /* This macro finds the first "upstream" implementation of method `f' */ #define _BS_CALL(t,f) \ while (t->f == NULL) \ Modified: stable/9/sys/sparc64/include/bus_private.h ============================================================================== --- stable/9/sys/sparc64/include/bus_private.h Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/sparc64/include/bus_private.h Sat Jan 28 23:53:06 2012 (r230687) @@ -36,10 +36,14 @@ /* * Helpers */ -int sparc64_bus_mem_map(bus_space_tag_t, bus_space_handle_t, bus_size_t, - int, vm_offset_t, void **); -int sparc64_bus_mem_unmap(void *, bus_size_t); -bus_space_handle_t sparc64_fake_bustag(int, bus_addr_t, struct bus_space_tag *); +int sparc64_bus_mem_map(bus_space_tag_t tag, bus_addr_t addr, bus_size_t size, + int flags, vm_offset_t vaddr, bus_space_handle_t *hp); +int sparc64_bus_mem_unmap(bus_space_tag_t tag, bus_space_handle_t handle, + bus_size_t size); +bus_space_tag_t sparc64_alloc_bus_tag(void *cookie, + struct bus_space_tag *ptag, int type, void *barrier); +bus_space_handle_t sparc64_fake_bustag(int space, bus_addr_t addr, + struct bus_space_tag *ptag); struct bus_dmamap_res { struct resource *dr_res; Modified: stable/9/sys/sparc64/pci/apb.c ============================================================================== --- stable/9/sys/sparc64/pci/apb.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/sparc64/pci/apb.c Sat Jan 28 23:53:06 2012 (r230687) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -77,6 +78,7 @@ struct apb_softc { static device_probe_t apb_probe; static device_attach_t apb_attach; static bus_alloc_resource_t apb_alloc_resource; +static bus_adjust_resource_t apb_adjust_resource; static device_method_t apb_methods[] = { /* Device interface */ @@ -85,6 +87,8 @@ static device_method_t apb_methods[] = { /* Bus interface */ DEVMETHOD(bus_alloc_resource, apb_alloc_resource), + DEVMETHOD(bus_adjust_resource, apb_adjust_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, ofw_pcib_gen_route_interrupt), @@ -158,6 +162,8 @@ static int apb_attach(device_t dev) { struct apb_softc *sc; + struct sysctl_ctx_list *sctx; + struct sysctl_oid *soid; sc = device_get_softc(dev); @@ -165,12 +171,41 @@ apb_attach(device_t dev) * Get current bridge configuration. */ sc->sc_bsc.ops_pcib_sc.domain = pci_get_domain(dev); + sc->sc_bsc.ops_pcib_sc.secstat = + pci_read_config(dev, PCIR_SECSTAT_1, 2); + sc->sc_bsc.ops_pcib_sc.command = + pci_read_config(dev, PCIR_COMMAND, 2); + sc->sc_bsc.ops_pcib_sc.pribus = + pci_read_config(dev, PCIR_PRIBUS_1, 1); sc->sc_bsc.ops_pcib_sc.secbus = pci_read_config(dev, PCIR_SECBUS_1, 1); sc->sc_bsc.ops_pcib_sc.subbus = pci_read_config(dev, PCIR_SUBBUS_1, 1); + sc->sc_bsc.ops_pcib_sc.bridgectl = + pci_read_config(dev, PCIR_BRIDGECTL_1, 2); + sc->sc_bsc.ops_pcib_sc.seclat = + pci_read_config(dev, PCIR_SECLAT_1, 1); sc->sc_iomap = pci_read_config(dev, APBR_IOMAP, 1); sc->sc_memmap = pci_read_config(dev, APBR_MEMMAP, 1); + + /* + * Setup SYSCTL reporting nodes. + */ + sctx = device_get_sysctl_ctx(dev); + soid = device_get_sysctl_tree(dev); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "domain", + CTLFLAG_RD, &sc->sc_bsc.ops_pcib_sc.domain, 0, + "Domain number"); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "pribus", + CTLFLAG_RD, &sc->sc_bsc.ops_pcib_sc.pribus, 0, + "Primary bus number"); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "secbus", + CTLFLAG_RD, &sc->sc_bsc.ops_pcib_sc.secbus, 0, + "Secondary bus number"); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "subbus", + CTLFLAG_RD, &sc->sc_bsc.ops_pcib_sc.subbus, 0, + "Subordinate bus number"); + ofw_pcib_gen_setup(dev); if (bootverbose) { @@ -233,9 +268,9 @@ apb_alloc_resource(device_t dev, device_ "%s requested decoded I/O range 0x%lx-0x%lx\n", device_get_nameunit(child), start, end); break; - case SYS_RES_MEMORY: - if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start, end)) { + if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start, + end)) { device_printf(dev, "device %s requested unsupported " "memory range 0x%lx-0x%lx\n", device_get_nameunit(child), start, end); @@ -246,9 +281,6 @@ apb_alloc_resource(device_t dev, device_ "%s requested decoded memory range 0x%lx-0x%lx\n", device_get_nameunit(child), start, end); break; - - default: - break; } passup: @@ -258,3 +290,23 @@ apb_alloc_resource(device_t dev, device_ return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } + +static int +apb_adjust_resource(device_t dev, device_t child, int type, + struct resource *r, u_long start, u_long end) +{ + struct apb_softc *sc; + + sc = device_get_softc(dev); + switch (type) { + case SYS_RES_IOPORT: + if (!apb_checkrange(sc->sc_iomap, APB_IO_SCALE, start, end)) + return (ENXIO); + break; + case SYS_RES_MEMORY: + if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start, end)) + return (ENXIO); + break; + } + return (bus_generic_adjust_resource(dev, child, type, r, start, end)); +} Modified: stable/9/sys/sparc64/pci/fire.c ============================================================================== --- stable/9/sys/sparc64/pci/fire.c Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/sparc64/pci/fire.c Sat Jan 28 23:53:06 2012 (r230687) @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); struct fire_msiqarg; -static bus_space_tag_t fire_alloc_bus_tag(struct fire_softc *sc, int type); static const struct fire_desc *fire_get_desc(device_t dev); static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, bus_dmasync_op_t op); @@ -113,11 +112,11 @@ static driver_filter_t fire_xcb; * Methods */ static bus_activate_resource_t fire_activate_resource; +static bus_adjust_resource_t fire_adjust_resource; static pcib_alloc_msi_t fire_alloc_msi; static pcib_alloc_msix_t fire_alloc_msix; static bus_alloc_resource_t fire_alloc_resource; static device_attach_t fire_attach; -static bus_deactivate_resource_t fire_deactivate_resource; static bus_get_dma_tag_t fire_get_dma_tag; static ofw_bus_get_node_t fire_get_node; static pcib_map_msi_t fire_map_msi; @@ -127,7 +126,6 @@ static pcib_read_config_t fire_read_conf static bus_read_ivar_t fire_read_ivar; static pcib_release_msi_t fire_release_msi; static pcib_release_msix_t fire_release_msix; -static bus_release_resource_t fire_release_resource; static pcib_route_interrupt_t fire_route_interrupt; static bus_setup_intr_t fire_setup_intr; static bus_teardown_intr_t fire_teardown_intr; @@ -146,9 +144,10 @@ static device_method_t fire_methods[] = DEVMETHOD(bus_setup_intr, fire_setup_intr), DEVMETHOD(bus_teardown_intr, fire_teardown_intr), DEVMETHOD(bus_alloc_resource, fire_alloc_resource), - DEVMETHOD(bus_activate_resource, fire_activate_resource), - DEVMETHOD(bus_deactivate_resource, fire_deactivate_resource), - DEVMETHOD(bus_release_resource, fire_release_resource), + DEVMETHOD(bus_activate_resource, fire_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, fire_adjust_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_get_dma_tag, fire_get_dma_tag), /* pcib interface */ @@ -756,13 +755,19 @@ fire_attach(device_t dev) free(range, M_OFWPROP); /* Allocate our tags. */ - sc->sc_pci_memt = fire_alloc_bus_tag(sc, PCI_MEMORY_BUS_SPACE); - sc->sc_pci_iot = fire_alloc_bus_tag(sc, PCI_IO_BUS_SPACE); - sc->sc_pci_cfgt = fire_alloc_bus_tag(sc, PCI_CONFIG_BUS_SPACE); + sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, rman_get_bustag( + sc->sc_mem_res[FIRE_PCI]), PCI_IO_BUS_SPACE, NULL); + if (sc->sc_pci_iot == NULL) + panic("%s: could not allocate PCI I/O tag", __func__); + sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, rman_get_bustag( + sc->sc_mem_res[FIRE_PCI]), PCI_CONFIG_BUS_SPACE, NULL); + if (sc->sc_pci_cfgt == NULL) + panic("%s: could not allocate PCI configuration space tag", + __func__); if (bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0, sc->sc_is.is_pmaxaddr, ~0, NULL, NULL, sc->sc_is.is_pmaxaddr, 0xff, 0xffffffff, 0, NULL, NULL, &sc->sc_pci_dmat) != 0) - panic("%s: bus_dma_tag_create failed", __func__); + panic("%s: could not create PCI DMA tag", __func__); /* Customize the tag. */ sc->sc_pci_dmat->dt_cookie = &sc->sc_is; sc->sc_pci_dmat->dt_mt = &sc->sc_dma_methods; @@ -2014,14 +2019,10 @@ fire_alloc_resource(device_t bus, device struct fire_softc *sc; struct resource *rv; struct rman *rm; - bus_space_tag_t bt; - bus_space_handle_t bh; - int needactivate = flags & RF_ACTIVE; - - flags &= ~RF_ACTIVE; sc = device_get_softc(bus); - if (type == SYS_RES_IRQ) { + switch (type) { + case SYS_RES_IRQ: /* * XXX: Don't accept blank ranges for now, only single * interrupts. The other case should not happen with @@ -2033,38 +2034,28 @@ fire_alloc_resource(device_t bus, device panic("%s: XXX: interrupt range", __func__); if (*rid == 0) start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, - type, rid, start, end, count, flags)); - } - switch (type) { + return (bus_generic_alloc_resource(bus, child, type, rid, + start, end, count, flags)); case SYS_RES_MEMORY: rm = &sc->sc_pci_mem_rman; - bt = sc->sc_pci_memt; - bh = sc->sc_pci_bh[OFW_PCI_CS_MEM32]; break; case SYS_RES_IOPORT: rm = &sc->sc_pci_io_rman; - bt = sc->sc_pci_iot; - bh = sc->sc_pci_bh[OFW_PCI_CS_IO]; break; default: return (NULL); - /* NOTREACHED */ } - rv = rman_reserve_resource(rm, start, end, count, flags, child); + rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, + child); if (rv == NULL) return (NULL); rman_set_rid(rv, *rid); - bh += rman_get_start(rv); - rman_set_bustag(rv, bt); - rman_set_bushandle(rv, bh); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv)) { - rman_release_resource(rv); - return (NULL); - } + + if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(child, type, + *rid, rv) != 0) { + rman_release_resource(rv); + return (NULL); } return (rv); } @@ -2073,56 +2064,56 @@ static int fire_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - void *p; - int error; + struct fire_softc *sc; + struct bus_space_tag *tag; - if (type == SYS_RES_IRQ) - return (BUS_ACTIVATE_RESOURCE(device_get_parent(bus), child, - type, rid, r)); - if (type == SYS_RES_MEMORY) { - /* - * Need to memory-map the device space, as some drivers - * depend on the virtual address being set and usable. - */ - error = sparc64_bus_mem_map(rman_get_bustag(r), - rman_get_bushandle(r), rman_get_size(r), 0, 0, &p); - if (error != 0) - return (error); - rman_set_virtual(r, p); + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_IRQ: + return (bus_generic_activate_resource(bus, child, type, rid, + r)); + case SYS_RES_MEMORY: + tag = sparc64_alloc_bus_tag(r, rman_get_bustag( + sc->sc_mem_res[FIRE_PCI]), PCI_MEMORY_BUS_SPACE, NULL); + if (tag == NULL) + return (ENOMEM); + rman_set_bustag(r, tag); + rman_set_bushandle(r, sc->sc_pci_bh[OFW_PCI_CS_MEM32] + + rman_get_start(r)); + break; + case SYS_RES_IOPORT: + rman_set_bustag(r, sc->sc_pci_iot); + rman_set_bushandle(r, sc->sc_pci_bh[OFW_PCI_CS_IO] + + rman_get_start(r)); + break; } return (rman_activate_resource(r)); } static int -fire_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) +fire_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, u_long start, u_long end) { + struct fire_softc *sc; + struct rman *rm; - if (type == SYS_RES_IRQ) - return (BUS_DEACTIVATE_RESOURCE(device_get_parent(bus), child, - type, rid, r)); - if (type == SYS_RES_MEMORY) { - sparc64_bus_mem_unmap(rman_get_virtual(r), rman_get_size(r)); - rman_set_virtual(r, NULL); - } - return (rman_deactivate_resource(r)); -} - -static int -fire_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) -{ - int error; - - if (type == SYS_RES_IRQ) - return (BUS_RELEASE_RESOURCE(device_get_parent(bus), child, - type, rid, r)); - if (rman_get_flags(r) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, r); - if (error) - return (error); + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_IRQ: + return (bus_generic_adjust_resource(bus, child, type, r, + start, end)); + case SYS_RES_MEMORY: + rm = &sc->sc_pci_mem_rman; + break; + case SYS_RES_IOPORT: + rm = &sc->sc_pci_io_rman; + break; + default: + return (EINVAL); } - return (rman_release_resource(r)); + if (rman_is_region_manager(r, rm) == 0) + return (EINVAL); + return (rman_adjust_resource(r, start, end)); } static bus_dma_tag_t @@ -2144,22 +2135,6 @@ fire_get_node(device_t bus, device_t chi return (sc->sc_node); } -static bus_space_tag_t -fire_alloc_bus_tag(struct fire_softc *sc, int type) -{ - bus_space_tag_t bt; - - bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (bt == NULL) - panic("%s: out of memory", __func__); - - bt->bst_cookie = sc; - bt->bst_parent = rman_get_bustag(sc->sc_mem_res[FIRE_PCI]); - bt->bst_type = type; - return (bt); -} - static u_int fire_get_timecount(struct timecounter *tc) { Modified: stable/9/sys/sparc64/pci/firevar.h ============================================================================== --- stable/9/sys/sparc64/pci/firevar.h Sat Jan 28 23:46:36 2012 (r230686) +++ stable/9/sys/sparc64/pci/firevar.h Sat Jan 28 23:53:06 2012 (r230687) @@ -47,7 +47,6 @@ struct fire_softc { bus_space_handle_t sc_pci_bh[FIRE_NRANGE]; bus_space_tag_t sc_pci_cfgt; bus_space_tag_t sc_pci_iot; - bus_space_tag_t sc_pci_memt; bus_dma_tag_t sc_pci_dmat; device_t sc_dev; Modified: stable/9/sys/sparc64/pci/ofw_pcib_subr.c ============================================================================== --- stable/9/sys/sparc64/pci/ofw_pcib_subr.c Sat Jan 28 23:46:36 2012 (r230686) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jan 29 00:00:16 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B62291065670; Sun, 29 Jan 2012 00:00:16 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8C4D48FC0A; Sun, 29 Jan 2012 00:00:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q0T00GIu005828; Sun, 29 Jan 2012 00:00:16 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q0T00G4Q005811; Sun, 29 Jan 2012 00:00:16 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201201290000.q0T00G4Q005811@svn.freebsd.org> From: Marius Strobl Date: Sun, 29 Jan 2012 00:00:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r230688 - in stable/8/sys: dev/ata dev/ata/chipsets dev/fb dev/le sparc64/central sparc64/conf sparc64/ebus sparc64/fhc sparc64/include sparc64/pci sparc64/sbus sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 Jan 2012 00:00:17 -0000 Author: marius Date: Sun Jan 29 00:00:15 2012 New Revision: 230688 URL: http://svn.freebsd.org/changeset/base/230688 Log: MFC: r225931, r225932, r227000 Make sparc64 compatible with NEW_PCIB and enable it: - Implement bus_adjust_resource() methods as far as necessary and in non-PCI bridge drivers as far as feasible without rototilling them. - As NEW_PCIB does a layering violation by activating resources at layers above pci(4) without previously bubbling up their allocation there, move the assignment of bus tags and handles from the bus_alloc_resource() to the bus_activate_resource() methods like at least the other NEW_PCIB enabled architectures do. This is somewhat unfortunate as previously sparc64 (ab)used resource activation to indicate whether SYS_RES_MEMORY resources should be mapped into KVA, which is only necessary if their going to be accessed via the pointer returned from rman_get_virtual() but not for bus_space(9) as the later always uses physical access on sparc64. Besides wasting KVA if we always map in SYS_RES_MEMORY resources, a driver also may deliberately not map them in if the firmware already has done so, possibly in a special way. So in order to still allow a driver to decide whether a SYS_RES_MEMORY resource should be mapped into KVA we let it indicate that by calling bus_space_map(9) with BUS_SPACE_MAP_LINEAR as actually documented in the bus_space(9) page. This is implemented by allocating a separate bus tag per SYS_RES_MEMORY resource and passing the resource via the previously unused bus tag cookie so we later on can call rman_set_virtual() in sparc64_bus_mem_map(). As a side effect this now also allows to actually indicate that a SYS_RES_MEMORY resource should be mapped in as cacheable and/or read-only via BUS_SPACE_MAP_CACHEABLE and BUS_SPACE_MAP_READONLY respectively. - Do some minor cleanup like taking advantage of rman_init_from_resource(), factor out the common part of bus tag allocation into a newly added sparc64_alloc_bus_tag(), hook up some missing newbus methods and replace some homegrown versions with the generic counterparts etc. - While at it, let apb_attach() (which can't use the generic NEW_PCIB code as APB bridges just don't have the base and limit registers implemented) regarding the config space registers cached in pcib_softc and the SYSCTL reporting nodes set up. Modified: stable/8/sys/dev/ata/ata-pci.c stable/8/sys/dev/ata/chipsets/ata-promise.c stable/8/sys/dev/ata/chipsets/ata-siliconimage.c stable/8/sys/dev/fb/machfb.c stable/8/sys/dev/le/lebuffer_sbus.c stable/8/sys/sparc64/central/central.c stable/8/sys/sparc64/conf/DEFAULTS stable/8/sys/sparc64/ebus/ebus.c stable/8/sys/sparc64/fhc/fhc.c stable/8/sys/sparc64/include/bus.h stable/8/sys/sparc64/include/bus_private.h stable/8/sys/sparc64/pci/apb.c stable/8/sys/sparc64/pci/fire.c stable/8/sys/sparc64/pci/firevar.h stable/8/sys/sparc64/pci/ofw_pcib_subr.c stable/8/sys/sparc64/pci/psycho.c stable/8/sys/sparc64/pci/psychovar.h stable/8/sys/sparc64/pci/sbbc.c stable/8/sys/sparc64/pci/schizo.c stable/8/sys/sparc64/pci/schizovar.h stable/8/sys/sparc64/sbus/dma_sbus.c stable/8/sys/sparc64/sbus/sbus.c stable/8/sys/sparc64/sparc64/bus_machdep.c stable/8/sys/sparc64/sparc64/nexus.c stable/8/sys/sparc64/sparc64/upa.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ata/ata-pci.c ============================================================================== --- stable/8/sys/dev/ata/ata-pci.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/dev/ata/ata-pci.c Sun Jan 29 00:00:15 2012 (r230688) @@ -153,10 +153,20 @@ ata_pci_detach(device_t dev) } if (ctlr->chipdeinit != NULL) ctlr->chipdeinit(dev); - if (ctlr->r_res2) + if (ctlr->r_res2) { +#ifdef __sparc64__ + bus_space_unmap(rman_get_bustag(ctlr->r_res2), + rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2)); +#endif bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, ctlr->r_res2); - if (ctlr->r_res1) + } + if (ctlr->r_res1) { +#ifdef __sparc64__ + bus_space_unmap(rman_get_bustag(ctlr->r_res1), + rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1)); +#endif bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, ctlr->r_res1); + } return 0; } @@ -775,7 +785,6 @@ driver_t ata_pcichannel_driver = { DRIVER_MODULE(ata, atapci, ata_pcichannel_driver, ata_devclass, 0, 0); - /* * misc support fucntions */ @@ -936,4 +945,3 @@ ata_mode2idx(int mode) return (mode & ATA_MODE_MASK) + 5; return (mode & ATA_MODE_MASK) - ATA_PIO0; } - Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-promise.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/dev/ata/chipsets/ata-promise.c Sun Jan 29 00:00:15 2012 (r230688) @@ -94,7 +94,6 @@ static void ata_promise_next_hpkt(struct #define PR_SATA 0x40 #define PR_SATA2 0x80 - /* * Promise chipset support functions */ @@ -250,6 +249,14 @@ ata_promise_chipinit(device_t dev) &ctlr->r_rid1, RF_ACTIVE))) goto failnfree; +#ifdef __sparc64__ + if (ctlr->chip->cfg2 == PR_SX4X && + !bus_space_map(rman_get_bustag(ctlr->r_res1), + rman_get_bushandle(ctlr->r_res1), rman_get_size(ctlr->r_res1), + BUS_SPACE_MAP_LINEAR, NULL)) + goto failnfree; +#endif + ctlr->r_type2 = SYS_RES_MEMORY; ctlr->r_rid2 = PCIR_BAR(3); if (!(ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c Sun Jan 29 00:00:15 2012 (r230688) @@ -80,7 +80,6 @@ static void ata_siiprb_dmainit(device_t #define SII_BUG 0x04 #define SII_4CH 0x08 - /* * Silicon Image Inc. (SiI) (former CMD) chipset support functions */ @@ -141,6 +140,17 @@ ata_sii_chipinit(device_t dev) bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1,ctlr->r_res1); return ENXIO; } +#ifdef __sparc64__ + if (!bus_space_map(rman_get_bustag(ctlr->r_res2), + rman_get_bushandle(ctlr->r_res2), rman_get_size(ctlr->r_res2), + BUS_SPACE_MAP_LINEAR, NULL)) { + bus_release_resource(dev, ctlr->r_type1, ctlr->r_rid1, + ctlr->r_res1); + bus_release_resource(dev, ctlr->r_type2, ctlr->r_rid2, + ctlr->r_res2); + return (ENXIO); + } +#endif ctlr->ch_attach = ata_siiprb_ch_attach; ctlr->ch_detach = ata_siiprb_ch_detach; ctlr->reset = ata_siiprb_reset; @@ -432,7 +442,6 @@ ata_sii_setmode(device_t dev, int target return (mode); } - struct ata_siiprb_dma_prdentry { u_int64_t addr; u_int32_t count; Modified: stable/8/sys/dev/fb/machfb.c ============================================================================== --- stable/8/sys/dev/fb/machfb.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/dev/fb/machfb.c Sun Jan 29 00:00:15 2012 (r230688) @@ -87,7 +87,9 @@ struct machfb_softc { struct resource *sc_vmemres; bus_space_tag_t sc_memt; bus_space_tag_t sc_regt; + bus_space_tag_t sc_vmemt; bus_space_handle_t sc_memh; + bus_space_handle_t sc_vmemh; bus_space_handle_t sc_regh; u_long sc_mem; u_long sc_vmem; @@ -1175,68 +1177,52 @@ machfb_pci_attach(device_t dev) adp = &sc->sc_va; vi = &adp->va_info; - /* - * Allocate resources regardless of whether we are the console - * and already obtained the bus tag and handle for the framebuffer - * in machfb_configure() or not so the resources are marked as - * taken in the respective RMAN. - */ - - /* Enable memory and IO access. */ - pci_write_config(dev, PCIR_COMMAND, - pci_read_config(dev, PCIR_COMMAND, 2) | PCIM_CMD_PORTEN | - PCIM_CMD_MEMEN, 2); - - /* - * NB: we need to take care that the framebuffer isn't mapped - * in twice as besides wasting resources this isn't possible with - * all MMUs. - */ rid = PCIR_BAR(0); - if ((sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &rid, 0)) == NULL) { + if ((sc->sc_memres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE)) == NULL) { device_printf(dev, "cannot allocate memory resources\n"); return (ENXIO); } + sc->sc_memt = rman_get_bustag(sc->sc_memres); + sc->sc_memh = rman_get_bushandle(sc->sc_memres); + sc->sc_mem = rman_get_start(sc->sc_memres); + vi->vi_buffer = sc->sc_memh; + vi->vi_buffer_size = rman_get_size(sc->sc_memres); if (OF_getprop(sc->sc_node, "address", &u32, sizeof(u32)) > 0 && - vtophys(u32) == rman_get_bushandle(sc->sc_memres)) + vtophys(u32) == sc->sc_memh) adp->va_mem_base = u32; else { - bus_release_resource(dev, SYS_RES_MEMORY, - rman_get_rid(sc->sc_memres), sc->sc_memres); - rid = PCIR_BAR(0); - if ((sc->sc_memres = bus_alloc_resource_any(dev, - SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) { - device_printf(dev, - "cannot allocate memory resources\n"); - return (ENXIO); + if (bus_space_map(sc->sc_memt, vi->vi_buffer, + vi->vi_buffer_size, BUS_SPACE_MAP_LINEAR, + &sc->sc_memh) != 0) { + device_printf(dev, "cannot map memory resources\n"); + error = ENXIO; + goto fail_memres; } adp->va_mem_base = (vm_offset_t)rman_get_virtual(sc->sc_memres); } - sc->sc_memt = rman_get_bustag(sc->sc_memres); - sc->sc_memh = rman_get_bushandle(sc->sc_memres); - sc->sc_regt = sc->sc_memt; - bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF, - MACH64_REG_SIZE, &sc->sc_regh); - adp->va_mem_size = rman_get_size(sc->sc_memres); + adp->va_mem_size = vi->vi_buffer_size; adp->va_buffer = adp->va_mem_base; adp->va_buffer_size = adp->va_mem_size; - sc->sc_mem = rman_get_start(sc->sc_memres); - vi->vi_buffer = sc->sc_memh; - vi->vi_buffer_size = adp->va_buffer_size; + sc->sc_regt = sc->sc_memt; + if (bus_space_subregion(sc->sc_regt, sc->sc_memh, MACH64_REG_OFF, + MACH64_REG_SIZE, &sc->sc_regh) != 0) { + device_printf(dev, "cannot allocate register resources\n"); + error = ENXIO; + goto fail_memmap; + } /* * Depending on the firmware version the VGA I/O and/or memory - * resources of the Mach64 chips come up disabled. We generally - * enable them above (pci(4) actually already did this unless - * pci_enable_io_modes is not set) but this doesn't necessarily - * mean that we get valid ones. Invalid resources seem to have - * in common that they start at address 0. We don't allocate - * them in this case in order to avoid warnings in apb(4) and - * crashes when using these invalid resources. X.Org is aware - * of this and doesn't use the VGA resources in this case (but - * demands them if they are valid). + * resources of the Mach64 chips come up disabled. These will be + * enabled by pci(4) when activating the resource in question but + * this doesn't necessarily mean that the resource is valid. + * Invalid resources seem to have in common that they start at + * address 0. We don't allocate the VGA memory in this case in + * order to avoid warnings in apb(4) and crashes when using this + * invalid resources. X.Org is aware of this and doesn't use the + * VGA memory resource in this case (but demands it if it's valid). */ rid = PCIR_BAR(2); if (bus_get_resource_start(dev, SYS_RES_MEMORY, rid) != 0) { @@ -1245,21 +1231,31 @@ machfb_pci_attach(device_t dev) device_printf(dev, "cannot allocate VGA memory resources\n"); error = ENXIO; - goto fail_memres; + goto fail_memmap; + } + sc->sc_vmemt = rman_get_bustag(sc->sc_vmemres); + sc->sc_vmemh = rman_get_bushandle(sc->sc_vmemres); + sc->sc_vmem = rman_get_start(sc->sc_vmemres); + vi->vi_registers = sc->sc_vmemh; + vi->vi_registers_size = rman_get_size(sc->sc_vmemres); + if (bus_space_map(sc->sc_vmemt, vi->vi_registers, + vi->vi_registers_size, BUS_SPACE_MAP_LINEAR, + &sc->sc_vmemh) != 0) { + device_printf(dev, + "cannot map VGA memory resources\n"); + error = ENXIO; + goto fail_vmemres; } adp->va_registers = (vm_offset_t)rman_get_virtual(sc->sc_vmemres); - adp->va_registers_size = rman_get_size(sc->sc_vmemres); - sc->sc_vmem = rman_get_start(sc->sc_vmemres); - vi->vi_registers = rman_get_bushandle(sc->sc_vmemres); - vi->vi_registers_size = adp->va_registers_size; + adp->va_registers_size = vi->vi_registers_size; } if (!(sc->sc_flags & MACHFB_CONSOLE)) { if ((sw = vid_get_switch(MACHFB_DRIVER_NAME)) == NULL) { device_printf(dev, "cannot get video switch\n"); error = ENODEV; - goto fail_vmemres; + goto fail_vmemmap; } /* * During device configuration we don't necessarily probe @@ -1275,7 +1271,7 @@ machfb_pci_attach(device_t dev) break; if ((error = sw->init(i, adp, 0)) != 0) { device_printf(dev, "cannot initialize adapter\n"); - goto fail_vmemres; + goto fail_vmemmap; } } @@ -1283,8 +1279,8 @@ machfb_pci_attach(device_t dev) * Test whether the aperture is byte swapped or not, set * va_window and va_window_size as appropriate. Note that * the aperture could be mapped either big or little endian - * on independently of the endianess of the host so this - * has to be a runtime test. + * independently of the endianess of the host so this has + * to be a runtime test. */ p32 = (uint32_t *)adp->va_buffer; u32 = *p32; @@ -1346,10 +1342,16 @@ machfb_pci_attach(device_t dev) return (0); + fail_vmemmap: + if (adp->va_registers != 0) + bus_space_unmap(sc->sc_vmemt, sc->sc_vmemh, + vi->vi_registers_size); fail_vmemres: if (sc->sc_vmemres != NULL) bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->sc_vmemres), sc->sc_vmemres); + fail_memmap: + bus_space_unmap(sc->sc_memt, sc->sc_memh, vi->vi_buffer_size); fail_memres: bus_release_resource(dev, SYS_RES_MEMORY, rman_get_rid(sc->sc_memres), sc->sc_memres); Modified: stable/8/sys/dev/le/lebuffer_sbus.c ============================================================================== --- stable/8/sys/dev/le/lebuffer_sbus.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/dev/le/lebuffer_sbus.c Sun Jan 29 00:00:15 2012 (r230688) @@ -81,6 +81,7 @@ static device_method_t lebuffer_methods[ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), + DEVMETHOD(bus_adjust_resource, bus_generic_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), Modified: stable/8/sys/sparc64/central/central.c ============================================================================== --- stable/8/sys/sparc64/central/central.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/sparc64/central/central.c Sun Jan 29 00:00:15 2012 (r230688) @@ -60,6 +60,7 @@ static device_attach_t central_attach; static bus_print_child_t central_print_child; static bus_probe_nomatch_t central_probe_nomatch; static bus_alloc_resource_t central_alloc_resource; +static bus_adjust_resource_t central_adjust_resource; static bus_get_resource_list_t central_get_resource_list; static ofw_bus_get_devinfo_t central_get_devinfo; @@ -79,6 +80,7 @@ static device_method_t central_methods[] DEVMETHOD(bus_alloc_resource, central_alloc_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, central_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -180,6 +182,15 @@ central_attach(device_t dev) } static int +central_adjust_resource(device_t bus __unused, device_t child __unused, + int type __unused, struct resource *r __unused, u_long start __unused, + u_long end __unused) +{ + + return (ENXIO); +} + +static int central_print_child(device_t dev, device_t child) { int rv; Modified: stable/8/sys/sparc64/conf/DEFAULTS ============================================================================== --- stable/8/sys/sparc64/conf/DEFAULTS Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/sparc64/conf/DEFAULTS Sun Jan 29 00:00:15 2012 (r230688) @@ -19,3 +19,5 @@ options GEOM_PART_VTOC8 # Let sunkbd emulate an AT keyboard by default. options SUNKBD_EMULATE_ATKBD + +options NEW_PCIB Modified: stable/8/sys/sparc64/ebus/ebus.c ============================================================================== --- stable/8/sys/sparc64/ebus/ebus.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/sparc64/ebus/ebus.c Sun Jan 29 00:00:15 2012 (r230688) @@ -136,6 +136,8 @@ static device_attach_t ebus_pci_attach; static bus_print_child_t ebus_print_child; static bus_probe_nomatch_t ebus_probe_nomatch; static bus_alloc_resource_t ebus_alloc_resource; +static bus_activate_resource_t ebus_activate_resource; +static bus_adjust_resource_t ebus_adjust_resource; static bus_release_resource_t ebus_release_resource; static bus_setup_intr_t ebus_setup_intr; static bus_get_resource_list_t ebus_get_resource_list; @@ -161,8 +163,9 @@ static device_method_t ebus_nexus_method DEVMETHOD(bus_print_child, ebus_print_child), DEVMETHOD(bus_probe_nomatch, ebus_probe_nomatch), DEVMETHOD(bus_alloc_resource, ebus_alloc_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), + DEVMETHOD(bus_activate_resource, ebus_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, ebus_adjust_resource), DEVMETHOD(bus_release_resource, ebus_release_resource), DEVMETHOD(bus_setup_intr, ebus_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -342,16 +345,10 @@ ebus_pci_attach(device_t dev) eri->eri_res = res; eri->eri_rman.rm_type = RMAN_ARRAY; eri->eri_rman.rm_descr = "EBus range"; - if (rman_init(&eri->eri_rman) != 0) { + if (rman_init_from_resource(&eri->eri_rman, res) != 0) { printf("%s: failed to initialize rman!", __func__); goto fail; } - if (rman_manage_region(&eri->eri_rman, rman_get_start(res), - rman_get_end(res)) != 0) { - printf("%s: failed to register region!", __func__); - rman_fini(&eri->eri_rman); - goto fail; - } } return (ebus_attach(dev, sc, node)); @@ -423,12 +420,10 @@ ebus_alloc_resource(device_t bus, device struct resource_list *rl; struct resource_list_entry *rle = NULL; struct resource *res; - struct ebus_rinfo *ri; + struct ebus_rinfo *eri; struct ebus_nexus_ranges *enr; - bus_space_tag_t bt; - bus_space_handle_t bh; uint64_t cend, cstart, offset; - int i, isdefault, passthrough, ridx, rv; + int i, isdefault, passthrough, ridx; isdefault = (start == 0UL && end == ~0UL); passthrough = (device_get_parent(child) != bus); @@ -459,23 +454,17 @@ ebus_alloc_resource(device_t bus, device */ (void)ofw_isa_range_map(sc->sc_range, sc->sc_nrange, &start, &end, &ridx); - ri = &sc->sc_rinfo[ridx]; - res = rman_reserve_resource(&ri->eri_rman, start, end, - count, flags, child); + eri = &sc->sc_rinfo[ridx]; + res = rman_reserve_resource(&eri->eri_rman, start, + end, count, flags & ~RF_ACTIVE, child); if (res == NULL) return (NULL); rman_set_rid(res, *rid); - bt = rman_get_bustag(ri->eri_res); - rman_set_bustag(res, bt); - rv = bus_space_subregion(bt, - rman_get_bushandle(ri->eri_res), - rman_get_start(res) - rman_get_start(ri->eri_res), - count, &bh); - if (rv != 0) { + if ((flags & RF_ACTIVE) != 0 && bus_activate_resource( + child, type, *rid, res) != 0) { rman_release_resource(res); return (NULL); } - rman_set_bushandle(res, bh); } else { /* Map EBus ranges to nexus ranges. */ for (i = 0; i < sc->sc_nrange; i++) { @@ -496,7 +485,6 @@ ebus_alloc_resource(device_t bus, device break; } } - } if (!passthrough) rle->res = res; @@ -509,6 +497,48 @@ ebus_alloc_resource(device_t bus, device } static int +ebus_activate_resource(device_t bus, device_t child, int type, int rid, + struct resource *res) +{ + struct ebus_softc *sc; + struct ebus_rinfo *eri; + bus_space_tag_t bt; + bus_space_handle_t bh; + int i, rv; + + sc = device_get_softc(bus); + if ((sc->sc_flags & EBUS_PCI) != 0 && type == SYS_RES_MEMORY) { + for (i = 0; i < sc->sc_nrange; i++) { + eri = &sc->sc_rinfo[i]; + if (rman_is_region_manager(res, &eri->eri_rman) != 0) { + bt = rman_get_bustag(eri->eri_res); + rv = bus_space_subregion(bt, + rman_get_bushandle(eri->eri_res), + rman_get_start(res) - + rman_get_start(eri->eri_res), + rman_get_size(res), &bh); + if (rv != 0) + return (rv); + rman_set_bustag(res, bt); + rman_set_bushandle(res, bh); + return (rman_activate_resource(res)); + } + } + return (EINVAL); + } + return (bus_generic_activate_resource(bus, child, type, rid, res)); +} + +static int +ebus_adjust_resource(device_t bus __unused, device_t child __unused, + int type __unused, struct resource *res __unused, u_long start __unused, + u_long end __unused) +{ + + return (ENXIO); +} + +static int ebus_release_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { @@ -519,13 +549,15 @@ ebus_release_resource(device_t bus, devi passthrough = (device_get_parent(child) != bus); rl = BUS_GET_RESOURCE_LIST(bus, child); - switch (type) { - case SYS_RES_MEMORY: - sc = device_get_softc(bus); - if ((sc->sc_flags & EBUS_PCI) == 0) - return (resource_list_release(rl, bus, child, type, - rid, res)); - if ((rv = rman_release_resource(res)) != 0) + sc = device_get_softc(bus); + if ((sc->sc_flags & EBUS_PCI) != 0 && type == SYS_RES_MEMORY) { + if ((rman_get_flags(res) & RF_ACTIVE) != 0 ){ + rv = bus_deactivate_resource(child, type, rid, res); + if (rv != 0) + return (rv); + } + rv = rman_release_resource(res); + if (rv != 0) return (rv); if (!passthrough) { rle = resource_list_find(rl, type, rid); @@ -535,13 +567,9 @@ ebus_release_resource(device_t bus, devi ("%s: resource entry is not busy", __func__)); rle->res = NULL; } - break; - case SYS_RES_IRQ: - return (resource_list_release(rl, bus, child, type, rid, res)); - default: - panic("%s: unsupported resource type %d", __func__, type); + return (0); } - return (0); + return (resource_list_release(rl, bus, child, type, rid, res)); } static int Modified: stable/8/sys/sparc64/fhc/fhc.c ============================================================================== --- stable/8/sys/sparc64/fhc/fhc.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/sparc64/fhc/fhc.c Sun Jan 29 00:00:15 2012 (r230688) @@ -69,6 +69,7 @@ static bus_print_child_t fhc_print_child static bus_probe_nomatch_t fhc_probe_nomatch; static bus_setup_intr_t fhc_setup_intr; static bus_alloc_resource_t fhc_alloc_resource; +static bus_adjust_resource_t fhc_adjust_resource; static bus_get_resource_list_t fhc_get_resource_list; static ofw_bus_get_devinfo_t fhc_get_devinfo; @@ -93,6 +94,7 @@ static device_method_t fhc_methods[] = { DEVMETHOD(bus_alloc_resource, fhc_alloc_resource), DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, fhc_adjust_resource), DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), DEVMETHOD(bus_setup_intr, fhc_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), @@ -475,6 +477,15 @@ fhc_alloc_resource(device_t bus, device_ return (res); } +static int +fhc_adjust_resource(device_t bus __unused, device_t child __unused, + int type __unused, struct resource *r __unused, u_long start __unused, + u_long end __unused) +{ + + return (ENXIO); +} + static struct resource_list * fhc_get_resource_list(device_t bus, device_t child) { Modified: stable/8/sys/sparc64/include/bus.h ============================================================================== --- stable/8/sys/sparc64/include/bus.h Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/sparc64/include/bus.h Sun Jan 29 00:00:15 2012 (r230688) @@ -122,32 +122,15 @@ static int bus_space_subregion(bus_space /* * Map a region of device bus space into CPU virtual address space. */ - -static __inline int bus_space_map(bus_space_tag_t t, bus_addr_t addr, - bus_size_t size, int flags, bus_space_handle_t *bshp); - -static __inline int -bus_space_map(bus_space_tag_t t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, bus_space_handle_t *bshp) -{ - - *bshp = addr; - return (0); -} +int bus_space_map(bus_space_tag_t tag, bus_addr_t address, bus_size_t size, + int flags, bus_space_handle_t *handlep); /* * Unmap a region of device bus space. */ -static __inline void bus_space_unmap(bus_space_tag_t t, bus_space_handle_t bsh, +void bus_space_unmap(bus_space_tag_t tag, bus_space_handle_t handle, bus_size_t size); -static __inline void -bus_space_unmap(bus_space_tag_t t __unused, bus_space_handle_t bsh __unused, - bus_size_t size __unused) -{ - -} - /* This macro finds the first "upstream" implementation of method `f' */ #define _BS_CALL(t,f) \ while (t->f == NULL) \ Modified: stable/8/sys/sparc64/include/bus_private.h ============================================================================== --- stable/8/sys/sparc64/include/bus_private.h Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/sparc64/include/bus_private.h Sun Jan 29 00:00:15 2012 (r230688) @@ -36,10 +36,14 @@ /* * Helpers */ -int sparc64_bus_mem_map(bus_space_tag_t, bus_space_handle_t, bus_size_t, - int, vm_offset_t, void **); -int sparc64_bus_mem_unmap(void *, bus_size_t); -bus_space_handle_t sparc64_fake_bustag(int, bus_addr_t, struct bus_space_tag *); +int sparc64_bus_mem_map(bus_space_tag_t tag, bus_addr_t addr, bus_size_t size, + int flags, vm_offset_t vaddr, bus_space_handle_t *hp); +int sparc64_bus_mem_unmap(bus_space_tag_t tag, bus_space_handle_t handle, + bus_size_t size); +bus_space_tag_t sparc64_alloc_bus_tag(void *cookie, + struct bus_space_tag *ptag, int type, void *barrier); +bus_space_handle_t sparc64_fake_bustag(int space, bus_addr_t addr, + struct bus_space_tag *ptag); struct bus_dmamap_res { struct resource *dr_res; Modified: stable/8/sys/sparc64/pci/apb.c ============================================================================== --- stable/8/sys/sparc64/pci/apb.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/sparc64/pci/apb.c Sun Jan 29 00:00:15 2012 (r230688) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -77,6 +78,7 @@ struct apb_softc { static device_probe_t apb_probe; static device_attach_t apb_attach; static bus_alloc_resource_t apb_alloc_resource; +static bus_adjust_resource_t apb_adjust_resource; static device_method_t apb_methods[] = { /* Device interface */ @@ -85,6 +87,8 @@ static device_method_t apb_methods[] = { /* Bus interface */ DEVMETHOD(bus_alloc_resource, apb_alloc_resource), + DEVMETHOD(bus_adjust_resource, apb_adjust_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), /* pcib interface */ DEVMETHOD(pcib_route_interrupt, ofw_pcib_gen_route_interrupt), @@ -158,6 +162,8 @@ static int apb_attach(device_t dev) { struct apb_softc *sc; + struct sysctl_ctx_list *sctx; + struct sysctl_oid *soid; sc = device_get_softc(dev); @@ -165,12 +171,41 @@ apb_attach(device_t dev) * Get current bridge configuration. */ sc->sc_bsc.ops_pcib_sc.domain = pci_get_domain(dev); + sc->sc_bsc.ops_pcib_sc.secstat = + pci_read_config(dev, PCIR_SECSTAT_1, 2); + sc->sc_bsc.ops_pcib_sc.command = + pci_read_config(dev, PCIR_COMMAND, 2); + sc->sc_bsc.ops_pcib_sc.pribus = + pci_read_config(dev, PCIR_PRIBUS_1, 1); sc->sc_bsc.ops_pcib_sc.secbus = pci_read_config(dev, PCIR_SECBUS_1, 1); sc->sc_bsc.ops_pcib_sc.subbus = pci_read_config(dev, PCIR_SUBBUS_1, 1); + sc->sc_bsc.ops_pcib_sc.bridgectl = + pci_read_config(dev, PCIR_BRIDGECTL_1, 2); + sc->sc_bsc.ops_pcib_sc.seclat = + pci_read_config(dev, PCIR_SECLAT_1, 1); sc->sc_iomap = pci_read_config(dev, APBR_IOMAP, 1); sc->sc_memmap = pci_read_config(dev, APBR_MEMMAP, 1); + + /* + * Setup SYSCTL reporting nodes. + */ + sctx = device_get_sysctl_ctx(dev); + soid = device_get_sysctl_tree(dev); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "domain", + CTLFLAG_RD, &sc->sc_bsc.ops_pcib_sc.domain, 0, + "Domain number"); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "pribus", + CTLFLAG_RD, &sc->sc_bsc.ops_pcib_sc.pribus, 0, + "Primary bus number"); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "secbus", + CTLFLAG_RD, &sc->sc_bsc.ops_pcib_sc.secbus, 0, + "Secondary bus number"); + SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "subbus", + CTLFLAG_RD, &sc->sc_bsc.ops_pcib_sc.subbus, 0, + "Subordinate bus number"); + ofw_pcib_gen_setup(dev); if (bootverbose) { @@ -233,9 +268,9 @@ apb_alloc_resource(device_t dev, device_ "%s requested decoded I/O range 0x%lx-0x%lx\n", device_get_nameunit(child), start, end); break; - case SYS_RES_MEMORY: - if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start, end)) { + if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start, + end)) { device_printf(dev, "device %s requested unsupported " "memory range 0x%lx-0x%lx\n", device_get_nameunit(child), start, end); @@ -246,9 +281,6 @@ apb_alloc_resource(device_t dev, device_ "%s requested decoded memory range 0x%lx-0x%lx\n", device_get_nameunit(child), start, end); break; - - default: - break; } passup: @@ -258,3 +290,23 @@ apb_alloc_resource(device_t dev, device_ return (bus_generic_alloc_resource(dev, child, type, rid, start, end, count, flags)); } + +static int +apb_adjust_resource(device_t dev, device_t child, int type, + struct resource *r, u_long start, u_long end) +{ + struct apb_softc *sc; + + sc = device_get_softc(dev); + switch (type) { + case SYS_RES_IOPORT: + if (!apb_checkrange(sc->sc_iomap, APB_IO_SCALE, start, end)) + return (ENXIO); + break; + case SYS_RES_MEMORY: + if (!apb_checkrange(sc->sc_memmap, APB_MEM_SCALE, start, end)) + return (ENXIO); + break; + } + return (bus_generic_adjust_resource(dev, child, type, r, start, end)); +} Modified: stable/8/sys/sparc64/pci/fire.c ============================================================================== --- stable/8/sys/sparc64/pci/fire.c Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/sparc64/pci/fire.c Sun Jan 29 00:00:15 2012 (r230688) @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); struct fire_msiqarg; -static bus_space_tag_t fire_alloc_bus_tag(struct fire_softc *sc, int type); static const struct fire_desc *fire_get_desc(device_t dev); static void fire_dmamap_sync(bus_dma_tag_t dt __unused, bus_dmamap_t map, bus_dmasync_op_t op); @@ -113,11 +112,11 @@ static driver_filter_t fire_xcb; * Methods */ static bus_activate_resource_t fire_activate_resource; +static bus_adjust_resource_t fire_adjust_resource; static pcib_alloc_msi_t fire_alloc_msi; static pcib_alloc_msix_t fire_alloc_msix; static bus_alloc_resource_t fire_alloc_resource; static device_attach_t fire_attach; -static bus_deactivate_resource_t fire_deactivate_resource; static bus_get_dma_tag_t fire_get_dma_tag; static ofw_bus_get_node_t fire_get_node; static pcib_map_msi_t fire_map_msi; @@ -127,7 +126,6 @@ static pcib_read_config_t fire_read_conf static bus_read_ivar_t fire_read_ivar; static pcib_release_msi_t fire_release_msi; static pcib_release_msix_t fire_release_msix; -static bus_release_resource_t fire_release_resource; static pcib_route_interrupt_t fire_route_interrupt; static bus_setup_intr_t fire_setup_intr; static bus_teardown_intr_t fire_teardown_intr; @@ -147,9 +145,10 @@ static device_method_t fire_methods[] = DEVMETHOD(bus_setup_intr, fire_setup_intr), DEVMETHOD(bus_teardown_intr, fire_teardown_intr), DEVMETHOD(bus_alloc_resource, fire_alloc_resource), - DEVMETHOD(bus_activate_resource, fire_activate_resource), - DEVMETHOD(bus_deactivate_resource, fire_deactivate_resource), - DEVMETHOD(bus_release_resource, fire_release_resource), + DEVMETHOD(bus_activate_resource, fire_activate_resource), + DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), + DEVMETHOD(bus_adjust_resource, fire_adjust_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), DEVMETHOD(bus_get_dma_tag, fire_get_dma_tag), /* pcib interface */ @@ -757,13 +756,19 @@ fire_attach(device_t dev) free(range, M_OFWPROP); /* Allocate our tags. */ - sc->sc_pci_memt = fire_alloc_bus_tag(sc, PCI_MEMORY_BUS_SPACE); - sc->sc_pci_iot = fire_alloc_bus_tag(sc, PCI_IO_BUS_SPACE); - sc->sc_pci_cfgt = fire_alloc_bus_tag(sc, PCI_CONFIG_BUS_SPACE); + sc->sc_pci_iot = sparc64_alloc_bus_tag(NULL, rman_get_bustag( + sc->sc_mem_res[FIRE_PCI]), PCI_IO_BUS_SPACE, NULL); + if (sc->sc_pci_iot == NULL) + panic("%s: could not allocate PCI I/O tag", __func__); + sc->sc_pci_cfgt = sparc64_alloc_bus_tag(NULL, rman_get_bustag( + sc->sc_mem_res[FIRE_PCI]), PCI_CONFIG_BUS_SPACE, NULL); + if (sc->sc_pci_cfgt == NULL) + panic("%s: could not allocate PCI configuration space tag", + __func__); if (bus_dma_tag_create(bus_get_dma_tag(dev), 8, 0, sc->sc_is.is_pmaxaddr, ~0, NULL, NULL, sc->sc_is.is_pmaxaddr, 0xff, 0xffffffff, 0, NULL, NULL, &sc->sc_pci_dmat) != 0) - panic("%s: bus_dma_tag_create failed", __func__); + panic("%s: could not create PCI DMA tag", __func__); /* Customize the tag. */ sc->sc_pci_dmat->dt_cookie = &sc->sc_is; sc->sc_pci_dmat->dt_mt = &sc->sc_dma_methods; @@ -2015,14 +2020,10 @@ fire_alloc_resource(device_t bus, device struct fire_softc *sc; struct resource *rv; struct rman *rm; - bus_space_tag_t bt; - bus_space_handle_t bh; - int needactivate = flags & RF_ACTIVE; - - flags &= ~RF_ACTIVE; sc = device_get_softc(bus); - if (type == SYS_RES_IRQ) { + switch (type) { + case SYS_RES_IRQ: /* * XXX: Don't accept blank ranges for now, only single * interrupts. The other case should not happen with @@ -2034,38 +2035,28 @@ fire_alloc_resource(device_t bus, device panic("%s: XXX: interrupt range", __func__); if (*rid == 0) start = end = INTMAP_VEC(sc->sc_ign, end); - return (BUS_ALLOC_RESOURCE(device_get_parent(bus), child, - type, rid, start, end, count, flags)); - } - switch (type) { + return (bus_generic_alloc_resource(bus, child, type, rid, + start, end, count, flags)); case SYS_RES_MEMORY: rm = &sc->sc_pci_mem_rman; - bt = sc->sc_pci_memt; - bh = sc->sc_pci_bh[OFW_PCI_CS_MEM32]; break; case SYS_RES_IOPORT: rm = &sc->sc_pci_io_rman; - bt = sc->sc_pci_iot; - bh = sc->sc_pci_bh[OFW_PCI_CS_IO]; break; default: return (NULL); - /* NOTREACHED */ } - rv = rman_reserve_resource(rm, start, end, count, flags, child); + rv = rman_reserve_resource(rm, start, end, count, flags & ~RF_ACTIVE, + child); if (rv == NULL) return (NULL); rman_set_rid(rv, *rid); - bh += rman_get_start(rv); - rman_set_bustag(rv, bt); - rman_set_bushandle(rv, bh); - - if (needactivate) { - if (bus_activate_resource(child, type, *rid, rv)) { - rman_release_resource(rv); - return (NULL); - } + + if ((flags & RF_ACTIVE) != 0 && bus_activate_resource(child, type, + *rid, rv) != 0) { + rman_release_resource(rv); + return (NULL); } return (rv); } @@ -2074,56 +2065,56 @@ static int fire_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *r) { - void *p; - int error; + struct fire_softc *sc; + struct bus_space_tag *tag; - if (type == SYS_RES_IRQ) - return (BUS_ACTIVATE_RESOURCE(device_get_parent(bus), child, - type, rid, r)); - if (type == SYS_RES_MEMORY) { - /* - * Need to memory-map the device space, as some drivers - * depend on the virtual address being set and usable. - */ - error = sparc64_bus_mem_map(rman_get_bustag(r), - rman_get_bushandle(r), rman_get_size(r), 0, 0, &p); - if (error != 0) - return (error); - rman_set_virtual(r, p); + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_IRQ: + return (bus_generic_activate_resource(bus, child, type, rid, + r)); + case SYS_RES_MEMORY: + tag = sparc64_alloc_bus_tag(r, rman_get_bustag( + sc->sc_mem_res[FIRE_PCI]), PCI_MEMORY_BUS_SPACE, NULL); + if (tag == NULL) + return (ENOMEM); + rman_set_bustag(r, tag); + rman_set_bushandle(r, sc->sc_pci_bh[OFW_PCI_CS_MEM32] + + rman_get_start(r)); + break; + case SYS_RES_IOPORT: + rman_set_bustag(r, sc->sc_pci_iot); + rman_set_bushandle(r, sc->sc_pci_bh[OFW_PCI_CS_IO] + + rman_get_start(r)); + break; } return (rman_activate_resource(r)); } static int -fire_deactivate_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) +fire_adjust_resource(device_t bus, device_t child, int type, + struct resource *r, u_long start, u_long end) { + struct fire_softc *sc; + struct rman *rm; - if (type == SYS_RES_IRQ) - return (BUS_DEACTIVATE_RESOURCE(device_get_parent(bus), child, - type, rid, r)); - if (type == SYS_RES_MEMORY) { - sparc64_bus_mem_unmap(rman_get_virtual(r), rman_get_size(r)); - rman_set_virtual(r, NULL); - } - return (rman_deactivate_resource(r)); -} - -static int -fire_release_resource(device_t bus, device_t child, int type, int rid, - struct resource *r) -{ - int error; - - if (type == SYS_RES_IRQ) - return (BUS_RELEASE_RESOURCE(device_get_parent(bus), child, - type, rid, r)); - if (rman_get_flags(r) & RF_ACTIVE) { - error = bus_deactivate_resource(child, type, rid, r); - if (error) - return (error); + sc = device_get_softc(bus); + switch (type) { + case SYS_RES_IRQ: + return (bus_generic_adjust_resource(bus, child, type, r, + start, end)); + case SYS_RES_MEMORY: + rm = &sc->sc_pci_mem_rman; + break; + case SYS_RES_IOPORT: + rm = &sc->sc_pci_io_rman; + break; + default: + return (EINVAL); } - return (rman_release_resource(r)); + if (rman_is_region_manager(r, rm) == 0) + return (EINVAL); + return (rman_adjust_resource(r, start, end)); } static bus_dma_tag_t @@ -2145,22 +2136,6 @@ fire_get_node(device_t bus, device_t chi return (sc->sc_node); } -static bus_space_tag_t -fire_alloc_bus_tag(struct fire_softc *sc, int type) -{ - bus_space_tag_t bt; - - bt = malloc(sizeof(struct bus_space_tag), M_DEVBUF, - M_NOWAIT | M_ZERO); - if (bt == NULL) - panic("%s: out of memory", __func__); - - bt->bst_cookie = sc; - bt->bst_parent = rman_get_bustag(sc->sc_mem_res[FIRE_PCI]); - bt->bst_type = type; - return (bt); -} - static u_int fire_get_timecount(struct timecounter *tc) { Modified: stable/8/sys/sparc64/pci/firevar.h ============================================================================== --- stable/8/sys/sparc64/pci/firevar.h Sat Jan 28 23:53:06 2012 (r230687) +++ stable/8/sys/sparc64/pci/firevar.h Sun Jan 29 00:00:15 2012 (r230688) @@ -47,7 +47,6 @@ struct fire_softc { bus_space_handle_t sc_pci_bh[FIRE_NRANGE]; bus_space_tag_t sc_pci_cfgt; bus_space_tag_t sc_pci_iot; - bus_space_tag_t sc_pci_memt; bus_dma_tag_t sc_pci_dmat; device_t sc_dev; Modified: stable/8/sys/sparc64/pci/ofw_pcib_subr.c ============================================================================== --- stable/8/sys/sparc64/pci/ofw_pcib_subr.c Sat Jan 28 23:53:06 2012 (r230687) *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***