From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 00:42:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30C903F8; Sun, 6 Jan 2013 00:42:10 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 22E17BDB; Sun, 6 Jan 2013 00:42:10 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r060gA02028168; Sun, 6 Jan 2013 00:42:10 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r060g9QD028166; Sun, 6 Jan 2013 00:42:09 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301060042.r060g9QD028166@svn.freebsd.org> From: Andrew Turner Date: Sun, 6 Jan 2013 00:42:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245083 - in head/sys/arm: arm include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 00:42:10 -0000 Author: andrew Date: Sun Jan 6 00:42:09 2013 New Revision: 245083 URL: http://svnweb.freebsd.org/changeset/base/245083 Log: Only work around errata when we are on a part where the erratum applies. Reviewed by: gonzo Modified: head/sys/arm/arm/pl310.c head/sys/arm/include/pl310.h Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Sun Jan 6 00:38:25 2013 (r245082) +++ head/sys/arm/arm/pl310.c Sun Jan 6 00:42:09 2013 (r245083) @@ -135,11 +135,12 @@ pl310_cache_sync(void) return; #ifdef PL310_ERRATA_753970 - /* Write uncached PL310 register */ - pl310_write4(pl310_softc, 0x740, 0xffffffff); -#else - pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + /* Write uncached PL310 register */ + pl310_write4(pl310_softc, 0x740, 0xffffffff); + else #endif + pl310_write4(pl310_softc, PL310_CACHE_SYNC, 0xffffffff); } @@ -152,13 +153,17 @@ pl310_wbinv_all(void) PL310_LOCK(pl310_softc); #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 3); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || + sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + platform_pl310_write_debug(pl310_softc, 3); #endif pl310_write4(pl310_softc, PL310_CLEAN_INV_WAY, g_l2cache_way_mask); pl310_wait_background_op(PL310_CLEAN_INV_WAY, g_l2cache_way_mask); pl310_cache_sync(); #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 0); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || + sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + platform_pl310_write_debug(pl310_softc, 0); #endif PL310_UNLOCK(pl310_softc); } @@ -182,27 +187,32 @@ pl310_wbinv_range(vm_paddr_t start, vm_s #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 3); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || + sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + platform_pl310_write_debug(pl310_softc, 3); #endif while (size > 0) { #ifdef PL310_ERRATA_588369 - /* - * Errata 588369 says that clean + inv may keep the - * cache line if it was clean, the recommanded workaround - * is to clean then invalidate the cache line, with - * write-back and cache linefill disabled - */ - - pl310_write4(pl310_softc, PL310_CLEAN_LINE_PA, start); - pl310_write4(pl310_softc, PL310_INV_LINE_PA, start); -#else - pl310_write4(pl310_softc, PL310_CLEAN_INV_LINE_PA, start); + if (sc->sc_rtl_release <= CACHE_ID_RELEASE_r1p0) { + /* + * Errata 588369 says that clean + inv may keep the + * cache line if it was clean, the recommanded + * workaround is to clean then invalidate the cache + * line, with write-back and cache linefill disabled. + */ + pl310_write4(pl310_softc, PL310_CLEAN_LINE_PA, start); + pl310_write4(pl310_softc, PL310_INV_LINE_PA, start); + } else #endif + pl310_write4(pl310_softc, PL310_CLEAN_INV_LINE_PA, + start); start += g_l2cache_line_size; size -= g_l2cache_line_size; } #ifdef PL310_ERRATA_727915 - platform_pl310_write_debug(pl310_softc, 0); + if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || + sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + platform_pl310_write_debug(pl310_softc, 0); #endif pl310_cache_sync(); @@ -307,6 +317,8 @@ pl310_attach(device_t dev) pl310_filter, NULL, sc, &sc->sc_irq_h); cache_id = pl310_read4(sc, PL310_CACHE_ID); + sc->sc_rtl_release = (cache_id >> CACHE_ID_RELEASE_SHIFT) & + CACHE_ID_RELEASE_MASK; device_printf(dev, "Part number: 0x%x, release: 0x%x\n", (cache_id >> CACHE_ID_PARTNUM_SHIFT) & CACHE_ID_PARTNUM_MASK, (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK); Modified: head/sys/arm/include/pl310.h ============================================================================== --- head/sys/arm/include/pl310.h Sun Jan 6 00:38:25 2013 (r245082) +++ head/sys/arm/include/pl310.h Sun Jan 6 00:42:09 2013 (r245083) @@ -131,6 +131,7 @@ struct pl310_softc { void* sc_irq_h; int sc_enabled; struct mtx sc_mtx; + u_int sc_rtl_revision; }; /** From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 00:49:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CAFC664E; Sun, 6 Jan 2013 00:49:06 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B3359C22; Sun, 6 Jan 2013 00:49:06 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r060n6mP029131; Sun, 6 Jan 2013 00:49:06 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r060n6tk029130; Sun, 6 Jan 2013 00:49:06 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301060049.r060n6tk029130@svn.freebsd.org> From: Andrew Turner Date: Sun, 6 Jan 2013 00:49:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245084 - head/lib/libc/arm/softfloat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 00:49:06 -0000 Author: andrew Date: Sun Jan 6 00:49:06 2013 New Revision: 245084 URL: http://svnweb.freebsd.org/changeset/base/245084 Log: Silence a clang warning by telling it we are only interested in left shifting the lower 32bits of the floating point value when we demangle it. Modified: head/lib/libc/arm/softfloat/arm-gcc.h Modified: head/lib/libc/arm/softfloat/arm-gcc.h ============================================================================== --- head/lib/libc/arm/softfloat/arm-gcc.h Sun Jan 6 00:42:09 2013 (r245083) +++ head/lib/libc/arm/softfloat/arm-gcc.h Sun Jan 6 00:49:06 2013 (r245084) @@ -95,7 +95,7 @@ what the endianness of the CPU. VFP is #define FLOAT64_DEMANGLE(a) (a) #define FLOAT64_MANGLE(a) (a) #else -#define FLOAT64_DEMANGLE(a) (((a) << 32) | ((a) >> 32)) +#define FLOAT64_DEMANGLE(a) ((((a) & 0xfffffffful) << 32) | ((a) >> 32)) #define FLOAT64_MANGLE(a) FLOAT64_DEMANGLE(a) #endif #endif From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 01:17:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A281DD1C; Sun, 6 Jan 2013 01:17:37 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85B75D30; Sun, 6 Jan 2013 01:17:37 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r061HbfQ038271; Sun, 6 Jan 2013 01:17:37 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r061HbVK038270; Sun, 6 Jan 2013 01:17:37 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301060117.r061HbVK038270@svn.freebsd.org> From: Andrew Turner Date: Sun, 6 Jan 2013 01:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245087 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 01:17:37 -0000 Author: andrew Date: Sun Jan 6 01:17:36 2013 New Revision: 245087 URL: http://svnweb.freebsd.org/changeset/base/245087 Log: Fix the build: * Use pl310_softc when the softc is otherwise unavailable. * Use the correct spelling of sc_rtl_revision. Modified: head/sys/arm/arm/pl310.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Sun Jan 6 01:11:45 2013 (r245086) +++ head/sys/arm/arm/pl310.c Sun Jan 6 01:17:36 2013 (r245087) @@ -135,7 +135,7 @@ pl310_cache_sync(void) return; #ifdef PL310_ERRATA_753970 - if (sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) /* Write uncached PL310 register */ pl310_write4(pl310_softc, 0x740, 0xffffffff); else @@ -153,16 +153,16 @@ pl310_wbinv_all(void) PL310_LOCK(pl310_softc); #ifdef PL310_ERRATA_727915 - if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || - sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r2p0 || + pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) platform_pl310_write_debug(pl310_softc, 3); #endif pl310_write4(pl310_softc, PL310_CLEAN_INV_WAY, g_l2cache_way_mask); pl310_wait_background_op(PL310_CLEAN_INV_WAY, g_l2cache_way_mask); pl310_cache_sync(); #ifdef PL310_ERRATA_727915 - if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || - sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r2p0 || + pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) platform_pl310_write_debug(pl310_softc, 0); #endif PL310_UNLOCK(pl310_softc); @@ -187,13 +187,13 @@ pl310_wbinv_range(vm_paddr_t start, vm_s #ifdef PL310_ERRATA_727915 - if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || - sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r2p0 || + pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) platform_pl310_write_debug(pl310_softc, 3); #endif while (size > 0) { #ifdef PL310_ERRATA_588369 - if (sc->sc_rtl_release <= CACHE_ID_RELEASE_r1p0) { + if (pl310_softc->sc_rtl_revision <= CACHE_ID_RELEASE_r1p0) { /* * Errata 588369 says that clean + inv may keep the * cache line if it was clean, the recommanded @@ -210,8 +210,8 @@ pl310_wbinv_range(vm_paddr_t start, vm_s size -= g_l2cache_line_size; } #ifdef PL310_ERRATA_727915 - if (sc->sc_rtl_release == CACHE_ID_RELEASE_r2p0 || - sc->sc_rtl_release == CACHE_ID_RELEASE_r3p0) + if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r2p0 || + pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) platform_pl310_write_debug(pl310_softc, 0); #endif @@ -317,7 +317,7 @@ pl310_attach(device_t dev) pl310_filter, NULL, sc, &sc->sc_irq_h); cache_id = pl310_read4(sc, PL310_CACHE_ID); - sc->sc_rtl_release = (cache_id >> CACHE_ID_RELEASE_SHIFT) & + sc->sc_rtl_revision = (cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK; device_printf(dev, "Part number: 0x%x, release: 0x%x\n", (cache_id >> CACHE_ID_PARTNUM_SHIFT) & CACHE_ID_PARTNUM_MASK, From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 02:50:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5443B65; Sun, 6 Jan 2013 02:50:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9D951EE1; Sun, 6 Jan 2013 02:50:39 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r062odqh066552; Sun, 6 Jan 2013 02:50:39 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r062odnl066551; Sun, 6 Jan 2013 02:50:39 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301060250.r062odnl066551@svn.freebsd.org> From: Andrew Turner Date: Sun, 6 Jan 2013 02:50:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245091 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 02:50:39 -0000 Author: andrew Date: Sun Jan 6 02:50:38 2013 New Revision: 245091 URL: http://svnweb.freebsd.org/changeset/base/245091 Log: When WCHAR_MIN == 0 the check if a wchar_t value will always be true. In this case skip the test as gcc complains it is always true. Modified: head/bin/ls/util.c Modified: head/bin/ls/util.c ============================================================================== --- head/bin/ls/util.c Sun Jan 6 01:46:01 2013 (r245090) +++ head/bin/ls/util.c Sun Jan 6 02:50:38 2013 (r245091) @@ -184,7 +184,10 @@ prn_octal(const char *s) for (i = 0; i < (int)clen; i++) putchar((unsigned char)s[i]); len += wcwidth(wc); - } else if (goodchar && f_octal_escape && wc >= 0 && + } else if (goodchar && f_octal_escape && +#if WCHAR_MIN < 0 + wc >= 0 && +#endif wc <= (wchar_t)UCHAR_MAX && (p = strchr(esc, (char)wc)) != NULL) { putchar('\\'); From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 03:08:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7951B134; Sun, 6 Jan 2013 03:08:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 61B1CFB7; Sun, 6 Jan 2013 03:08:28 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0638SVQ071564; Sun, 6 Jan 2013 03:08:28 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0638SA3071563; Sun, 6 Jan 2013 03:08:28 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301060308.r0638SA3071563@svn.freebsd.org> From: Andrew Turner Date: Sun, 6 Jan 2013 03:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245093 - head/usr.bin/ul X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 03:08:28 -0000 Author: andrew Date: Sun Jan 6 03:08:27 2013 New Revision: 245093 URL: http://svnweb.freebsd.org/changeset/base/245093 Log: Fix a signed/unsigned comparison when wchar_t is unsigned by casting the wchar_t to a wint_t. Modified: head/usr.bin/ul/ul.c Modified: head/usr.bin/ul/ul.c ============================================================================== --- head/usr.bin/ul/ul.c Sun Jan 6 02:52:23 2013 (r245092) +++ head/usr.bin/ul/ul.c Sun Jan 6 03:08:27 2013 (r245093) @@ -280,7 +280,7 @@ filter(FILE *f) obuf[col].c_width = w; for (i = 1; i < w; i++) obuf[col + i].c_width = -1; - } else if (obuf[col].c_char == c) { + } else if ((wint_t)obuf[col].c_char == c) { for (i = 0; i < w; i++) obuf[col + i].c_mode |= BOLD|mode; } else { From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 04:38:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7B3FDA6B; Sun, 6 Jan 2013 04:38:32 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D3871C0; Sun, 6 Jan 2013 04:38:32 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r064cWZF098425; Sun, 6 Jan 2013 04:38:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r064cW9U098424; Sun, 6 Jan 2013 04:38:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301060438.r064cW9U098424@svn.freebsd.org> From: Adrian Chadd Date: Sun, 6 Jan 2013 04:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245097 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 04:38:32 -0000 Author: adrian Date: Sun Jan 6 04:38:31 2013 New Revision: 245097 URL: http://svnweb.freebsd.org/changeset/base/245097 Log: Handle HWMP if_transmit() failure gracefully. If if_transmit() fails, the node ref may need freeing. This is based on the same logic used by the ageq, which the mesh code (re) uses for frames which need to be staged before transmitting. It also does the same thing - if M_ENCAP is set on the mbuf, it treats the recvif pointer as a node reference and derefs it. Modified: head/sys/net80211/ieee80211_hwmp.c Modified: head/sys/net80211/ieee80211_hwmp.c ============================================================================== --- head/sys/net80211/ieee80211_hwmp.c Sun Jan 6 03:51:44 2013 (r245096) +++ head/sys/net80211/ieee80211_hwmp.c Sun Jan 6 04:38:31 2013 (r245097) @@ -1227,6 +1227,8 @@ hwmp_recv_prep(struct ieee80211vap *vap, struct mbuf *m, *next; uint32_t metric = 0; const uint8_t *addr; + int is_encap; + struct ieee80211_node *ni_encap; if (ni == vap->iv_bss || ni->ni_mlstate != IEEE80211_NODE_MESH_ESTABLISHED) @@ -1403,11 +1405,21 @@ hwmp_recv_prep(struct ieee80211vap *vap, (struct ieee80211_node *)(uintptr_t) ieee80211_mac_hash(ic, addr)); /* either dest or ext_dest */ for (; m != NULL; m = next) { + is_encap = !! (m->m_flags & M_ENCAP); + ni_encap = (struct ieee80211_node *) m->m_pkthdr.rcvif; next = m->m_nextpkt; m->m_nextpkt = NULL; IEEE80211_NOTE(vap, IEEE80211_MSG_HWMP, ni, "flush queued frame %p len %d", m, m->m_pkthdr.len); - ifp->if_transmit(ifp, m); + + /* + * If the mbuf has M_ENCAP set, ensure we free it. + * Note that after if_transmit() is called, m is invalid. + */ + if (ifp->if_transmit(ifp, m) != 0) { + if (is_encap) + ieee80211_free_node(ni_encap); + } } #undef IS_PROXY #undef PROXIED_BY_US From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 04:40:08 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0CD91BEA; Sun, 6 Jan 2013 04:40:08 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F2B381D3; Sun, 6 Jan 2013 04:40:07 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r064e7D5098694; Sun, 6 Jan 2013 04:40:07 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r064e7vr098693; Sun, 6 Jan 2013 04:40:07 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301060440.r064e7vr098693@svn.freebsd.org> From: Adrian Chadd Date: Sun, 6 Jan 2013 04:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245098 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 04:40:08 -0000 Author: adrian Date: Sun Jan 6 04:40:07 2013 New Revision: 245098 URL: http://svnweb.freebsd.org/changeset/base/245098 Log: Handle ps-poll data frame if_transmit() failure. If the data frame transmission failures, it may have a node reference that needs cleaning up. If the frame is marked as M_ENCAP then it should treat recvif as a node reference and clear it. Now - since the mbuf has been freed by calling if_transmit() (even on failure), the mbuf has to be treated as invalid. Hence why the ifp is used. Modified: head/sys/net80211/ieee80211_hostap.c Modified: head/sys/net80211/ieee80211_hostap.c ============================================================================== --- head/sys/net80211/ieee80211_hostap.c Sun Jan 6 04:38:31 2013 (r245097) +++ head/sys/net80211/ieee80211_hostap.c Sun Jan 6 04:40:07 2013 (r245098) @@ -2324,5 +2324,19 @@ ieee80211_recv_pspoll(struct ieee80211_n ifp = vap->iv_ic->ic_ifp; else ifp = vap->iv_ifp; - (void) ifp->if_transmit(ifp, m); + + /* + * Free any node ref which this mbuf may have. + * + * Much like psq_mfree(), we assume that M_ENCAP nodes have + * node references. + */ + if (ifp->if_transmit(ifp, m) != 0) { + /* + * XXX m is invalid (freed) at this point, determine M_ENCAP + * an alternate way. + */ + if (ifp == vap->iv_ic->ic_ifp) + ieee80211_free_node(ni); + } } From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 07:14:05 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 165B58C2; Sun, 6 Jan 2013 07:14:05 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EB53A67F; Sun, 6 Jan 2013 07:14:04 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r067E4vY045438; Sun, 6 Jan 2013 07:14:04 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r067E4DB045436; Sun, 6 Jan 2013 07:14:04 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301060714.r067E4DB045436@svn.freebsd.org> From: Andrew Turner Date: Sun, 6 Jan 2013 07:14:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245101 - head/gnu/usr.bin/binutils/ld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 07:14:05 -0000 Author: andrew Date: Sun Jan 6 07:14:04 2013 New Revision: 245101 URL: http://svnweb.freebsd.org/changeset/base/245101 Log: Set the correct relocation type for R_ARM_TARGET2 to R_ARM_GOT_PREL. The TARGET2 relocation is unused in the current ABI but this change is required for EABI support. Modified: head/gnu/usr.bin/binutils/ld/armelf_fbsd.sh head/gnu/usr.bin/binutils/ld/armelfb_fbsd.sh Modified: head/gnu/usr.bin/binutils/ld/armelf_fbsd.sh ============================================================================== --- head/gnu/usr.bin/binutils/ld/armelf_fbsd.sh Sun Jan 6 05:37:26 2013 (r245100) +++ head/gnu/usr.bin/binutils/ld/armelf_fbsd.sh Sun Jan 6 07:14:04 2013 (r245101) @@ -1,6 +1,7 @@ # $FreeBSD$ . ${srcdir}/emulparams/armelf.sh . ${srcdir}/emulparams/elf_fbsd.sh +TARGET2_TYPE=got-rel MAXPAGESIZE=0x8000 GENERATE_PIE_SCRIPT=yes Modified: head/gnu/usr.bin/binutils/ld/armelfb_fbsd.sh ============================================================================== --- head/gnu/usr.bin/binutils/ld/armelfb_fbsd.sh Sun Jan 6 05:37:26 2013 (r245100) +++ head/gnu/usr.bin/binutils/ld/armelfb_fbsd.sh Sun Jan 6 07:14:04 2013 (r245101) @@ -5,6 +5,7 @@ #OUTPUT_FORMAT="elf32-bigarm" . ${srcdir}/emulparams/armelf.sh . ${srcdir}/emulparams/elf_fbsd.sh +TARGET2_TYPE=got-rel MAXPAGESIZE=0x8000 GENERATE_PIE_SCRIPT=yes From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 15:00:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2A7F872C; Sun, 6 Jan 2013 15:00:00 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8BA310; Sun, 6 Jan 2013 15:00:00 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r06ExxaG082132; Sun, 6 Jan 2013 14:59:59 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r06ExxGl082130; Sun, 6 Jan 2013 14:59:59 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201301061459.r06ExxGl082130@svn.freebsd.org> From: Peter Wemm Date: Sun, 6 Jan 2013 14:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245102 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 15:00:00 -0000 Author: peter Date: Sun Jan 6 14:59:59 2013 New Revision: 245102 URL: http://svnweb.freebsd.org/changeset/base/245102 Log: Juggle some internal symbols from our antique zlib (that originally came in from kernel-pppd which is long gone) so that ZFS and DTRACE play nice. This is a horrible hack to get freefall to compile, and is in dire need of reconciliation. This antique zlib-1.04 code needs to go away. Modified: head/sys/net/zlib.c head/sys/net/zlib.h Modified: head/sys/net/zlib.c ============================================================================== --- head/sys/net/zlib.c Sun Jan 6 07:14:04 2013 (r245101) +++ head/sys/net/zlib.c Sun Jan 6 14:59:59 2013 (r245102) @@ -25,7 +25,14 @@ #define MY_ZCALLOC #if defined(__FreeBSD__) && defined(_KERNEL) -#define inflate inflate_ppp /* FreeBSD already has an inflate :-( */ +#define _tr_init _zlib104_tr_init +#define _tr_align _zlib104_tr_align +#define _tr_tally _zlib104_tr_tally +#define _tr_flush_block _zlib104_tr_flush_block +#define _tr_stored_block _zlib104_tr_stored_block +#define inflate_fast _zlib104_inflate_fast +#define inflate _zlib104_inflate +#define zlibVersion _zlib104_Version #endif Modified: head/sys/net/zlib.h ============================================================================== --- head/sys/net/zlib.h Sun Jan 6 07:14:04 2013 (r245101) +++ head/sys/net/zlib.h Sun Jan 6 14:59:59 2013 (r245102) @@ -511,7 +511,7 @@ extern int EXPORT inflateInit OF((z_stre */ #if defined(__FreeBSD__) && defined(_KERNEL) -#define inflate inflate_ppp /* FreeBSD already has an inflate :-( */ +#define inflate _zlib104_inflate /* FreeBSD already has an inflate :-( */ #endif extern int EXPORT inflate OF((z_streamp strm, int flush)); From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 15:10:11 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 97807E06; Sun, 6 Jan 2013 15:10:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7207937E; Sun, 6 Jan 2013 15:10:11 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r06FAB09085647; Sun, 6 Jan 2013 15:10:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r06FABnq085646; Sun, 6 Jan 2013 15:10:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301061510.r06FABnq085646@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 6 Jan 2013 15:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245104 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 15:10:11 -0000 Author: kib Date: Sun Jan 6 15:10:10 2013 New Revision: 245104 URL: http://svnweb.freebsd.org/changeset/base/245104 Log: Protect the p->p_pgrp dereference with the process lock. MFC after: 3 days Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sun Jan 6 15:07:19 2013 (r245103) +++ head/sys/kern/kern_exit.c Sun Jan 6 15:10:10 2013 (r245104) @@ -1074,7 +1074,9 @@ kern_wait6(struct thread *td, idtype_t i q = td->td_proc; if ((pid_t)id == WAIT_MYPGRP && (idtype == P_PID || idtype == P_PGID)) { + PROC_LOCK(q); id = (id_t)q->p_pgid; + PROC_UNLOCK(q); idtype = P_PGID; } From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 16:39:06 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D9453A81; Sun, 6 Jan 2013 16:39:06 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 49751892; Sun, 6 Jan 2013 16:39:05 +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 r06Gcv4S060614; Sun, 6 Jan 2013 20:38:57 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id r06Gcvxt060613; Sun, 6 Jan 2013 20:38:57 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 6 Jan 2013 20:38:57 +0400 From: Gleb Smirnoff To: Peter Wemm Subject: Re: svn commit: r245102 - head/sys/net Message-ID: <20130106163857.GF51864@FreeBSD.org> References: <201301061459.r06ExxGl082130@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201301061459.r06ExxGl082130@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 16:39:06 -0000 On Sun, Jan 06, 2013 at 02:59:59PM +0000, Peter Wemm wrote: P> Author: peter P> Date: Sun Jan 6 14:59:59 2013 P> New Revision: 245102 P> URL: http://svnweb.freebsd.org/changeset/base/245102 P> P> Log: P> Juggle some internal symbols from our antique zlib (that originally came P> in from kernel-pppd which is long gone) so that ZFS and DTRACE play nice. P> P> This is a horrible hack to get freefall to compile, and is in dire need P> of reconciliation. This antique zlib-1.04 code needs to go away. ... along with kernel-pppd. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 18:18:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6337DCB7; Sun, 6 Jan 2013 18:18:10 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55C2B11B4; Sun, 6 Jan 2013 18:18:10 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r06IIAsm027619; Sun, 6 Jan 2013 18:18:10 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r06II9OI027615; Sun, 6 Jan 2013 18:18:09 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201301061818.r06II9OI027615@svn.freebsd.org> From: Devin Teske Date: Sun, 6 Jan 2013 18:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245106 - head/usr.sbin/bsdconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 18:18:10 -0000 Author: dteske Date: Sun Jan 6 18:18:09 2013 New Revision: 245106 URL: http://svnweb.freebsd.org/changeset/base/245106 Log: Update copyrights and dates following last commit. Modified: head/usr.sbin/bsdconfig/USAGE head/usr.sbin/bsdconfig/bsdconfig head/usr.sbin/bsdconfig/bsdconfig.8 Modified: head/usr.sbin/bsdconfig/USAGE ============================================================================== --- head/usr.sbin/bsdconfig/USAGE Sun Jan 6 17:50:57 2013 (r245105) +++ head/usr.sbin/bsdconfig/USAGE Sun Jan 6 18:18:09 2013 (r245106) @@ -1,5 +1,5 @@ # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/bsdconfig/bsdconfig ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig Sun Jan 6 17:50:57 2013 (r245105) +++ head/usr.sbin/bsdconfig/bsdconfig Sun Jan 6 18:18:09 2013 (r245106) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2012 Ron McDowell -# Copyright (c) 2012 Devin Teske +# Copyright (c) 2012-2013 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- head/usr.sbin/bsdconfig/bsdconfig.8 Sun Jan 6 17:50:57 2013 (r245105) +++ head/usr.sbin/bsdconfig/bsdconfig.8 Sun Jan 6 18:18:09 2013 (r245106) @@ -1,5 +1,5 @@ .\" Copyright (c) 2012 Ron McDowell -.\" Copyright (c) 2012 Devin Teske +.\" Copyright (c) 2012-2013 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -59,7 +59,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Mar 20, 2012 +.Dd Jan 5, 2013 .Dt BSDCONFIG 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 19:25:43 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4E6AB997; Sun, 6 Jan 2013 19:25:43 +0000 (UTC) (envelope-from peter@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3BE3414F2; Sun, 6 Jan 2013 19:25:43 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r06JPh1w017112; Sun, 6 Jan 2013 19:25:43 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r06JPhme017111; Sun, 6 Jan 2013 19:25:43 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201301061925.r06JPhme017111@svn.freebsd.org> From: Peter Wemm Date: Sun, 6 Jan 2013 19:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245107 - head/etc/sendmail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 19:25:43 -0000 Author: peter Date: Sun Jan 6 19:25:42 2013 New Revision: 245107 URL: http://svnweb.freebsd.org/changeset/base/245107 Log: Not using the full domain was a really bad idea. Modified: head/etc/sendmail/freefall.mc Modified: head/etc/sendmail/freefall.mc ============================================================================== --- head/etc/sendmail/freefall.mc Sun Jan 6 18:18:09 2013 (r245106) +++ head/etc/sendmail/freefall.mc Sun Jan 6 19:25:42 2013 (r245107) @@ -43,5 +43,5 @@ divert(0)dnl VERSIONID(`$FreeBSD$') OSTYPE(freebsd6) -FEATURE(nullclient, smarthost.ysv.$m) +FEATURE(nullclient, smarthost.ysv.freebsd.org) MASQUERADE_AS(FreeBSD.org) From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 20:50:32 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1A67F7B0; Sun, 6 Jan 2013 20:50:32 +0000 (UTC) (envelope-from monthadar@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CEB8C17D1; Sun, 6 Jan 2013 20:50:31 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r06KoVo9043025; Sun, 6 Jan 2013 20:50:31 GMT (envelope-from monthadar@svn.freebsd.org) Received: (from monthadar@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r06KoVQV043024; Sun, 6 Jan 2013 20:50:31 GMT (envelope-from monthadar@svn.freebsd.org) Message-Id: <201301062050.r06KoVQV043024@svn.freebsd.org> From: Monthadar Al Jaberi Date: Sun, 6 Jan 2013 20:50:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245112 - head/sys/mips/atheros X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 20:50:32 -0000 Author: monthadar Date: Sun Jan 6 20:50:31 2013 New Revision: 245112 URL: http://svnweb.freebsd.org/changeset/base/245112 Log: Mips Atheros AR71XX: make PCI base slot configurable through hints. * Mikrotik RouterBoard 433AH have PCI slot 18 wired to INT0 on the PCI Bus. This is different from e.g. Atheros PB42 and Ubiquiti boards. * Check for hint hint.pcib.0.baseslot=X, where X is number of base slot; * If hint not supplied print a warning and use default AR71XX_PCI_BASE_SLOT; PR: kern/174978 Approved by: adrian (mentor) Modified: head/sys/mips/atheros/ar71xx_pci.c Modified: head/sys/mips/atheros/ar71xx_pci.c ============================================================================== --- head/sys/mips/atheros/ar71xx_pci.c Sun Jan 6 19:27:28 2013 (r245111) +++ head/sys/mips/atheros/ar71xx_pci.c Sun Jan 6 20:50:31 2013 (r245112) @@ -81,6 +81,7 @@ struct ar71xx_pci_softc { device_t sc_dev; int sc_busno; + int sc_baseslot; struct rman sc_mem_rman; struct rman sc_irq_rman; @@ -395,6 +396,16 @@ ar71xx_pci_attach(device_t dev) AR71XX_PCI_IRQ_END) != 0) panic("ar71xx_pci_attach: failed to set up IRQ rman"); + /* + * Check if there is a base slot hint. Otherwise use default value. + */ + if (resource_int_value(device_get_name(dev), + device_get_unit(dev), "baseslot", &sc->sc_baseslot) != 0) { + device_printf(dev, + "%s: missing hint '%s', default to AR71XX_PCI_BASE_SLOT\n", + __func__, "baseslot"); + sc->sc_baseslot = AR71XX_PCI_BASE_SLOT; + } ATH_WRITE_REG(AR71XX_PCI_INTR_STATUS, 0); ATH_WRITE_REG(AR71XX_PCI_INTR_MASK, 0); @@ -648,11 +659,13 @@ ar71xx_pci_maxslots(device_t dev) static int ar71xx_pci_route_interrupt(device_t pcib, device_t device, int pin) { - if (pci_get_slot(device) < AR71XX_PCI_BASE_SLOT) + struct ar71xx_pci_softc *sc = device_get_softc(pcib); + + if (pci_get_slot(device) < sc->sc_baseslot) panic("%s: PCI slot %d is less then AR71XX_PCI_BASE_SLOT", __func__, pci_get_slot(device)); - return (pci_get_slot(device) - AR71XX_PCI_BASE_SLOT); + return (pci_get_slot(device) - sc->sc_baseslot); } static device_method_t ar71xx_pci_methods[] = { From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 21:48:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7EC66669; Sun, 6 Jan 2013 21:48:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 55D8B196B; Sun, 6 Jan 2013 21:48:00 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r06Lm0xv065287; Sun, 6 Jan 2013 21:48:00 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r06Lm0EI065286; Sun, 6 Jan 2013 21:48:00 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301062148.r06Lm0EI065286@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jan 2013 21:48:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245113 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 21:48:00 -0000 Author: mjg Date: Sun Jan 6 21:47:59 2013 New Revision: 245113 URL: http://svnweb.freebsd.org/changeset/base/245113 Log: lockmgr: unlock interlock (if requested) when dealing with upgrade/downgrade requests for LK_NOSHARE locks, just like for shared locks. PR: kern/174969 Reviewed by: attilio MFC after: 1 week Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Sun Jan 6 20:50:31 2013 (r245112) +++ head/sys/kern/kern_lock.c Sun Jan 6 21:47:59 2013 (r245113) @@ -498,6 +498,8 @@ __lockmgr_args(struct lock *lk, u_int fl case LK_DOWNGRADE: _lockmgr_assert(lk, KA_XLOCKED | KA_NOTRECURSED, file, line); + if (flags & LK_INTERLOCK) + class->lc_unlock(ilk); return (0); } } From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 21:56:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A328DAA1; Sun, 6 Jan 2013 21:56:59 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6CE0C19D2; Sun, 6 Jan 2013 21:56:59 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r06Lux8t068086; Sun, 6 Jan 2013 21:56:59 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r06LuxVD068085; Sun, 6 Jan 2013 21:56:59 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301062156.r06LuxVD068085@svn.freebsd.org> From: Mateusz Guzik Date: Sun, 6 Jan 2013 21:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245114 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 21:56:59 -0000 Author: mjg Date: Sun Jan 6 21:56:58 2013 New Revision: 245114 URL: http://svnweb.freebsd.org/changeset/base/245114 Log: pw: free group returned by gr_add Modified: head/usr.sbin/pw/pw_user.c Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Sun Jan 6 21:47:59 2013 (r245113) +++ head/usr.sbin/pw/pw_user.c Sun Jan 6 21:56:58 2013 (r245114) @@ -758,6 +758,7 @@ pw_user(struct userconf * cnf, int mode, if (grp == NULL) continue; chggrent(cnf->groups[i], grp); + free(grp); } } From owner-svn-src-head@FreeBSD.ORG Sun Jan 6 22:15:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 64CA4E7C; Sun, 6 Jan 2013 22:15:45 +0000 (UTC) (envelope-from gleb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3B5231AA8; Sun, 6 Jan 2013 22:15:45 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r06MFjmu074190; Sun, 6 Jan 2013 22:15:45 GMT (envelope-from gleb@svn.freebsd.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r06MFjHM074186; Sun, 6 Jan 2013 22:15:45 GMT (envelope-from gleb@svn.freebsd.org) Message-Id: <201301062215.r06MFjHM074186@svn.freebsd.org> From: Gleb Kurtsou Date: Sun, 6 Jan 2013 22:15:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245115 - head/sys/fs/tmpfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jan 2013 22:15:45 -0000 Author: gleb Date: Sun Jan 6 22:15:44 2013 New Revision: 245115 URL: http://svnweb.freebsd.org/changeset/base/245115 Log: tmpfs: Replace directory entry linked list with RB-Tree. Use file name hash as a tree key, handle duplicate keys. Both VOP_LOOKUP and VOP_READDIR operations utilize same tree for search. Directory entry offset (cookie) is either file name hash or incremental id in case of hash collisions (duplicate-cookies). Keep sorted per directory list of duplicate-cookie entries to facilitate cookie number allocation. Don't fail if previous VOP_READDIR() offset is no longer valid, start with next dirent instead. Other file system handle it similarly. Workaround race prone tn_readdir_last[pn] fields update. Add tmpfs_dir_destroy() to free all dirents. Set NFS cookies in tmpfs_dir_getdents(). Return EJUSTRETURN from tmpfs_dir_getdents() instead of hard coded -1. Mark directory traversal routines static as they are no longer used outside of tmpfs_subr.c Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vfsops.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Sun Jan 6 21:56:58 2013 (r245114) +++ head/sys/fs/tmpfs/tmpfs.h Sun Jan 6 22:15:44 2013 (r245115) @@ -49,6 +49,7 @@ /* --------------------------------------------------------------------- */ #include #include +#include #include #include @@ -60,104 +61,81 @@ MALLOC_DECLARE(M_TMPFSNAME); /* * Internal representation of a tmpfs directory entry. */ + +LIST_HEAD(tmpfs_dir_duphead, tmpfs_dirent); + struct tmpfs_dirent { - TAILQ_ENTRY(tmpfs_dirent) td_entries; + /* + * Depending on td_cookie flag entry can be of 3 types: + * - regular -- no hash collisions, stored in RB-Tree + * - duphead -- synthetic linked list head for dup entries + * - dup -- stored in linked list instead of RB-Tree + */ + union { + /* regular and duphead entry types */ + RB_ENTRY(tmpfs_dirent) td_entries; - /* Length of the name stored in this directory entry. This avoids - * the need to recalculate it every time the name is used. */ - uint16_t td_namelen; - - /* The name of the entry, allocated from a string pool. This - * string is not required to be zero-terminated; therefore, the - * td_namelen field must always be used when accessing its value. */ - char * td_name; + /* dup entry type */ + struct { + LIST_ENTRY(tmpfs_dirent) entries; + LIST_ENTRY(tmpfs_dirent) index_entries; + } td_dup; + } uh; + + uint32_t td_cookie; + uint32_t td_hash; + u_int td_namelen; /* Pointer to the node this entry refers to. In case this field * is NULL, the node is a whiteout. */ struct tmpfs_node * td_node; + + union { + /* + * The name of the entry, allocated from a string pool. This + * string is not required to be zero-terminated. + */ + char * td_name; /* regular, dup */ + struct tmpfs_dir_duphead td_duphead; /* duphead */ + } ud; }; -/* A directory in tmpfs holds a sorted list of directory entries, which in +/* A directory in tmpfs holds a list of directory entries, which in * turn point to other files (which can be directories themselves). * - * In tmpfs, this list is managed by a tail queue, whose head is defined by + * In tmpfs, this list is managed by a RB-Tree, whose head is defined by * the struct tmpfs_dir type. * - * It is imporant to notice that directories do not have entries for . and + * It is important to notice that directories do not have entries for . and * .. as other file systems do. These can be generated when requested * based on information available by other means, such as the pointer to * the node itself in the former case or the pointer to the parent directory * in the latter case. This is done to simplify tmpfs's code and, more * importantly, to remove redundancy. */ -TAILQ_HEAD(tmpfs_dir, tmpfs_dirent); +RB_HEAD(tmpfs_dir, tmpfs_dirent); /* Each entry in a directory has a cookie that identifies it. Cookies * supersede offsets within directories because, given how tmpfs stores - * directories in memory, there is no such thing as an offset. (Emulating - * a real offset could be very difficult.) - * + * directories in memory, there is no such thing as an offset. + * * The '.', '..' and the end of directory markers have fixed cookies which * cannot collide with the cookies generated by other entries. The cookies - * fot the other entries are generated based on the memory address on which - * stores their information is stored. - * - * Ideally, using the entry's memory pointer as the cookie would be enough - * to represent it and it wouldn't cause collisions in any system. - * Unfortunately, this results in "offsets" with very large values which - * later raise problems in the Linux compatibility layer (and maybe in other - * places) as described in PR kern/32034. Hence we need to workaround this - * with a rather ugly hack. - * - * Linux 32-bit binaries, unless built with _FILE_OFFSET_BITS=64, have off_t - * set to 'long', which is a 32-bit *signed* long integer. Regardless of - * the macro value, GLIBC (2.3 at least) always uses the getdents64 - * system call (when calling readdir) which internally returns off64_t - * offsets. In order to make 32-bit binaries work, *GLIBC* converts the - * 64-bit values returned by the kernel to 32-bit ones and aborts with - * EOVERFLOW if the conversion results in values that won't fit in 32-bit - * integers (which it assumes is because the directory is extremely large). - * This wouldn't cause problems if we were dealing with unsigned integers, - * but as we have signed integers, this check fails due to sign expansion. + * for the other entries are generated based on the file name hash value or + * unique number in case of name hash collision. * - * For example, consider that the kernel returns the 0xc1234567 cookie to - * userspace in a off64_t integer. Later on, GLIBC casts this value to - * off_t (remember, signed) with code similar to: - * system call returns the offset in kernel_value; - * off_t casted_value = kernel_value; - * if (sizeof(off_t) != sizeof(off64_t) && - * kernel_value != casted_value) - * error! - * In this case, casted_value still has 0xc1234567, but when it is compared - * for equality against kernel_value, it is promoted to a 64-bit integer and - * becomes 0xffffffffc1234567, which is different than 0x00000000c1234567. - * Then, GLIBC assumes this is because the directory is very large. - * - * Given that all the above happens in user-space, we have no control over - * it; therefore we must workaround the issue here. We do this by - * truncating the pointer value to a 32-bit integer and hope that there - * won't be collisions. In fact, this will not cause any problems in - * 32-bit platforms but some might arise in 64-bit machines (I'm not sure - * if they can happen at all in practice). - * - * XXX A nicer solution shall be attempted. */ -#ifdef _KERNEL -#define TMPFS_DIRCOOKIE_DOT 0 -#define TMPFS_DIRCOOKIE_DOTDOT 1 -#define TMPFS_DIRCOOKIE_EOF 2 -static __inline -off_t -tmpfs_dircookie(struct tmpfs_dirent *de) -{ - off_t cookie; - - cookie = ((off_t)(uintptr_t)de >> 1) & 0x7FFFFFFF; - MPASS(cookie != TMPFS_DIRCOOKIE_DOT); - MPASS(cookie != TMPFS_DIRCOOKIE_DOTDOT); - MPASS(cookie != TMPFS_DIRCOOKIE_EOF); + * To preserve compatibility cookies are limited to 31 bits. + */ - return cookie; -} -#endif +#define TMPFS_DIRCOOKIE_DOT 0 +#define TMPFS_DIRCOOKIE_DOTDOT 1 +#define TMPFS_DIRCOOKIE_EOF 2 +#define TMPFS_DIRCOOKIE_MASK ((off_t)0x3fffffffU) +#define TMPFS_DIRCOOKIE_MIN ((off_t)0x00000004U) +#define TMPFS_DIRCOOKIE_DUP ((off_t)0x40000000U) +#define TMPFS_DIRCOOKIE_DUPHEAD ((off_t)0x80000000U) +#define TMPFS_DIRCOOKIE_DUP_MIN TMPFS_DIRCOOKIE_DUP +#define TMPFS_DIRCOOKIE_DUP_MAX \ + (TMPFS_DIRCOOKIE_DUP | TMPFS_DIRCOOKIE_MASK) /* --------------------------------------------------------------------- */ @@ -243,29 +221,31 @@ struct tmpfs_node { dev_t tn_rdev; /* Valid when tn_type == VDIR. */ - struct tn_dir{ + struct tn_dir { /* Pointer to the parent directory. The root * directory has a pointer to itself in this field; * this property identifies the root node. */ struct tmpfs_node * tn_parent; - /* Head of a tail-queue that links the contents of - * the directory together. See above for a - * description of its contents. */ + /* Head of a tree that links the contents of + * the directory together. */ struct tmpfs_dir tn_dirhead; + /* Head of a list the contains fake directory entries + * heads, i.e. entries with TMPFS_DIRCOOKIE_DUPHEAD + * flag. */ + struct tmpfs_dir_duphead tn_dupindex; + /* Number and pointer of the first directory entry * returned by the readdir operation if it were * called again to continue reading data from the * same directory as before. This is used to speed * up reads of long directories, assuming that no * more than one read is in progress at a given time. - * Otherwise, these values are discarded and a linear - * scan is performed from the beginning up to the - * point where readdir starts returning values. */ + * Otherwise, these values are discarded. */ off_t tn_readdir_lastn; struct tmpfs_dirent * tn_readdir_lastp; - }tn_dir; + } tn_dir; /* Valid when tn_type == VLNK. */ /* The link's target, allocated from a string pool. */ @@ -419,9 +399,9 @@ int tmpfs_alloc_node(struct tmpfs_mount char *, dev_t, struct tmpfs_node **); void tmpfs_free_node(struct tmpfs_mount *, struct tmpfs_node *); int tmpfs_alloc_dirent(struct tmpfs_mount *, struct tmpfs_node *, - const char *, uint16_t, struct tmpfs_dirent **); -void tmpfs_free_dirent(struct tmpfs_mount *, struct tmpfs_dirent *, - boolean_t); + const char *, u_int, struct tmpfs_dirent **); +void tmpfs_free_dirent(struct tmpfs_mount *, struct tmpfs_dirent *); +void tmpfs_dirent_init(struct tmpfs_dirent *, const char *, u_int); int tmpfs_alloc_vp(struct mount *, struct tmpfs_node *, int, struct vnode **); void tmpfs_free_vp(struct vnode *); @@ -429,13 +409,12 @@ int tmpfs_alloc_file(struct vnode *, str struct componentname *, char *); void tmpfs_dir_attach(struct vnode *, struct tmpfs_dirent *); void tmpfs_dir_detach(struct vnode *, struct tmpfs_dirent *); +void tmpfs_dir_destroy(struct tmpfs_mount *, struct tmpfs_node *); struct tmpfs_dirent * tmpfs_dir_lookup(struct tmpfs_node *node, struct tmpfs_node *f, struct componentname *cnp); -int tmpfs_dir_getdotdent(struct tmpfs_node *, struct uio *); -int tmpfs_dir_getdotdotdent(struct tmpfs_node *, struct uio *); -struct tmpfs_dirent * tmpfs_dir_lookupbycookie(struct tmpfs_node *, off_t); -int tmpfs_dir_getdents(struct tmpfs_node *, struct uio *, off_t *); +int tmpfs_dir_getdents(struct tmpfs_node *, struct uio *, int, + u_long *, int *); int tmpfs_dir_whiteout_add(struct vnode *, struct componentname *); void tmpfs_dir_whiteout_remove(struct vnode *, struct componentname *); int tmpfs_reg_resize(struct vnode *, off_t, boolean_t); @@ -467,8 +446,8 @@ int tmpfs_truncate(struct vnode *, off_t * with a length of 'len'. */ #define TMPFS_DIRENT_MATCHES(de, name, len) \ - (de->td_namelen == (uint16_t)len && \ - bcmp((de)->td_name, (name), (de)->td_namelen) == 0) + (de->td_namelen == len && \ + bcmp((de)->ud.td_name, (name), (de)->td_namelen) == 0) /* --------------------------------------------------------------------- */ @@ -476,11 +455,10 @@ int tmpfs_truncate(struct vnode *, off_t * Ensures that the node pointed by 'node' is a directory and that its * contents are consistent with respect to directories. */ -#define TMPFS_VALIDATE_DIR(node) \ - MPASS((node)->tn_type == VDIR); \ - MPASS((node)->tn_size % sizeof(struct tmpfs_dirent) == 0); \ - MPASS((node)->tn_dir.tn_readdir_lastp == NULL || \ - tmpfs_dircookie((node)->tn_dir.tn_readdir_lastp) == (node)->tn_dir.tn_readdir_lastn); +#define TMPFS_VALIDATE_DIR(node) do { \ + MPASS((node)->tn_type == VDIR); \ + MPASS((node)->tn_size % sizeof(struct tmpfs_dirent) == 0); \ +} while (0) /* --------------------------------------------------------------------- */ Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Sun Jan 6 21:56:58 2013 (r245114) +++ head/sys/fs/tmpfs/tmpfs_subr.c Sun Jan 6 22:15:44 2013 (r245115) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -58,6 +59,11 @@ __FBSDID("$FreeBSD$"); #include #include +struct tmpfs_dir_cursor { + struct tmpfs_dirent *tdc_current; + struct tmpfs_dirent *tdc_tree; +}; + SYSCTL_NODE(_vfs, OID_AUTO, tmpfs, CTLFLAG_RW, 0, "tmpfs file system"); static long tmpfs_pages_reserved = TMPFS_PAGES_MINRESERVED; @@ -87,6 +93,10 @@ SYSCTL_PROC(_vfs_tmpfs, OID_AUTO, memory &tmpfs_pages_reserved, 0, sysctl_mem_reserved, "L", "Amount of available memory and swap below which tmpfs growth stops"); +static __inline int tmpfs_dirtree_cmp(struct tmpfs_dirent *a, + struct tmpfs_dirent *b); +RB_PROTOTYPE_STATIC(tmpfs_dir, tmpfs_dirent, uh.td_entries, tmpfs_dirtree_cmp); + size_t tmpfs_mem_avail(void) { @@ -188,7 +198,8 @@ tmpfs_alloc_node(struct tmpfs_mount *tmp break; case VDIR: - TAILQ_INIT(&nnode->tn_dir.tn_dirhead); + RB_INIT(&nnode->tn_dir.tn_dirhead); + LIST_INIT(&nnode->tn_dir.tn_dupindex); MPASS(parent != nnode); MPASS(IMPLIES(parent == NULL, tmp->tm_root == NULL)); nnode->tn_dir.tn_parent = (parent == NULL) ? nnode : parent; @@ -309,6 +320,49 @@ tmpfs_free_node(struct tmpfs_mount *tmp, /* --------------------------------------------------------------------- */ +static __inline uint32_t +tmpfs_dirent_hash(const char *name, u_int len) +{ + uint32_t hash; + + hash = fnv_32_buf(name, len, FNV1_32_INIT + len) & TMPFS_DIRCOOKIE_MASK; +#ifdef TMPFS_DEBUG_DIRCOOKIE_DUP + hash &= 0xf; +#endif + if (hash < TMPFS_DIRCOOKIE_MIN) + hash += TMPFS_DIRCOOKIE_MIN; + + return (hash); +} + +static __inline off_t +tmpfs_dirent_cookie(struct tmpfs_dirent *de) +{ + MPASS(de->td_cookie >= TMPFS_DIRCOOKIE_MIN); + + return (de->td_cookie); +} + +static __inline boolean_t +tmpfs_dirent_dup(struct tmpfs_dirent *de) +{ + return ((de->td_cookie & TMPFS_DIRCOOKIE_DUP) != 0); +} + +static __inline boolean_t +tmpfs_dirent_duphead(struct tmpfs_dirent *de) +{ + return ((de->td_cookie & TMPFS_DIRCOOKIE_DUPHEAD) != 0); +} + +void +tmpfs_dirent_init(struct tmpfs_dirent *de, const char *name, u_int namelen) +{ + de->td_hash = de->td_cookie = tmpfs_dirent_hash(name, namelen); + memcpy(de->ud.td_name, name, namelen); + de->td_namelen = namelen; +} + /* * Allocates a new directory entry for the node node with a name of name. * The new directory entry is returned in *de. @@ -320,17 +374,17 @@ tmpfs_free_node(struct tmpfs_mount *tmp, */ int tmpfs_alloc_dirent(struct tmpfs_mount *tmp, struct tmpfs_node *node, - const char *name, uint16_t len, struct tmpfs_dirent **de) + const char *name, u_int len, struct tmpfs_dirent **de) { struct tmpfs_dirent *nde; - nde = (struct tmpfs_dirent *)uma_zalloc( - tmp->tm_dirent_pool, M_WAITOK); - nde->td_name = malloc(len, M_TMPFSNAME, M_WAITOK); - nde->td_namelen = len; - memcpy(nde->td_name, name, len); - + nde = uma_zalloc(tmp->tm_dirent_pool, M_WAITOK); nde->td_node = node; + if (name != NULL) { + nde->ud.td_name = malloc(len, M_TMPFSNAME, M_WAITOK); + tmpfs_dirent_init(nde, name, len); + } else + nde->td_namelen = 0; if (node != NULL) node->tn_links++; @@ -351,20 +405,17 @@ tmpfs_alloc_dirent(struct tmpfs_mount *t * directory entry, as it may already have been released from the outside. */ void -tmpfs_free_dirent(struct tmpfs_mount *tmp, struct tmpfs_dirent *de, - boolean_t node_exists) +tmpfs_free_dirent(struct tmpfs_mount *tmp, struct tmpfs_dirent *de) { - if (node_exists) { - struct tmpfs_node *node; + struct tmpfs_node *node; - node = de->td_node; - if (node != NULL) { - MPASS(node->tn_links > 0); - node->tn_links--; - } + node = de->td_node; + if (node != NULL) { + MPASS(node->tn_links > 0); + node->tn_links--; } - - free(de->td_name, M_TMPFSNAME); + if (!tmpfs_dirent_duphead(de) && de->ud.td_name != NULL) + free(de->ud.td_name, M_TMPFSNAME); uma_zfree(tmp->tm_dirent_pool, de); } @@ -586,7 +637,7 @@ tmpfs_alloc_file(struct vnode *dvp, stru /* Allocate a vnode for the new file. */ error = tmpfs_alloc_vp(dvp->v_mount, node, LK_EXCLUSIVE, vpp); if (error != 0) { - tmpfs_free_dirent(tmp, de, TRUE); + tmpfs_free_dirent(tmp, de); tmpfs_free_node(tmp, node); goto out; } @@ -605,6 +656,215 @@ out: /* --------------------------------------------------------------------- */ +static struct tmpfs_dirent * +tmpfs_dir_first(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc) +{ + struct tmpfs_dirent *de; + + de = RB_MIN(tmpfs_dir, &dnode->tn_dir.tn_dirhead); + dc->tdc_tree = de; + if (de != NULL && tmpfs_dirent_duphead(de)) + de = LIST_FIRST(&de->ud.td_duphead); + dc->tdc_current = de; + + return (dc->tdc_current); +} + +static struct tmpfs_dirent * +tmpfs_dir_next(struct tmpfs_node *dnode, struct tmpfs_dir_cursor *dc) +{ + struct tmpfs_dirent *de; + + MPASS(dc->tdc_tree != NULL); + if (tmpfs_dirent_dup(dc->tdc_current)) { + dc->tdc_current = LIST_NEXT(dc->tdc_current, uh.td_dup.entries); + if (dc->tdc_current != NULL) + return (dc->tdc_current); + } + dc->tdc_tree = dc->tdc_current = RB_NEXT(tmpfs_dir, + &dnode->tn_dir.tn_dirhead, dc->tdc_tree); + if ((de = dc->tdc_current) != NULL && tmpfs_dirent_duphead(de)) { + dc->tdc_current = LIST_FIRST(&de->ud.td_duphead); + MPASS(dc->tdc_current != NULL); + } + + return (dc->tdc_current); +} + +/* Lookup directory entry in RB-Tree. Function may return duphead entry. */ +static struct tmpfs_dirent * +tmpfs_dir_xlookup_hash(struct tmpfs_node *dnode, uint32_t hash) +{ + struct tmpfs_dirent *de, dekey; + + dekey.td_hash = hash; + de = RB_FIND(tmpfs_dir, &dnode->tn_dir.tn_dirhead, &dekey); + return (de); +} + +/* Lookup directory entry by cookie, initialize directory cursor accordingly. */ +static struct tmpfs_dirent * +tmpfs_dir_lookup_cookie(struct tmpfs_node *node, off_t cookie, + struct tmpfs_dir_cursor *dc) +{ + struct tmpfs_dir *dirhead = &node->tn_dir.tn_dirhead; + struct tmpfs_dirent *de, dekey; + + MPASS(cookie >= TMPFS_DIRCOOKIE_MIN); + + if (cookie == node->tn_dir.tn_readdir_lastn && + (de = node->tn_dir.tn_readdir_lastp) != NULL) { + /* Protect against possible race, tn_readdir_last[pn] + * may be updated with only shared vnode lock held. */ + if (cookie == tmpfs_dirent_cookie(de)) + goto out; + } + + if ((cookie & TMPFS_DIRCOOKIE_DUP) != 0) { + LIST_FOREACH(de, &node->tn_dir.tn_dupindex, + uh.td_dup.index_entries) { + MPASS(tmpfs_dirent_dup(de)); + if (de->td_cookie == cookie) + goto out; + /* dupindex list is sorted. */ + if (de->td_cookie < cookie) { + de = NULL; + goto out; + } + } + MPASS(de == NULL); + goto out; + } + + MPASS((cookie & TMPFS_DIRCOOKIE_MASK) == cookie); + dekey.td_hash = cookie; + /* Recover if direntry for cookie was removed */ + de = RB_NFIND(tmpfs_dir, dirhead, &dekey); + dc->tdc_tree = de; + dc->tdc_current = de; + if (de != NULL && tmpfs_dirent_duphead(de)) { + dc->tdc_current = LIST_FIRST(&de->ud.td_duphead); + MPASS(dc->tdc_current != NULL); + } + return (dc->tdc_current); + +out: + dc->tdc_tree = de; + dc->tdc_current = de; + if (de != NULL && tmpfs_dirent_dup(de)) + dc->tdc_tree = tmpfs_dir_xlookup_hash(node, + de->td_hash); + return (dc->tdc_current); +} + +/* + * Looks for a directory entry in the directory represented by node. + * 'cnp' describes the name of the entry to look for. Note that the . + * and .. components are not allowed as they do not physically exist + * within directories. + * + * Returns a pointer to the entry when found, otherwise NULL. + */ +struct tmpfs_dirent * +tmpfs_dir_lookup(struct tmpfs_node *node, struct tmpfs_node *f, + struct componentname *cnp) +{ + struct tmpfs_dir_duphead *duphead; + struct tmpfs_dirent *de; + uint32_t hash; + + MPASS(IMPLIES(cnp->cn_namelen == 1, cnp->cn_nameptr[0] != '.')); + MPASS(IMPLIES(cnp->cn_namelen == 2, !(cnp->cn_nameptr[0] == '.' && + cnp->cn_nameptr[1] == '.'))); + TMPFS_VALIDATE_DIR(node); + + hash = tmpfs_dirent_hash(cnp->cn_nameptr, cnp->cn_namelen); + de = tmpfs_dir_xlookup_hash(node, hash); + if (de != NULL && tmpfs_dirent_duphead(de)) { + duphead = &de->ud.td_duphead; + LIST_FOREACH(de, duphead, uh.td_dup.entries) { + if (TMPFS_DIRENT_MATCHES(de, cnp->cn_nameptr, + cnp->cn_namelen)) + break; + } + } else if (de != NULL) { + if (!TMPFS_DIRENT_MATCHES(de, cnp->cn_nameptr, + cnp->cn_namelen)) + de = NULL; + } + if (de != NULL && f != NULL && de->td_node != f) + de = NULL; + + return (de); +} + +/* + * Attach duplicate-cookie directory entry nde to dnode and insert to dupindex + * list, allocate new cookie value. + */ +static void +tmpfs_dir_attach_dup(struct tmpfs_node *dnode, + struct tmpfs_dir_duphead *duphead, struct tmpfs_dirent *nde) +{ + struct tmpfs_dir_duphead *dupindex; + struct tmpfs_dirent *de, *pde; + + dupindex = &dnode->tn_dir.tn_dupindex; + de = LIST_FIRST(dupindex); + if (de == NULL || de->td_cookie < TMPFS_DIRCOOKIE_DUP_MAX) { + if (de == NULL) + nde->td_cookie = TMPFS_DIRCOOKIE_DUP_MIN; + else + nde->td_cookie = de->td_cookie + 1; + MPASS(tmpfs_dirent_dup(nde)); + LIST_INSERT_HEAD(dupindex, nde, uh.td_dup.index_entries); + LIST_INSERT_HEAD(duphead, nde, uh.td_dup.entries); + return; + } + + /* + * Cookie numbers are near exhaustion. Scan dupindex list for unused + * numbers. dupindex list is sorted in descending order. Keep it so + * after inserting nde. + */ + while (1) { + pde = de; + de = LIST_NEXT(de, uh.td_dup.index_entries); + if (de == NULL && pde->td_cookie != TMPFS_DIRCOOKIE_DUP_MIN) { + /* + * Last element of the index doesn't have minimal cookie + * value, use it. + */ + nde->td_cookie = TMPFS_DIRCOOKIE_DUP_MIN; + LIST_INSERT_AFTER(pde, nde, uh.td_dup.index_entries); + LIST_INSERT_HEAD(duphead, nde, uh.td_dup.entries); + return; + } else if (de == NULL) { + /* + * We are so lucky have 2^30 hash duplicates in single + * directory :) Return largest possible cookie value. + * It should be fine except possible issues with + * VOP_READDIR restart. + */ + nde->td_cookie = TMPFS_DIRCOOKIE_DUP_MAX; + LIST_INSERT_HEAD(dupindex, nde, + uh.td_dup.index_entries); + LIST_INSERT_HEAD(duphead, nde, uh.td_dup.entries); + return; + } + if (de->td_cookie + 1 == pde->td_cookie || + de->td_cookie >= TMPFS_DIRCOOKIE_DUP_MAX) + continue; /* No hole or invalid cookie. */ + nde->td_cookie = de->td_cookie + 1; + MPASS(tmpfs_dirent_dup(nde)); + MPASS(pde->td_cookie > nde->td_cookie); + MPASS(nde->td_cookie > de->td_cookie); + LIST_INSERT_BEFORE(de, nde, uh.td_dup.index_entries); + LIST_INSERT_HEAD(duphead, nde, uh.td_dup.entries); + return; + }; +} + /* * Attaches the directory entry de to the directory represented by vp. * Note that this does not change the link count of the node pointed by @@ -614,10 +874,38 @@ void tmpfs_dir_attach(struct vnode *vp, struct tmpfs_dirent *de) { struct tmpfs_node *dnode; + struct tmpfs_dirent *xde, *nde; ASSERT_VOP_ELOCKED(vp, __func__); + MPASS(de->td_namelen > 0); + MPASS(de->td_hash >= TMPFS_DIRCOOKIE_MIN); + MPASS(de->td_cookie == de->td_hash); + dnode = VP_TO_TMPFS_DIR(vp); - TAILQ_INSERT_TAIL(&dnode->tn_dir.tn_dirhead, de, td_entries); + dnode->tn_dir.tn_readdir_lastn = 0; + dnode->tn_dir.tn_readdir_lastp = NULL; + + MPASS(!tmpfs_dirent_dup(de)); + xde = RB_INSERT(tmpfs_dir, &dnode->tn_dir.tn_dirhead, de); + if (xde != NULL && tmpfs_dirent_duphead(xde)) + tmpfs_dir_attach_dup(dnode, &xde->ud.td_duphead, de); + else if (xde != NULL) { + /* + * Allocate new duphead. Swap xde with duphead to avoid + * adding/removing elements with the same hash. + */ + MPASS(!tmpfs_dirent_dup(xde)); + tmpfs_alloc_dirent(VFS_TO_TMPFS(vp->v_mount), NULL, NULL, 0, + &nde); + /* *nde = *xde; XXX gcc 4.2.1 may generate invalid code. */ + memcpy(nde, xde, sizeof(*xde)); + xde->td_cookie |= TMPFS_DIRCOOKIE_DUPHEAD; + LIST_INIT(&xde->ud.td_duphead); + xde->td_namelen = 0; + xde->td_node = NULL; + tmpfs_dir_attach_dup(dnode, &xde->ud.td_duphead, nde); + tmpfs_dir_attach_dup(dnode, &xde->ud.td_duphead, de); + } dnode->tn_size += sizeof(struct tmpfs_dirent); dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \ TMPFS_NODE_MODIFIED; @@ -633,58 +921,61 @@ tmpfs_dir_attach(struct vnode *vp, struc void tmpfs_dir_detach(struct vnode *vp, struct tmpfs_dirent *de) { + struct tmpfs_mount *tmp; + struct tmpfs_dir *head; struct tmpfs_node *dnode; + struct tmpfs_dirent *xde; ASSERT_VOP_ELOCKED(vp, __func__); - dnode = VP_TO_TMPFS_DIR(vp); - if (dnode->tn_dir.tn_readdir_lastp == de) { - dnode->tn_dir.tn_readdir_lastn = 0; - dnode->tn_dir.tn_readdir_lastp = NULL; - } + dnode = VP_TO_TMPFS_DIR(vp); + head = &dnode->tn_dir.tn_dirhead; + dnode->tn_dir.tn_readdir_lastn = 0; + dnode->tn_dir.tn_readdir_lastp = NULL; + + if (tmpfs_dirent_dup(de)) { + /* Remove duphead if de was last entry. */ + if (LIST_NEXT(de, uh.td_dup.entries) == NULL) { + xde = tmpfs_dir_xlookup_hash(dnode, de->td_hash); + MPASS(tmpfs_dirent_duphead(xde)); + } else + xde = NULL; + LIST_REMOVE(de, uh.td_dup.entries); + LIST_REMOVE(de, uh.td_dup.index_entries); + if (xde != NULL) { + if (LIST_EMPTY(&xde->ud.td_duphead)) { + RB_REMOVE(tmpfs_dir, head, xde); + tmp = VFS_TO_TMPFS(vp->v_mount); + MPASS(xde->td_node == NULL); + tmpfs_free_dirent(tmp, xde); + } + } + } else + RB_REMOVE(tmpfs_dir, head, de); - TAILQ_REMOVE(&dnode->tn_dir.tn_dirhead, de, td_entries); dnode->tn_size -= sizeof(struct tmpfs_dirent); dnode->tn_status |= TMPFS_NODE_ACCESSED | TMPFS_NODE_CHANGED | \ TMPFS_NODE_MODIFIED; } -/* --------------------------------------------------------------------- */ - -/* - * Looks for a directory entry in the directory represented by node. - * 'cnp' describes the name of the entry to look for. Note that the . - * and .. components are not allowed as they do not physically exist - * within directories. - * - * Returns a pointer to the entry when found, otherwise NULL. - */ -struct tmpfs_dirent * -tmpfs_dir_lookup(struct tmpfs_node *node, struct tmpfs_node *f, - struct componentname *cnp) +void +tmpfs_dir_destroy(struct tmpfs_mount *tmp, struct tmpfs_node *dnode) { - boolean_t found; - struct tmpfs_dirent *de; - - MPASS(IMPLIES(cnp->cn_namelen == 1, cnp->cn_nameptr[0] != '.')); - MPASS(IMPLIES(cnp->cn_namelen == 2, !(cnp->cn_nameptr[0] == '.' && - cnp->cn_nameptr[1] == '.'))); - TMPFS_VALIDATE_DIR(node); + struct tmpfs_dirent *de, *dde, *nde; - found = 0; - TAILQ_FOREACH(de, &node->tn_dir.tn_dirhead, td_entries) { - if (f != NULL && de->td_node != f) - continue; - MPASS(cnp->cn_namelen < 0xffff); - if (de->td_namelen == (uint16_t)cnp->cn_namelen && - bcmp(de->td_name, cnp->cn_nameptr, de->td_namelen) == 0) { - found = 1; - break; + RB_FOREACH_SAFE(de, tmpfs_dir, &dnode->tn_dir.tn_dirhead, nde) { + RB_REMOVE(tmpfs_dir, &dnode->tn_dir.tn_dirhead, de); + /* Node may already be destroyed. */ + de->td_node = NULL; + if (tmpfs_dirent_duphead(de)) { + while ((dde = LIST_FIRST(&de->ud.td_duphead)) != NULL) { + LIST_REMOVE(dde, uh.td_dup.entries); + dde->td_node = NULL; + tmpfs_free_dirent(tmp, dde); + } } + tmpfs_free_dirent(tmp, de); } - node->tn_status |= TMPFS_NODE_ACCESSED; - - return found ? de : NULL; } /* --------------------------------------------------------------------- */ @@ -696,7 +987,7 @@ tmpfs_dir_lookup(struct tmpfs_node *node * hold the directory entry or an appropriate error code if another * error happens. */ -int +static int tmpfs_dir_getdotdent(struct tmpfs_node *node, struct uio *uio) { int error; @@ -713,12 +1004,9 @@ tmpfs_dir_getdotdent(struct tmpfs_node * dent.d_reclen = GENERIC_DIRSIZ(&dent); if (dent.d_reclen > uio->uio_resid) - error = -1; - else { + error = EJUSTRETURN; + else error = uiomove(&dent, dent.d_reclen, uio); - if (error == 0) - uio->uio_offset = TMPFS_DIRCOOKIE_DOTDOT; - } node->tn_status |= TMPFS_NODE_ACCESSED; @@ -734,7 +1022,7 @@ tmpfs_dir_getdotdent(struct tmpfs_node * * hold the directory entry or an appropriate error code if another * error happens. */ -int +static int tmpfs_dir_getdotdotdent(struct tmpfs_node *node, struct uio *uio) { int error; @@ -763,19 +1051,9 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod dent.d_reclen = GENERIC_DIRSIZ(&dent); if (dent.d_reclen > uio->uio_resid) - error = -1; - else { + error = EJUSTRETURN; + else error = uiomove(&dent, dent.d_reclen, uio); - if (error == 0) { - struct tmpfs_dirent *de; - - de = TAILQ_FIRST(&node->tn_dir.tn_dirhead); - if (de == NULL) - uio->uio_offset = TMPFS_DIRCOOKIE_EOF; - else - uio->uio_offset = tmpfs_dircookie(de); - } - } node->tn_status |= TMPFS_NODE_ACCESSED; @@ -785,30 +1063,6 @@ tmpfs_dir_getdotdotdent(struct tmpfs_nod /* --------------------------------------------------------------------- */ /* - * Lookup a directory entry by its associated cookie. - */ -struct tmpfs_dirent * -tmpfs_dir_lookupbycookie(struct tmpfs_node *node, off_t cookie) -{ - struct tmpfs_dirent *de; - - if (cookie == node->tn_dir.tn_readdir_lastn && - node->tn_dir.tn_readdir_lastp != NULL) { - return node->tn_dir.tn_readdir_lastp; - } - - TAILQ_FOREACH(de, &node->tn_dir.tn_dirhead, td_entries) { - if (tmpfs_dircookie(de) == cookie) { - break; - } - } - - return de; -} - -/* --------------------------------------------------------------------- */ - -/* * Helper function for tmpfs_readdir. Returns as much directory entries * as can fit in the uio space. The read starts at uio->uio_offset. * The function returns 0 on success, -1 if there was not enough space @@ -816,27 +1070,47 @@ tmpfs_dir_lookupbycookie(struct tmpfs_no * error code if another error happens. */ int -tmpfs_dir_getdents(struct tmpfs_node *node, struct uio *uio, off_t *cntp) +tmpfs_dir_getdents(struct tmpfs_node *node, struct uio *uio, int cnt, + u_long *cookies, int *ncookies) { - int error; - off_t startcookie; + struct tmpfs_dir_cursor dc; struct tmpfs_dirent *de; + off_t off; + int error; TMPFS_VALIDATE_DIR(node); - /* Locate the first directory entry we have to return. We have cached - * the last readdir in the node, so use those values if appropriate. - * Otherwise do a linear scan to find the requested entry. */ - startcookie = uio->uio_offset; - MPASS(startcookie != TMPFS_DIRCOOKIE_DOT); - MPASS(startcookie != TMPFS_DIRCOOKIE_DOTDOT); - if (startcookie == TMPFS_DIRCOOKIE_EOF) { - return 0; - } else { - de = tmpfs_dir_lookupbycookie(node, startcookie); - } - if (de == NULL) { - return EINVAL; + off = 0; + switch (uio->uio_offset) { + case TMPFS_DIRCOOKIE_DOT: + error = tmpfs_dir_getdotdent(node, uio); + if (error != 0) + return (error); + uio->uio_offset = TMPFS_DIRCOOKIE_DOTDOT; + if (cnt != 0) + cookies[(*ncookies)++] = off = uio->uio_offset; + case TMPFS_DIRCOOKIE_DOTDOT: + error = tmpfs_dir_getdotdotdent(node, uio); + if (error != 0) + return (error); + de = tmpfs_dir_first(node, &dc); + if (de == NULL) + uio->uio_offset = TMPFS_DIRCOOKIE_EOF; + else + uio->uio_offset = tmpfs_dirent_cookie(de); + if (cnt != 0) + cookies[(*ncookies)++] = off = uio->uio_offset; + if (de == NULL) + return (0); + break; + case TMPFS_DIRCOOKIE_EOF: + return (0); + default: + de = tmpfs_dir_lookup_cookie(node, uio->uio_offset, &dc); + if (de == NULL) + return (EINVAL); + if (cnt != 0) + off = tmpfs_dirent_cookie(de); } /* Read as much entries as possible; i.e., until we reach the end of @@ -887,14 +1161,14 @@ tmpfs_dir_getdents(struct tmpfs_node *no } d.d_namlen = de->td_namelen; MPASS(de->td_namelen < sizeof(d.d_name)); - (void)memcpy(d.d_name, de->td_name, de->td_namelen); + (void)memcpy(d.d_name, de->ud.td_name, de->td_namelen); d.d_name[de->td_namelen] = '\0'; d.d_reclen = GENERIC_DIRSIZ(&d); /* Stop reading if the directory entry we are treating is * bigger than the amount of data that can be returned. */ if (d.d_reclen > uio->uio_resid) { - error = -1; + error = EJUSTRETURN; break; } @@ -902,21 +1176,30 @@ tmpfs_dir_getdents(struct tmpfs_node *no * advance pointers. */ error = uiomove(&d, d.d_reclen, uio); if (error == 0) { - (*cntp)++; - de = TAILQ_NEXT(de, td_entries); + de = tmpfs_dir_next(node, &dc); + if (cnt != 0) { + if (de == NULL) + off = TMPFS_DIRCOOKIE_EOF; + else + off = tmpfs_dirent_cookie(de); + MPASS(*ncookies < cnt); + cookies[(*ncookies)++] = off; + } } } while (error == 0 && uio->uio_resid > 0 && de != NULL); /* Update the offset and cache. */ - if (de == NULL) { - uio->uio_offset = TMPFS_DIRCOOKIE_EOF; - node->tn_dir.tn_readdir_lastn = 0; - node->tn_dir.tn_readdir_lastp = NULL; - } else { - node->tn_dir.tn_readdir_lastn = uio->uio_offset = tmpfs_dircookie(de); - node->tn_dir.tn_readdir_lastp = de; + if (cnt == 0) { + if (de == NULL) + off = TMPFS_DIRCOOKIE_EOF; + else + off = tmpfs_dirent_cookie(de); } + uio->uio_offset = off; + node->tn_dir.tn_readdir_lastn = off; + node->tn_dir.tn_readdir_lastp = de; + node->tn_status |= TMPFS_NODE_ACCESSED; return error; } @@ -943,7 +1226,7 @@ tmpfs_dir_whiteout_remove(struct vnode * de = tmpfs_dir_lookup(VP_TO_TMPFS_DIR(dvp), NULL, cnp); MPASS(de != NULL && de->td_node == NULL); tmpfs_dir_detach(dvp, de); - tmpfs_free_dirent(VFS_TO_TMPFS(dvp->v_mount), de, TRUE); + tmpfs_free_dirent(VFS_TO_TMPFS(dvp->v_mount), de); } /* --------------------------------------------------------------------- */ @@ -1436,3 +1719,15 @@ out: return error; } + +static __inline int +tmpfs_dirtree_cmp(struct tmpfs_dirent *a, struct tmpfs_dirent *b) +{ + if (a->td_hash > b->td_hash) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 00:15:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D94FCE5C for ; Mon, 7 Jan 2013 00:15:52 +0000 (UTC) (envelope-from dteske@svn.freebsd.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C71FB1D9C for ; Mon, 7 Jan 2013 00:15:52 +0000 (UTC) Received: from dteske (uid 1288) (envelope-from dteske@svn.freebsd.org) id 1d1b by svn.freebsd.org (DragonFly Mail Agent v0.7); Mon, 07 Jan 2013 00:15:52 +0000 From: Devin Teske Date: Mon, 7 Jan 2013 00:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245116 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <50ea13b8.1d1b.4bd5285d@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 00:15:52 -0000 Author: dteske Date: Mon Jan 7 00:15:52 2013 New Revision: 245116 URL: http://svnweb.freebsd.org/changeset/base/245116 Log: Add nonInteractive support to f_dialog_yesno/noyes(). Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Sun Jan 6 22:15:44 2013 (r245115) +++ head/usr.sbin/bsdconfig/share/dialog.subr Mon Jan 7 00:15:52 2013 (r245116) @@ -32,6 +32,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 f_dprintf "%s: loading includes..." dialog.subr f_include $BSDCFG_SHARE/strings.subr +f_include $BSDCFG_SHARE/variable.subr BSDCFG_LIBE="/usr/libexec/bsdconfig" f_include_lang $BSDCFG_LIBE/include/messages.subr @@ -1058,6 +1059,9 @@ f_dialog_yesno() { local msg_text="$*" local hline="$hline_arrows_tab_enter" + + f_interactive || return 0 # If non-interactive, return YES all the time + local size="$( f_dialog_buttonbox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ @@ -1098,6 +1102,9 @@ f_dialog_noyes() { local msg_text="$*" local hline="$hline_arrows_tab_enter" + + f_interactive || return 1 # If non-interactive, return NO all the time + local size="$( f_dialog_buttonbox_size \ "$DIALOG_TITLE" \ "$DIALOG_BACKTITLE" \ From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 00:18:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C687CFFF for ; Mon, 7 Jan 2013 00:18:03 +0000 (UTC) (envelope-from dteske@svn.freebsd.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A161E1DA9 for ; Mon, 7 Jan 2013 00:18:03 +0000 (UTC) Received: from dteske (uid 1288) (envelope-from dteske@svn.freebsd.org) id 1d36 by svn.freebsd.org (DragonFly Mail Agent v0.7); Mon, 07 Jan 2013 00:18:03 +0000 From: Devin Teske Date: Mon, 7 Jan 2013 00:18:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245117 - head/usr.sbin/bsdconfig/share X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <50ea143b.1d36.29279999@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 00:18:03 -0000 Author: dteske Date: Mon Jan 7 00:18:03 2013 New Revision: 245117 URL: http://svnweb.freebsd.org/changeset/base/245117 Log: Update copyright following last commit. Modified: head/usr.sbin/bsdconfig/share/dialog.subr Modified: head/usr.sbin/bsdconfig/share/dialog.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/dialog.subr Mon Jan 7 00:15:52 2013 (r245116) +++ head/usr.sbin/bsdconfig/share/dialog.subr Mon Jan 7 00:18:03 2013 (r245117) @@ -1,6 +1,6 @@ if [ ! "$_DIALOG_SUBR" ]; then _DIALOG_SUBR=1 # -# Copyright (c) 2006-2012 Devin Teske +# Copyright (c) 2006-2013 Devin Teske # All Rights Reserved. # # Redistribution and use in source and binary forms, with or without From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 02:38:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 042257C3 for ; Mon, 7 Jan 2013 02:38:37 +0000 (UTC) (envelope-from gonzo@svn.freebsd.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CCFAE2BB for ; Mon, 7 Jan 2013 02:38:36 +0000 (UTC) Received: from gonzo (uid 1151) (envelope-from gonzo@svn.freebsd.org) id 145b by svn.freebsd.org (DragonFly Mail Agent v0.7); Mon, 07 Jan 2013 02:38:36 +0000 From: Oleksandr Tymoshenko Date: Mon, 7 Jan 2013 02:38:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245120 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <50ea352c.145b.2ae7fa05@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 02:38:37 -0000 Author: gonzo Date: Mon Jan 7 02:38:36 2013 New Revision: 245120 URL: http://svnweb.freebsd.org/changeset/base/245120 Log: Release version check for erratum 727915 workaround in l2_wbinv_range function implementation causes function fail to flush caches for chip with RTL number 0x7. I failed to find official PL310 revision with this RTL number so further research on this matter required. Modified: head/sys/arm/arm/pl310.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Mon Jan 7 00:49:29 2013 (r245119) +++ head/sys/arm/arm/pl310.c Mon Jan 7 02:38:36 2013 (r245120) @@ -187,9 +187,7 @@ pl310_wbinv_range(vm_paddr_t start, vm_s #ifdef PL310_ERRATA_727915 - if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r2p0 || - pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) - platform_pl310_write_debug(pl310_softc, 3); + platform_pl310_write_debug(pl310_softc, 3); #endif while (size > 0) { #ifdef PL310_ERRATA_588369 @@ -210,9 +208,7 @@ pl310_wbinv_range(vm_paddr_t start, vm_s size -= g_l2cache_line_size; } #ifdef PL310_ERRATA_727915 - if (pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r2p0 || - pl310_softc->sc_rtl_revision == CACHE_ID_RELEASE_r3p0) - platform_pl310_write_debug(pl310_softc, 0); + platform_pl310_write_debug(pl310_softc, 0); #endif pl310_cache_sync(); From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 03:22:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D7B6BBD0; Mon, 7 Jan 2013 03:22:28 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-da0-f46.google.com (mail-da0-f46.google.com [209.85.210.46]) by mx1.freebsd.org (Postfix) with ESMTP id 8141E653; Mon, 7 Jan 2013 03:22:28 +0000 (UTC) Received: by mail-da0-f46.google.com with SMTP id p5so8399066dak.5 for ; Sun, 06 Jan 2013 19:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:references:mime-version:in-reply-to:content-type :content-transfer-encoding:message-id:cc:x-mailer:from:subject:date :to; bh=ewsOYwLpxABv7sjeXgrv4nsL9YMcEZvC+L0Ee8CR2+k=; b=vbgmkQYX4HIB2anf/yGlTUDSw0LC8IlNjGiLl9zbS643zX27AV+TBS4fICRysmLHQC apkFyK5QxzebEdC48aVv9xBCzLd/GjyjxscQwi5Ynse/m2zevCSbMUkWhUNtekttnFZe xqwoTBmkezjDYmUYryUKTlolnWLnCMcpNitaQBscDqO2p/dKA0q8youSs0vxQyTCSp3I 3heHzLLshlCh0EfnJ+qg6dY4CxoBiAI2V5nE2h9Ej7efOIPN3Nl/72i+3p9jj23Ad9vV vuHY3UdNC8K9sv94sB8tvY+wwxsnCKWU5SR99tmk/uZOI7leaKU+G5jAqhIG5blIY27+ fNpw== X-Received: by 10.68.223.230 with SMTP id qx6mr185588045pbc.159.1357528942010; Sun, 06 Jan 2013 19:22:22 -0800 (PST) Received: from [10.64.84.34] (mobile-166-147-093-031.mycingular.net. [166.147.93.31]) by mx.google.com with ESMTPS id a4sm37835880pax.25.2013.01.06.19.22.19 (version=SSLv3 cipher=OTHER); Sun, 06 Jan 2013 19:22:21 -0800 (PST) References: <201301051918.r05JIptx030509@svn.freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <201301051918.r05JIptx030509@svn.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <999FD346-D6A2-473C-91F6-BDCE8363A62E@gmail.com> X-Mailer: iPhone Mail (10A523) From: Garrett Cooper Subject: Re: svn commit: r245066 - head/sys/kern Date: Sun, 6 Jan 2013 19:22:14 -0800 To: Neel Natu Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 03:22:28 -0000 On Jan 5, 2013, at 11:18 AM, Neel Natu wrote: > Author: neel > Date: Sat Jan 5 19:18:50 2013 > New Revision: 245066 > URL: http://svnweb.freebsd.org/changeset/base/245066 >=20 > Log: > Teach the kernel to recognize that it is executing inside a bhyve virtual= > machine. >=20 > Obtained from: NetApp >=20 > Modified: > head/sys/kern/subr_param.c >=20 > Modified: head/sys/kern/subr_param.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/sys/kern/subr_param.c Sat Jan 5 18:48:23 2013 (r245065) > +++ head/sys/kern/subr_param.c Sat Jan 5 19:18:50 2013 (r245066) > @@ -160,6 +160,7 @@ static const char *const vm_bnames[] =3D { > "Plex86", /* Plex86 */ > "Bochs", /* Bochs */ > "Xen", /* Xen */ > + "BHYVE", /* bhyve */ > NULL > }; Interesting. This needs to be abstracted out a bit in order to work more pro= perly with VMware and other platforms that use the VT calls properly (and ge= t rid of some duplicated effort in tsc.c), but this is definitely a good bre= adcrumb for cleaning up our vm detection and handling layer. Thanks for the commit :). -Garrett= From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 03:36:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7D78AE52 for ; Mon, 7 Jan 2013 03:36:33 +0000 (UTC) (envelope-from pfg@svn.freebsd.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5C3A26BC for ; Mon, 7 Jan 2013 03:36:33 +0000 (UTC) Received: from pfg (uid 1275) (envelope-from pfg@svn.freebsd.org) id 1c22 by svn.freebsd.org (DragonFly Mail Agent v0.7); Mon, 07 Jan 2013 03:36:33 +0000 From: Pedro F. Giffuni Date: Mon, 7 Jan 2013 03:36:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245121 - head/sys/fs/ext2fs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Message-Id: <50ea42c1.1c22.6605f106@svn.freebsd.org> X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 03:36:33 -0000 Author: pfg Date: Mon Jan 7 03:36:32 2013 New Revision: 245121 URL: http://svnweb.freebsd.org/changeset/base/245121 Log: ext2fs: cleanup de dinode structure. It was plagued with style errors and the offsets had been lost. While here took the time to update the fields according to the latest ext4 documentation. Reviewed by: bde MFC after: 3 days Modified: head/sys/fs/ext2fs/ext2_dinode.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Mon Jan 7 02:38:36 2013 (r245120) +++ head/sys/fs/ext2fs/ext2_dinode.h Mon Jan 7 03:36:32 2013 (r245121) @@ -29,8 +29,6 @@ #ifndef _FS_EXT2FS_EXT2_DINODE_H_ #define _FS_EXT2FS_EXT2_DINODE_H_ -#define e2di_size_high e2di_dacl - /* * Special inode numbers * The root inode is the root of the file system. Inode 0 can't be used for @@ -87,11 +85,11 @@ struct ext2fs_dinode { uint16_t e2di_mode; /* 0: IFMT, permissions; see below. */ uint16_t e2di_uid; /* 2: Owner UID */ - uint32_t e2di_size; /* 4: Size (in bytes) */ - uint32_t e2di_atime; /* 8: Access time */ - uint32_t e2di_ctime; /* 12: Change time */ - uint32_t e2di_mtime; /* 16: Modification time */ - uint32_t e2di_dtime; /* 20: Deletion time */ + uint32_t e2di_size; /* 4: Size (in bytes) */ + uint32_t e2di_atime; /* 8: Access time */ + uint32_t e2di_ctime; /* 12: Change time */ + uint32_t e2di_mtime; /* 16: Modification time */ + uint32_t e2di_dtime; /* 20: Deletion time */ uint16_t e2di_gid; /* 24: Owner GID */ uint16_t e2di_nlink; /* 26: File link count */ uint32_t e2di_nblock; /* 28: Blocks count */ @@ -99,22 +97,23 @@ struct ext2fs_dinode { uint32_t e2di_version; /* 36: Low 32 bits inode version */ uint32_t e2di_blocks[EXT2_N_BLOCKS]; /* 40: disk blocks */ uint32_t e2di_gen; /* 100: generation number */ - uint32_t e2di_facl; /* 104: file ACL (not implemented) */ - uint32_t e2di_dacl; /* 108: dir ACL (not implemented) */ - uint32_t e2di_faddr; /* 112: fragment address */ + uint32_t e2di_facl; /* 104: Low EA block */ + uint32_t e2di_size_high; /* 108: Upper bits of file size */ + uint32_t e2di_faddr; /* 112: Fragment address (obsolete) */ uint16_t e2di_nblock_high; /* 116: Blocks count bits 47:32 */ - uint16_t e2di_facl_high; /* 118: file ACL bits 47:32 */ + uint16_t e2di_facl_high; /* 118: File EA bits 47:32 */ uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ - uint32_t e2di_linux_reserved3; /* 124 */ - uint16_t e2di_extra_isize; - uint16_t e2di_pad1; - uint32_t e2di_ctime_extra; /* Extra change time */ - uint32_t e2di_mtime_extra; /* Extra modification time */ - uint32_t e2di_atime_extra; /* Extra access time */ - uint32_t e2di_crtime; /* Creation (birth)time */ - uint32_t e2di_crtime_extra; /* Extra creation (birth)time */ - uint32_t e2di_version_hi; /* High 30 bits of inode version */ + uint16_t e2di_chksum_lo; /* 124: Lower inode checksum */ + uint16_t e2di_lx_reserved; /* 126: Unused */ + uint16_t e2di_extra_isize; /* 128: Size of this inode */ + uint16_t e2di_chksum_hi; /* 130: High inode checksum */ + uint32_t e2di_ctime_extra; /* 132: Extra change time */ + uint32_t e2di_mtime_extra; /* 136: Extra modification time */ + uint32_t e2di_atime_extra; /* 140: Extra access time */ + uint32_t e2di_crtime; /* 144: Creation (birth)time */ + uint32_t e2di_crtime_extra; /* 148: Extra creation (birth)time */ + uint32_t e2di_version_hi; /* 152: High bits of inode version */ }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 07:06:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1BFD4116; Mon, 7 Jan 2013 07:06:47 +0000 (UTC) (envelope-from neelnatu@gmail.com) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) by mx1.freebsd.org (Postfix) with ESMTP id C81EAE7E; Mon, 7 Jan 2013 07:06:46 +0000 (UTC) Received: by mail-ie0-f177.google.com with SMTP id k13so22176261iea.8 for ; Sun, 06 Jan 2013 23:06:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:content-transfer-encoding; bh=pRnsdJGv15krHj6q3x0MlpMRXnD+87YlQjcsOFaw6n0=; b=rFIEOAYZWKUa/wvUTRfmxPTencBrFuaXFvCEj6+mLc0wTpOVm+P2PAYMXUJxLKs80L qvE06cZyhb08/Sodi8AdnC7w6+n+RYBracubUvhYH19ydOXZRrwV4WyAU5HfSe7ZTcHH bPIHvhWtmC5REu/THd8Pneu2HjT+LlpiIZkx/8fFfeKGYBVq2jKMFg2D1f7zyUnSgca3 TNPhsIQu7obQNBAQAwRuGfvCnxwBzNWy55B6dQrXNsXMlzr6+t4bOIcJB1fO5ibhw8jv A5CuWWcyGzU46qu0njegBjj5rcG0tfVz4cKAP74jcqyP1aRFHzOBpStvMvtJ8XXx0xbm QVVg== MIME-Version: 1.0 X-Received: by 10.50.158.165 with SMTP id wv5mr4904258igb.3.1357542400080; Sun, 06 Jan 2013 23:06:40 -0800 (PST) Received: by 10.43.112.194 with HTTP; Sun, 6 Jan 2013 23:06:39 -0800 (PST) In-Reply-To: <999FD346-D6A2-473C-91F6-BDCE8363A62E@gmail.com> References: <201301051918.r05JIptx030509@svn.freebsd.org> <999FD346-D6A2-473C-91F6-BDCE8363A62E@gmail.com> Date: Sun, 6 Jan 2013 23:06:39 -0800 Message-ID: Subject: Re: svn commit: r245066 - head/sys/kern From: Neel Natu To: Garrett Cooper 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" , Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 07:06:47 -0000 Hi Garrett, On Sun, Jan 6, 2013 at 7:22 PM, Garrett Cooper wrote: > On Jan 5, 2013, at 11:18 AM, Neel Natu wrote: > >> Author: neel >> Date: Sat Jan 5 19:18:50 2013 >> New Revision: 245066 >> URL: http://svnweb.freebsd.org/changeset/base/245066 >> >> Log: >> Teach the kernel to recognize that it is executing inside a bhyve virtu= al >> machine. >> >> Obtained from: NetApp >> >> Modified: >> head/sys/kern/subr_param.c >> >> Modified: head/sys/kern/subr_param.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/sys/kern/subr_param.c Sat Jan 5 18:48:23 2013 (r245065) >> +++ head/sys/kern/subr_param.c Sat Jan 5 19:18:50 2013 (r245066) >> @@ -160,6 +160,7 @@ static const char *const vm_bnames[] =3D { >> "Plex86", /* Plex86 */ >> "Bochs", /* Bochs */ >> "Xen", /* Xen */ >> + "BHYVE", /* bhyve */ >> NULL >> }; > > Interesting. This needs to be abstracted out a bit in order to work more = properly with VMware and other platforms that use the VT calls properly (an= d get rid of some duplicated effort in tsc.c), but this is definitely a goo= d breadcrumb for cleaning up our vm detection and handling layer. > Agreed. One possible approach would be to have an arch-dependent call which could check for presence of the CPUID2_HV. It would have the added bonus of getting rid of x86-specific code from subr_param.c. Also, I am not sure what you mean by "platforms that use the VT calls properly" ... best Neel > Thanks for the commit :). > > -Garrett From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 15:14:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5602C502; Mon, 7 Jan 2013 15:14:57 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 318AFFB3; Mon, 7 Jan 2013 15:14:57 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4A14BB91A; Mon, 7 Jan 2013 10:14:56 -0500 (EST) From: John Baldwin To: Jaakko Heinonen Subject: Re: svn commit: r244585 - in head: . sys/geom/label Date: Mon, 7 Jan 2013 09:27:06 -0500 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201212221343.qBMDhCHa086834@svn.freebsd.org> <201301041218.07804.john@baldwin.cx> <20130105092252.GA1832@a91-153-116-96.elisa-laajakaista.fi> In-Reply-To: <20130105092252.GA1832@a91-153-116-96.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201301070927.07157.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 07 Jan 2013 10:14:56 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 15:14:57 -0000 On Saturday, January 05, 2013 04:22:52 AM Jaakko Heinonen wrote: > On 2013-01-04, John Baldwin wrote: > > > New Revision: 244585 > > > > > > Log: > > > Mangle label names containing spaces, non-printable characters '%' or > > > '"'. Mangling is only done for label names read from file system > > > metadata. Encoding resembles URL encoding. For example, the space > > > character becomes %20. > > > > Ouch, mangling spaces seems unfortunate. I guess fixing the devctl > > protocol is too hard, and/or we can't just encode it at the protocol > > layer but leave the actual device names untouched? > > I initially proposed changing the devctl protocol but in a private > discussion people preferred to not change the protocol. However, I think > that allowing the space character only might be possible without > changing the protocol as devd(8) can already handle strings enclosed in > double quotes. usb(4) already uses such devctl variables. > > > OS X preserves spaces in volume names and those can be quite common on > > ISO images, so mangling them really does seem to be a shame if we can > > avoid it. > > How important do you think this is? I understand that it's annoyance for > people upgrading their systems but labels with spaces can still be used. I think if it isn't hard to do so, we should aim to preserve labels as they are generally intended to be human readable as-is. Just preserving spaces is probably sufficient for this as they are probably the most commonly used character in labels affected by this change. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 15:14:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F021509; Mon, 7 Jan 2013 15:14:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 4E103FB8; Mon, 7 Jan 2013 15:14:59 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id A6FB6B9AC; Mon, 7 Jan 2013 10:14:58 -0500 (EST) From: John Baldwin To: Neel Natu Subject: Re: svn commit: r245066 - head/sys/kern Date: Mon, 7 Jan 2013 09:49:32 -0500 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: <201301051918.r05JIptx030509@svn.freebsd.org> In-Reply-To: <201301051918.r05JIptx030509@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201301070949.33173.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 07 Jan 2013 10:14:58 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 15:14:59 -0000 On Saturday, January 05, 2013 02:18:51 PM Neel Natu wrote: > Author: neel > Date: Sat Jan 5 19:18:50 2013 > New Revision: 245066 > URL: http://svnweb.freebsd.org/changeset/base/245066 > > Log: > Teach the kernel to recognize that it is executing inside a bhyve virtual > machine. > > Obtained from: NetApp > > Modified: > head/sys/kern/subr_param.c > > Modified: head/sys/kern/subr_param.c > =========================================================================== > === --- head/sys/kern/subr_param.c Sat Jan 5 18:48:23 2013 (r245065) > +++ head/sys/kern/subr_param.c Sat Jan 5 19:18:50 2013 (r245066) > @@ -160,6 +160,7 @@ static const char *const vm_bnames[] = { > "Plex86", /* Plex86 */ > "Bochs", /* Bochs */ > "Xen", /* Xen */ > + "BHYVE", /* bhyve */ > NULL > }; It would be nice to start using the CPUID leaf for VM's in preference to the SMBIOS strings at some point. (I think it's level 0x40000000?) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 16:38:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E2B0D92A; Mon, 7 Jan 2013 16:38:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D50C8683; Mon, 7 Jan 2013 16:38:13 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r07GcD0F020353; Mon, 7 Jan 2013 16:38:13 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r07GcDga020351; Mon, 7 Jan 2013 16:38:13 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301071638.r07GcDga020351@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 7 Jan 2013 16:38:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245132 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 16:38:14 -0000 Author: hselasky Date: Mon Jan 7 16:38:13 2013 New Revision: 245132 URL: http://svnweb.freebsd.org/changeset/base/245132 Log: Optimise the XHCI interrupt handling. This patch will save CPU time when the XHCI interrupt is shared with other devices. Only check event rings when interrupt bits are set. Otherwise would indicate hiding possible hardware fault(s). Tested by: sos @ Submitted by: sos @ MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Mon Jan 7 15:46:10 2013 (r245131) +++ head/sys/dev/usb/controller/xhci.c Mon Jan 7 16:38:13 2013 (r245132) @@ -1459,7 +1459,9 @@ xhci_interrupt(struct xhci_softc *sc) DPRINTFN(16, "real interrupt (sts=0x%08x, " "iman=0x%08x)\n", status, temp); - if (status != 0) { + if (status & (XHCI_STS_PCD | XHCI_STS_HCH | + XHCI_STS_HSE | XHCI_STS_HCE)) { + if (status & XHCI_STS_PCD) { xhci_root_intr(sc); } @@ -1480,7 +1482,9 @@ xhci_interrupt(struct xhci_softc *sc) } } - xhci_interrupt_poll(sc); + /* check if we need to check the event rings */ + if ((status != 0) || (temp & XHCI_IMAN_INTR_PEND)) + xhci_interrupt_poll(sc); USB_BUS_UNLOCK(&sc->sc_bus); } From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 17:58:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E7EF1491; Mon, 7 Jan 2013 17:58:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBAEBA45; Mon, 7 Jan 2013 17:58:29 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r07HwTH9039994; Mon, 7 Jan 2013 17:58:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r07HwS5v039985; Mon, 7 Jan 2013 17:58:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301071758.r07HwS5v039985@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 7 Jan 2013 17:58:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245133 - in head/lib/csu: amd64 arm common i386-elf mips powerpc powerpc64 sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 17:58:30 -0000 Author: kib Date: Mon Jan 7 17:58:27 2013 New Revision: 245133 URL: http://svnweb.freebsd.org/changeset/base/245133 Log: Only assign the environ in the startup code when environ is NULL. Preloaded library could have changed the environment, and unconditional assingment to the environ undoes the customization. The binaries needs to be recompiled to get the fix. Move the common code to set up environ and __progname into the helper. Note that ia64 possibly not fixed, due to it still using old csu. Reported and tested by: John Hein Reviewed by: kan, scf Approved by: secteam (simon) MFC after: 2 weeks Modified: head/lib/csu/amd64/crt1.c head/lib/csu/arm/crt1.c head/lib/csu/common/ignore_init.c head/lib/csu/i386-elf/crt1_c.c head/lib/csu/mips/crt1.c head/lib/csu/powerpc/crt1.c head/lib/csu/powerpc64/crt1.c head/lib/csu/sparc64/crt1.c Modified: head/lib/csu/amd64/crt1.c ============================================================================== --- head/lib/csu/amd64/crt1.c Mon Jan 7 16:38:13 2013 (r245132) +++ head/lib/csu/amd64/crt1.c Mon Jan 7 17:58:27 2013 (r245133) @@ -61,9 +61,7 @@ _start(char **ap, void (*cleanup)(void)) argc = *(long *)(void *)ap; argv = ap + 1; env = ap + 2 + argc; - environ = env; - if (argc > 0 && argv[0] != NULL) - handle_progname(argv[0]); + handle_argv(argc, argv, env); if (&_DYNAMIC != NULL) atexit(cleanup); Modified: head/lib/csu/arm/crt1.c ============================================================================== --- head/lib/csu/arm/crt1.c Mon Jan 7 16:38:13 2013 (r245132) +++ head/lib/csu/arm/crt1.c Mon Jan 7 17:58:27 2013 (r245133) @@ -98,10 +98,7 @@ __start(int argc, char **argv, char **en const struct Struct_Obj_Entry *obj __unused, void (*cleanup)(void)) { - environ = env; - - if (argc > 0 && argv[0] != NULL) - handle_progname(argv[0]); + handle_argv(argc, argv, env); if (ps_strings != (struct ps_strings *)0) __ps_strings = ps_strings; Modified: head/lib/csu/common/ignore_init.c ============================================================================== --- head/lib/csu/common/ignore_init.c Mon Jan 7 16:38:13 2013 (r245132) +++ head/lib/csu/common/ignore_init.c Mon Jan 7 17:58:27 2013 (r245133) @@ -87,14 +87,18 @@ handle_static_init(int argc, char **argv } static inline void -handle_progname(const char *v) +handle_argv(int argc, char *argv[], char **env) { const char *s; - __progname = v; - for (s = __progname; *s != '\0'; s++) { - if (*s == '/') - __progname = s + 1; + if (environ == NULL) + environ = env; + if (argc > 0 && argv[0] != NULL) { + __progname = argv[0]; + for (s = __progname; *s != '\0'; s++) { + if (*s == '/') + __progname = s + 1; + } } } Modified: head/lib/csu/i386-elf/crt1_c.c ============================================================================== --- head/lib/csu/i386-elf/crt1_c.c Mon Jan 7 16:38:13 2013 (r245132) +++ head/lib/csu/i386-elf/crt1_c.c Mon Jan 7 17:58:27 2013 (r245133) @@ -61,10 +61,7 @@ _start1(fptr cleanup, int argc, char *ar char **env; env = argv + argc + 1; - environ = env; - if (argc > 0 && argv[0] != NULL) - handle_progname(argv[0]); - + handle_argv(argc, argv, env); if (&_DYNAMIC != NULL) atexit(cleanup); else Modified: head/lib/csu/mips/crt1.c ============================================================================== --- head/lib/csu/mips/crt1.c Mon Jan 7 16:38:13 2013 (r245132) +++ head/lib/csu/mips/crt1.c Mon Jan 7 17:58:27 2013 (r245133) @@ -71,9 +71,7 @@ __start(char **ap, argc = * (long *) ap; argv = ap + 1; env = ap + 2 + argc; - environ = env; - if (argc > 0 && argv[0] != NULL) - handle_progname(argv[0]); + handle_argv(argc, argv, env); if (&_DYNAMIC != NULL) atexit(cleanup); Modified: head/lib/csu/powerpc/crt1.c ============================================================================== --- head/lib/csu/powerpc/crt1.c Mon Jan 7 16:38:13 2013 (r245132) +++ head/lib/csu/powerpc/crt1.c Mon Jan 7 17:58:27 2013 (r245133) @@ -81,10 +81,8 @@ _start(int argc, char **argv, char **env struct ps_strings *ps_strings) { - environ = env; - if (argc > 0 && argv[0] != NULL) - handle_progname(argv[0]); + handle_argv(argc, argv, env); if (ps_strings != (struct ps_strings *)0) __ps_strings = ps_strings; Modified: head/lib/csu/powerpc64/crt1.c ============================================================================== --- head/lib/csu/powerpc64/crt1.c Mon Jan 7 16:38:13 2013 (r245132) +++ head/lib/csu/powerpc64/crt1.c Mon Jan 7 17:58:27 2013 (r245133) @@ -81,10 +81,7 @@ _start(int argc, char **argv, char **env struct ps_strings *ps_strings) { - environ = env; - - if (argc > 0 && argv[0] != NULL) - handle_progname(argv[0]); + handle_argv(argc, argv, env); if (ps_strings != (struct ps_strings *)0) __ps_strings = ps_strings; Modified: head/lib/csu/sparc64/crt1.c ============================================================================== --- head/lib/csu/sparc64/crt1.c Mon Jan 7 16:38:13 2013 (r245132) +++ head/lib/csu/sparc64/crt1.c Mon Jan 7 17:58:27 2013 (r245133) @@ -85,9 +85,7 @@ _start(char **ap, void (*cleanup)(void), argc = *(long *)(void *)ap; argv = ap + 1; env = ap + 2 + argc; - environ = env; - if (argc > 0 && argv[0] != NULL) - handle_progname(argv[0]); + handle_argv(argc, argv, env); if (&_DYNAMIC != NULL) atexit(cleanup); From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 18:47:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BA784CD6; Mon, 7 Jan 2013 18:47:38 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id 40C02CF1; Mon, 7 Jan 2013 18:47:37 +0000 (UTC) Received: from [88.198.91.248] (helo=[IPv6:::1]) by id.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1TsHjS-000Ozc-3X; Mon, 07 Jan 2013 10:47:36 -0800 Message-ID: <50EB1841.5030006@bluezbox.com> Date: Mon, 07 Jan 2013 10:47:29 -0800 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> In-Reply-To: <50DD081E.8000409@bluezbox.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: > On 12/18/2012 1:59 AM, Alan Cox wrote: >> On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >>> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >>> >>>> On 12/08/2012 14:32, Andre Oppermann wrote: >>> .. skipped .. >>> >>>>> The trouble seems to come from NSFBUFS which is (512 + maxusers * 16) >>>>> resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = 27MB. >>>>> This >>>>> seem to be pushing it with the smaller ARM kmap layout. >>>>> >>>>> Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500? >>>>> >>>>> ARM does have a direct map mode as well which doesn't require the >>>>> allocation >>>>> of sfbufs. I'm not sure which other problems that approach has. >>>>> >>>> Only a few (3?) platforms use it. It reduces the size of the user >>>> address space, and translation between physical addresses and >>>> direct map >>>> addresses is not computationally trivial as it is on other >>>> architectures, e.g., amd64, ia64. However, it does try to use large >>>> page mappings. >>>> >>>> >>>>> Hopefully alc@ (added to cc) can answer that and also why the kmap of >>>>> 27MB >>>>> manages to wrench the ARM kernel. >>>>> >>>> Arm does not define caps on either the buffer map size (param.h) or >>>> the >>>> kmem map size (vmparam.h). It would probably make sense to copy these >>>> definitions from i386. >>> Adding caps didn't help. I did some digging and found out that >>> although address range >>> 0xc0000000 .. 0xffffffff is indeed valid for ARM in general actual >>> KVA space varies for >>> each specific hardware platform. This "real" KVA is defined by >>> >>> pair and ifI use them instead of >> VM_MAX_KERNEL_ADDRESS> >>> in init_param2 function my pandaboard successfully boots. Since >>> former pair is used for defining >>> kernel_map boundaries I believe it should be used for auto tuning as >>> well. >> >> That makes sense. However, "virtual_avail" isn't the start of the >> kernel address [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 18:47:38 -0000 On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: > On 12/18/2012 1:59 AM, Alan Cox wrote: >> On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >>> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >>> >>>> On 12/08/2012 14:32, Andre Oppermann wrote: >>> .. skipped .. >>> >>>>> The trouble seems to come from NSFBUFS which is (512 + maxusers * 16) >>>>> resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = 27MB. >>>>> This >>>>> seem to be pushing it with the smaller ARM kmap layout. >>>>> >>>>> Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500? >>>>> >>>>> ARM does have a direct map mode as well which doesn't require the >>>>> allocation >>>>> of sfbufs. I'm not sure which other problems that approach has. >>>>> >>>> Only a few (3?) platforms use it. It reduces the size of the user >>>> address space, and translation between physical addresses and >>>> direct map >>>> addresses is not computationally trivial as it is on other >>>> architectures, e.g., amd64, ia64. However, it does try to use large >>>> page mappings. >>>> >>>> >>>>> Hopefully alc@ (added to cc) can answer that and also why the kmap of >>>>> 27MB >>>>> manages to wrench the ARM kernel. >>>>> >>>> Arm does not define caps on either the buffer map size (param.h) or >>>> the >>>> kmem map size (vmparam.h). It would probably make sense to copy these >>>> definitions from i386. >>> Adding caps didn't help. I did some digging and found out that >>> although address range >>> 0xc0000000 .. 0xffffffff is indeed valid for ARM in general actual >>> KVA space varies for >>> each specific hardware platform. This "real" KVA is defined by >>> >>> pair and ifI use them instead of >> VM_MAX_KERNEL_ADDRESS> >>> in init_param2 function my pandaboard successfully boots. Since >>> former pair is used for defining >>> kernel_map boundaries I believe it should be used for auto tuning as >>> well. >> >> That makes sense. However, "virtual_avail" isn't the start of the >> kernel address space. The kernel map always starts at >> VM_MIN_KERNEL_ADDRESS. (See kmem_init().) "virtual_avail" represents >> the next unallocated virtual address in the kernel address space at an >> early point in initialization. "virtual_avail" and "virtual_end" aren't >> used after that, or outside the VM system. Please use >> vm_map_min(kernel_map) and vm_map_max(kernel_map) instead. > > I checked: kernel_map is not available (NULL) at this point. So we > can't use it to > determine real KVA size. Closest thing we can get is > virtual_avail/virtual_end pair. > > Andre, could you approve attached patch for commit or suggest better > solution? Any update on this one? Can I proceed with commit? From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 19:37:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 209F2C0F; Mon, 7 Jan 2013 19:37:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 12F9D19B; Mon, 7 Jan 2013 19:37:02 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r07JadAS060410; Mon, 7 Jan 2013 19:36:45 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r07JaI2V060397; Mon, 7 Jan 2013 19:36:18 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201301071936.r07JaI2V060397@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 7 Jan 2013 19:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245134 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 19:37:02 -0000 Author: glebius Date: Mon Jan 7 19:36:11 2013 New Revision: 245134 URL: http://svnweb.freebsd.org/changeset/base/245134 Log: - Add dashes before copyright notices. - Add $FreeBSD$. - Remove unused define. Modified: head/sys/net/if_pfsync.h Modified: head/sys/net/if_pfsync.h ============================================================================== --- head/sys/net/if_pfsync.h Mon Jan 7 17:58:27 2013 (r245133) +++ head/sys/net/if_pfsync.h Mon Jan 7 19:36:11 2013 (r245134) @@ -1,6 +1,4 @@ -/* $OpenBSD: if_pfsync.h,v 1.35 2008/06/29 08:42:15 mcbride Exp $ */ - -/* +/*- * Copyright (c) 2001 Michael Shalayeff * All rights reserved. * @@ -26,7 +24,7 @@ * THE POSSIBILITY OF SUCH DAMAGE. */ -/* +/*- * Copyright (c) 2008 David Gwynne * * Permission to use, copy, modify, and distribute this software for any @@ -42,6 +40,12 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +/* + * $OpenBSD: if_pfsync.h,v 1.35 2008/06/29 08:42:15 mcbride Exp $ + * $FreeBSD$ + */ + + #ifndef _NET_IF_PFSYNC_H_ #define _NET_IF_PFSYNC_H_ @@ -63,20 +67,6 @@ #define PFSYNC_ACT_EOF 12 /* end of frame */ #define PFSYNC_ACT_MAX 13 -#define PFSYNC_ACTIONS "CLR ST", \ - "INS ST", \ - "INS ST ACK", \ - "UPD ST", \ - "UPD ST COMP", \ - "UPD ST REQ", \ - "DEL ST", \ - "DEL ST COMP", \ - "INS FR", \ - "DEL FR", \ - "BULK UPD STAT", \ - "TDB UPD", \ - "EOF" - #define PFSYNC_HMAC_LEN 20 /* From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 19:42:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E7DD5F41; Mon, 7 Jan 2013 19:42:41 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh10.mail.rice.edu (mh10.mail.rice.edu [128.42.201.30]) by mx1.freebsd.org (Postfix) with ESMTP id AF9251D6; Mon, 7 Jan 2013 19:42:41 +0000 (UTC) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 1D0C1604C9; Mon, 7 Jan 2013 13:32:36 -0600 (CST) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 1B563603DA; Mon, 7 Jan 2013 13:32:36 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh10.mail.rice.edu, auth channel Received: from mh10.mail.rice.edu ([127.0.0.1]) by mh10.mail.rice.edu (mh10.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id rdXnTEeZlyAu; Mon, 7 Jan 2013 13:32:36 -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 mh10.mail.rice.edu (Postfix) with ESMTPSA id 1E3D5604C6; Mon, 7 Jan 2013 13:32:35 -0600 (CST) Message-ID: <50EB22D2.6090103@rice.edu> Date: Mon, 07 Jan 2013 13:32:34 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Oleksandr Tymoshenko Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> In-Reply-To: <50EB1841.5030006@bluezbox.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 19:42:42 -0000 On 01/07/2013 12:47, Oleksandr Tymoshenko wrote: > On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: >> On 12/18/2012 1:59 AM, Alan Cox wrote: >>> On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >>>> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >>>> >>>>> On 12/08/2012 14:32, Andre Oppermann wrote: >>>> .. skipped .. >>>> >>>>>> The trouble seems to come from NSFBUFS which is (512 + maxusers * >>>>>> 16) >>>>>> resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = >>>>>> 27MB. This >>>>>> seem to be pushing it with the smaller ARM kmap layout. >>>>>> >>>>>> Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500? >>>>>> >>>>>> ARM does have a direct map mode as well which doesn't require the >>>>>> allocation >>>>>> of sfbufs. I'm not sure which other problems that approach has. >>>>>> >>>>> Only a few (3?) platforms use it. It reduces the size of the user >>>>> address space, and translation between physical addresses and >>>>> direct map >>>>> addresses is not computationally trivial as it is on other >>>>> architectures, e.g., amd64, ia64. However, it does try to use large >>>>> page mappings. >>>>> >>>>> >>>>>> Hopefully alc@ (added to cc) can answer that and also why the >>>>>> kmap of >>>>>> 27MB >>>>>> manages to wrench the ARM kernel. >>>>>> >>>>> Arm does not define caps on either the buffer map size (param.h) >>>>> or the >>>>> kmem map size (vmparam.h). It would probably make sense to copy >>>>> these >>>>> definitions from i386. >>>> Adding caps didn't help. I did some digging and found out that >>>> although address range >>>> 0xc0000000 .. 0xffffffff is indeed valid for ARM in general actual >>>> KVA space varies for >>>> each specific hardware platform. This "real" KVA is defined by >>>> >>>> pair and ifI use them instead of >>> VM_MAX_KERNEL_ADDRESS> >>>> in init_param2 function my pandaboard successfully boots. Since >>>> former pair is used for defining >>>> kernel_map boundaries I believe it should be used for auto tuning >>>> as well. >>> >>> That makes sense. However, "virtual_avail" isn't the start of the >>> kernel address space. The kernel map always starts at >>> VM_MIN_KERNEL_ADDRESS. (See kmem_init().) "virtual_avail" represents >>> the next unallocated virtual address in the kernel address space at an >>> early point in initialization. "virtual_avail" and "virtual_end" >>> aren't >>> used after that, or outside the VM system. Please use >>> vm_map_min(kernel_map) and vm_map_max(kernel_map) instead. >> >> I checked: kernel_map is not available (NULL) at this point. So we >> can't use it to >> determine real KVA size. Closest thing we can get is >> virtual_avail/virtual_end pair. >> >> Andre, could you approve attached patch for commit or suggest better >> solution? > > Any update on this one? Can I proceed with commit? > Sorry, I've been away from my e-mail since the 30th, and I'm now in the process of getting caught up. Give me a day or so to look at this. Alan From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 20:36:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 63270BAD; Mon, 7 Jan 2013 20:36:52 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 54085662; Mon, 7 Jan 2013 20:36:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r07Kaqon075477; Mon, 7 Jan 2013 20:36:52 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r07Kaqwd075476; Mon, 7 Jan 2013 20:36:52 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201301072036.r07Kaqwd075476@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 7 Jan 2013 20:36:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245135 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 20:36:52 -0000 Author: gonzo Date: Mon Jan 7 20:36:51 2013 New Revision: 245135 URL: http://svnweb.freebsd.org/changeset/base/245135 Log: Implement barriers for AMRv6 and ARMv7 Submitted by: Daisuke Aoyama Reviewed by: ian, cognet Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Mon Jan 7 19:36:11 2013 (r245134) +++ head/sys/arm/include/atomic.h Mon Jan 7 20:36:51 2013 (r245135) @@ -47,9 +47,25 @@ #include #endif -#define mb() -#define wmb() -#define rmb() +#if defined (__ARM_ARCH_7__) || defined (__ARM_ARCH_7A__) +#define isb() __asm __volatile("isb" : : : "memory") +#define dsb() __asm __volatile("dsb" : : : "memory") +#define dmb() __asm __volatile("dmb" : : : "memory") +#elif defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6J__) || \ + defined (__ARM_ARCH_6K__) || defined (__ARM_ARCH_6Z__) || \ + defined (__ARM_ARCH_6ZK__) +#define isb() __asm __volatile("mcr p15, 0, %0, c7, c5, 4" : : "r" (0) : "memory") +#define dsb() __asm __volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0) : "memory") +#define dmb() __asm __volatile("mcr p15, 0, %0, c7, c10, 5" : : "r" (0) : "memory") +#else +#define isb() +#define dsb() +#define dmb() +#endif + +#define mb() dmb() +#define wmb() dmb() +#define rmb() dmb() #ifndef I32_bit #define I32_bit (1 << 7) /* IRQ disable */ From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 21:35:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 989FC646; Mon, 7 Jan 2013 21:35:26 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8950A843; Mon, 7 Jan 2013 21:35:26 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r07LZQNt092662; Mon, 7 Jan 2013 21:35:26 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r07LZQbc092661; Mon, 7 Jan 2013 21:35:26 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201301072135.r07LZQbc092661@svn.freebsd.org> From: Jim Harris Date: Mon, 7 Jan 2013 21:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245136 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 21:35:26 -0000 Author: jimharris Date: Mon Jan 7 21:35:25 2013 New Revision: 245136 URL: http://svnweb.freebsd.org/changeset/base/245136 Log: Revert r244549. This change was originally intended to account for test kthreads under the nvmecontrol process, but jhb indicated it may not be safe to associate kthreads with userland processes and this could have unintended consequences. I did not observe any problems with this change, but my testing didn't exhaust the kinds of corner cases that could cause problems. It is not that important to account for these test threads under nvmecontrol, so I am just reverting this change for now. On a related note, the part of this patch for <= 7.x fails compilation so reverting this fixes that too. Suggested by: jhb Modified: head/sys/dev/nvme/nvme_test.c Modified: head/sys/dev/nvme/nvme_test.c ============================================================================== --- head/sys/dev/nvme/nvme_test.c Mon Jan 7 20:36:51 2013 (r245135) +++ head/sys/dev/nvme/nvme_test.c Mon Jan 7 21:35:25 2013 (r245136) @@ -287,10 +287,10 @@ nvme_ns_test(struct nvme_namespace *ns, for (i = 0; i < io_test->num_threads; i++) #if __FreeBSD_version >= 800004 kthread_add(fn, io_test_internal, - curproc, NULL, 0, 0, "nvme_io_test[%d]", i); + NULL, NULL, 0, 0, "nvme_io_test[%d]", i); #else kthread_create(fn, io_test_internal, - curproc, 0, 0, "nvme_io_test[%d]", i); + NULL, 0, 0, "nvme_io_test[%d]", i); #endif tsleep(io_test_internal, 0, "nvme_test", io_test->time * 2 * hz); From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 21:49:41 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8E64FC57 for ; Mon, 7 Jan 2013 21:49:41 +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 116598D5 for ; Mon, 7 Jan 2013 21:49:40 +0000 (UTC) Received: (qmail 82183 invoked from network); 7 Jan 2013 23:07:06 -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 ; 7 Jan 2013 23:07:06 -0000 Message-ID: <50EB415F.8020405@freebsd.org> Date: Mon, 07 Jan 2013 22:42:55 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Alan Cox Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> In-Reply-To: <50EB22D2.6090103@rice.edu> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Oleksandr Tymoshenko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 21:49:41 -0000 On 07.01.2013 20:32, Alan Cox wrote: > On 01/07/2013 12:47, Oleksandr Tymoshenko wrote: >> On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: >>> On 12/18/2012 1:59 AM, Alan Cox wrote: >>>> On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >>>>> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >>>>> >>>>>> On 12/08/2012 14:32, Andre Oppermann wrote: >>>>> .. skipped .. >>>>> >>>>>>> The trouble seems to come from NSFBUFS which is (512 + maxusers * >>>>>>> 16) >>>>>>> resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = >>>>>>> 27MB. This >>>>>>> seem to be pushing it with the smaller ARM kmap layout. >>>>>>> >>>>>>> Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500? >>>>>>> >>>>>>> ARM does have a direct map mode as well which doesn't require the >>>>>>> allocation >>>>>>> of sfbufs. I'm not sure which other problems that approach has. >>>>>>> >>>>>> Only a few (3?) platforms use it. It reduces the size of the user >>>>>> address space, and translation between physical addresses and >>>>>> direct map >>>>>> addresses is not computationally trivial as it is on other >>>>>> architectures, e.g., amd64, ia64. However, it does try to use large >>>>>> page mappings. >>>>>> >>>>>> >>>>>>> Hopefully alc@ (added to cc) can answer that and also why the >>>>>>> kmap of >>>>>>> 27MB >>>>>>> manages to wrench the ARM kernel. >>>>>>> >>>>>> Arm does not define caps on either the buffer map size (param.h) >>>>>> or the >>>>>> kmem map size (vmparam.h). It would probably make sense to copy >>>>>> these >>>>>> definitions from i386. >>>>> Adding caps didn't help. I did some digging and found out that >>>>> although address range >>>>> 0xc0000000 .. 0xffffffff is indeed valid for ARM in general actual >>>>> KVA space varies for >>>>> each specific hardware platform. This "real" KVA is defined by >>>>> >>>>> pair and ifI use them instead of >>>> VM_MAX_KERNEL_ADDRESS> >>>>> in init_param2 function my pandaboard successfully boots. Since >>>>> former pair is used for defining >>>>> kernel_map boundaries I believe it should be used for auto tuning >>>>> as well. >>>> >>>> That makes sense. However, "virtual_avail" isn't the start of the >>>> kernel address space. The kernel map always starts at >>>> VM_MIN_KERNEL_ADDRESS. (See kmem_init().) "virtual_avail" represents >>>> the next unallocated virtual address in the kernel address space at an >>>> early point in initialization. "virtual_avail" and "virtual_end" >>>> aren't >>>> used after that, or outside the VM system. Please use >>>> vm_map_min(kernel_map) and vm_map_max(kernel_map) instead. >>> >>> I checked: kernel_map is not available (NULL) at this point. So we >>> can't use it to >>> determine real KVA size. Closest thing we can get is >>> virtual_avail/virtual_end pair. >>> >>> Andre, could you approve attached patch for commit or suggest better >>> solution? >> >> Any update on this one? Can I proceed with commit? >> > > Sorry, I've been away from my e-mail since the 30th, and I'm now in the > process of getting caught up. Give me a day or so to look at this. Ditto. -- Andre From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 23:30:54 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6799CBE3; Mon, 7 Jan 2013 23:30:54 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4BE95D12; Mon, 7 Jan 2013 23:30:54 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r07NUsr0025570; Mon, 7 Jan 2013 23:30:54 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r07NUrpq025568; Mon, 7 Jan 2013 23:30:53 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201301072330.r07NUrpq025568@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 7 Jan 2013 23:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245137 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 23:30:54 -0000 Author: gonzo Date: Mon Jan 7 23:30:53 2013 New Revision: 245137 URL: http://svnweb.freebsd.org/changeset/base/245137 Log: - Identify more devices for OMAP4 SoC (up to OMAP4470) - Whitespace fixes Modified: head/sys/arm/ti/ti_cpuid.c head/sys/arm/ti/ti_cpuid.h Modified: head/sys/arm/ti/ti_cpuid.c ============================================================================== --- head/sys/arm/ti/ti_cpuid.c Mon Jan 7 21:35:25 2013 (r245136) +++ head/sys/arm/ti/ti_cpuid.c Mon Jan 7 23:30:53 2013 (r245137) @@ -129,27 +129,75 @@ omap4_get_revision(void) switch (hawkeye) { case 0xB852: - if (revision == 0) + switch (revision) { + case 0: chip_revision = OMAP4430_REV_ES1_0; - else - chip_revision = OMAP4430_REV_ES2_0; + break; + case 1: + chip_revision = OMAP4430_REV_ES2_1; + break; + default: + chip_revision = OMAP4430_REV_UNKNOWN; + break; + } break; + case 0xB95C: - if (revision == 3) + switch (revision) { + case 3: chip_revision = OMAP4430_REV_ES2_1; - else if (revision == 4) + break; + case 4: chip_revision = OMAP4430_REV_ES2_2; - else + break; + case 6: chip_revision = OMAP4430_REV_ES2_3; + break; + default: + chip_revision = OMAP4430_REV_UNKNOWN; + break; + } break; + + case 0xB94E: + switch (revision) { + case 0: + chip_revision = OMAP4460_REV_ES1_0; + break; + case 2: + chip_revision = OMAP4460_REV_ES1_1; + break; + default: + chip_revision = OMAP4460_REV_UNKNOWN; + break; + } + break; + + case 0xB975: + switch (revision) { + case 0: + chip_revision = OMAP4470_REV_ES1_0; + break; + default: + chip_revision = OMAP4470_REV_UNKNOWN; + break; + } + break; + default: /* Default to the latest revision if we can't determine type */ - chip_revision = OMAP4430_REV_ES2_3; + chip_revision = OMAP_UNKNOWN_DEV; break; } - printf("Texas Instruments OMAP%04x Processor, Revision ES%u.%u\n", - OMAP_REV_DEVICE(chip_revision), OMAP_REV_MAJOR(chip_revision), - OMAP_REV_MINOR(chip_revision)); + if (chip_revision != OMAP_UNKNOWN_DEV) { + printf("Texas Instruments OMAP%04x Processor, Revision ES%u.%u\n", + OMAP_REV_DEVICE(chip_revision), OMAP_REV_MAJOR(chip_revision), + OMAP_REV_MINOR(chip_revision)); + } + else { + printf("Texas Instruments unknown OMAP chip: %04x, rev %d\n", + hawkeye, revision); + } } /** Modified: head/sys/arm/ti/ti_cpuid.h ============================================================================== --- head/sys/arm/ti/ti_cpuid.h Mon Jan 7 21:35:25 2013 (r245136) +++ head/sys/arm/ti/ti_cpuid.h Mon Jan 7 23:30:53 2013 (r245137) @@ -30,34 +30,46 @@ #ifndef _TI_CPUID_H_ #define _TI_CPUID_H_ -#define OMAP_MAKEREV(d, a, b, c) \ +#define OMAP_MAKEREV(d, a, b, c) \ (uint32_t)(((d) << 16) | (((a) & 0xf) << 8) | (((b) & 0xf) << 4) | ((c) & 0xf)) -#define OMAP_REV_DEVICE(x) (((x) >> 16) & 0xffff) -#define OMAP_REV_MAJOR(x) (((x) >> 8) & 0xf) -#define OMAP_REV_MINOR(x) (((x) >> 4) & 0xf) -#define OMAP_REV_MINOR_MINOR(x) (((x) >> 0) & 0xf) +#define OMAP_REV_DEVICE(x) (((x) >> 16) & 0xffff) +#define OMAP_REV_MAJOR(x) (((x) >> 8) & 0xf) +#define OMAP_REV_MINOR(x) (((x) >> 4) & 0xf) +#define OMAP_REV_MINOR_MINOR(x) (((x) >> 0) & 0xf) #define OMAP3350_DEV 0x3530 -#define OMAP3350_REV_ES1_0 OMAP_MAKEREV(OMAP3350_DEV, 1, 0, 0) -#define OMAP3530_REV_ES2_0 OMAP_MAKEREV(OMAP3350_DEV, 2, 0, 0) -#define OMAP3530_REV_ES2_1 OMAP_MAKEREV(OMAP3350_DEV, 2, 1, 0) -#define OMAP3530_REV_ES3_0 OMAP_MAKEREV(OMAP3350_DEV, 3, 0, 0) -#define OMAP3530_REV_ES3_1 OMAP_MAKEREV(OMAP3350_DEV, 3, 1, 0) -#define OMAP3530_REV_ES3_1_2 OMAP_MAKEREV(OMAP3350_DEV, 3, 1, 2) +#define OMAP3350_REV_ES1_0 OMAP_MAKEREV(OMAP3350_DEV, 1, 0, 0) +#define OMAP3530_REV_ES2_0 OMAP_MAKEREV(OMAP3350_DEV, 2, 0, 0) +#define OMAP3530_REV_ES2_1 OMAP_MAKEREV(OMAP3350_DEV, 2, 1, 0) +#define OMAP3530_REV_ES3_0 OMAP_MAKEREV(OMAP3350_DEV, 3, 0, 0) +#define OMAP3530_REV_ES3_1 OMAP_MAKEREV(OMAP3350_DEV, 3, 1, 0) +#define OMAP3530_REV_ES3_1_2 OMAP_MAKEREV(OMAP3350_DEV, 3, 1, 2) #define OMAP4430_DEV 0x4430 -#define OMAP4430_REV_ES1_0 OMAP_MAKEREV(OMAP4430_DEV, 1, 0, 0) -#define OMAP4430_REV_ES2_0 OMAP_MAKEREV(OMAP4430_DEV, 2, 0, 0) -#define OMAP4430_REV_ES2_1 OMAP_MAKEREV(OMAP4430_DEV, 2, 1, 0) -#define OMAP4430_REV_ES2_2 OMAP_MAKEREV(OMAP4430_DEV, 2, 2, 0) -#define OMAP4430_REV_ES2_3 OMAP_MAKEREV(OMAP4430_DEV, 2, 3, 0) - -#define AM335X_DEVREV(x) ((x) >> 28) - -#define CHIP_OMAP_3 0 -#define CHIP_OMAP_4 1 -#define CHIP_AM335X 2 +#define OMAP4430_REV_ES1_0 OMAP_MAKEREV(OMAP4430_DEV, 1, 0, 0) +#define OMAP4430_REV_ES2_0 OMAP_MAKEREV(OMAP4430_DEV, 2, 0, 0) +#define OMAP4430_REV_ES2_1 OMAP_MAKEREV(OMAP4430_DEV, 2, 1, 0) +#define OMAP4430_REV_ES2_2 OMAP_MAKEREV(OMAP4430_DEV, 2, 2, 0) +#define OMAP4430_REV_ES2_3 OMAP_MAKEREV(OMAP4430_DEV, 2, 3, 0) +#define OMAP4430_REV_UNKNOWN OMAP_MAKEREV(OMAP4430_DEV, 9, 9, 9) + +#define OMAP4460_DEV 0x4460 +#define OMAP4460_REV_ES1_0 OMAP_MAKEREV(OMAP4460_DEV, 1, 0, 0) +#define OMAP4460_REV_ES1_1 OMAP_MAKEREV(OMAP4460_DEV, 1, 1, 0) +#define OMAP4460_REV_UNKNOWN OMAP_MAKEREV(OMAP4460_DEV, 9, 9, 9) + +#define OMAP4470_DEV 0x4470 +#define OMAP4470_REV_ES1_0 OMAP_MAKEREV(OMAP4470_DEV, 1, 0, 0) +#define OMAP4470_REV_UNKNOWN OMAP_MAKEREV(OMAP4470_DEV, 9, 9, 9) + +#define OMAP_UNKNOWN_DEV OMAP_MAKEREV(0x9999, 9, 9, 9) + +#define AM335X_DEVREV(x) ((x) >> 28) + +#define CHIP_OMAP_3 0 +#define CHIP_OMAP_4 1 +#define CHIP_AM335X 2 static __inline int ti_chip(void) { From owner-svn-src-head@FreeBSD.ORG Mon Jan 7 23:41:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ADFC9F01; Mon, 7 Jan 2013 23:41:15 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9FA1ED66; Mon, 7 Jan 2013 23:41:15 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r07NfFFd029896; Mon, 7 Jan 2013 23:41:15 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r07NfFx9029895; Mon, 7 Jan 2013 23:41:15 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201301072341.r07NfFx9029895@svn.freebsd.org> From: Olivier Houchard Date: Mon, 7 Jan 2013 23:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245139 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Jan 2013 23:41:15 -0000 Author: cognet Date: Mon Jan 7 23:41:14 2013 New Revision: 245139 URL: http://svnweb.freebsd.org/changeset/base/245139 Log: Nuke ARM_WANT_TP_ADDRESS, it's not used anymore. Don't force -march=armv6 for Cortex A, as we want at least armv6k. The compiler default is good enough. Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Jan 7 23:35:40 2013 (r245138) +++ head/share/mk/bsd.cpu.mk Mon Jan 7 23:41:14 2013 (r245139) @@ -97,13 +97,13 @@ _CPUCFLAGS = -march=${CPUTYPE} . if ${CPUTYPE} == "xscale" #XXX: gcc doesn't seem to like -mcpu=xscale, and dies while rebuilding itself #_CPUCFLAGS = -mcpu=xscale -_CPUCFLAGS = -march=armv5te -D__XSCALE__ -DARM_WANT_TP_ADDRESS +_CPUCFLAGS = -march=armv5te -D__XSCALE__ . elif ${CPUTYPE} == "armv6" _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 . elif ${CPUTYPE} == "cortexa" -_CPUCFLAGS = -march=armv6 -DARM_ARCH_6=1 -mfpu=vfp +_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp . else -_CPUCFLAGS = -mcpu=${CPUTYPE} -DARM_WANT_TP_ADDRESS +_CPUCFLAGS = -mcpu=${CPUTYPE} . endif . elif ${MACHINE_ARCH} == "powerpc" . if ${CPUTYPE} == "e500" From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 02:38:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ABF20771; Tue, 8 Jan 2013 02:38:39 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 89BCC3E2; Tue, 8 Jan 2013 02:38:39 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r082cde3080047; Tue, 8 Jan 2013 02:38:39 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r082cdIr080046; Tue, 8 Jan 2013 02:38:39 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201301080238.r082cdIr080046@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 8 Jan 2013 02:38:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245146 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 02:38:39 -0000 Author: gonzo Date: Tue Jan 8 02:38:38 2013 New Revision: 245146 URL: http://svnweb.freebsd.org/changeset/base/245146 Log: Fix cache-related issue with pmap for ARMv6/ARMv7: - Missing PTE_SYNC in pmap_kremove caused memory corruption in userland applications - Fix lack of cache flushes when using special PTEs for zeroing or copying pages. If there are dirty lines for destination memory and page later remapped as a non-cached region actual content might be overwritten by these dirty lines when cache eviction happens as a result of applying cache eviction policy or because of wbinv_all call. - icache sync for new mapping for userland applications. Tested by: gber Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Tue Jan 8 02:02:19 2013 (r245145) +++ head/sys/arm/arm/pmap-v6.c Tue Jan 8 02:38:38 2013 (r245146) @@ -193,6 +193,14 @@ int pmap_debug_level = 0; #define PMAP_INLINE __inline #endif /* PMAP_DEBUG */ +#ifdef ARM_L2_PIPT +#define pmap_l2cache_wbinv_range(va, pa, size) cpu_l2cache_wbinv_range((pa), (size)) +#define pmap_l2cache_inv_range(va, pa, size) cpu_l2cache_inv_range((pa), (size)) +#else +#define pmap_l2cache_wbinv_range(va, pa, size) cpu_l2cache_wbinv_range((va), (size)) +#define pmap_l2cache_inv_range(va, pa, size) cpu_l2cache_inv_range((va), (size)) +#endif + extern struct pv_addr systempage; /* @@ -786,11 +794,7 @@ pmap_l2ptp_ctor(void *mem, int size, voi pte = *ptep; cpu_idcache_wbinv_range(va, PAGE_SIZE); -#ifdef ARM_L2_PIPT - cpu_l2cache_wbinv_range(pte & L2_S_FRAME, PAGE_SIZE); -#else - cpu_l2cache_wbinv_range(va, PAGE_SIZE); -#endif + pmap_l2cache_wbinv_range(va, pte & L2_S_FRAME, PAGE_SIZE); if ((pte & L2_S_CACHE_MASK) != pte_l2_s_cache_mode_pt) { /* * Page tables must have the cache-mode set to @@ -2121,6 +2125,7 @@ pmap_kremove(vm_offset_t va) cpu_tlb_flushD_SE(va); cpu_cpwait(); *pte = 0; + PTE_SYNC(pte); } } @@ -2387,11 +2392,7 @@ pmap_change_attr(vm_offset_t sva, vm_siz pte = *ptep &~ L2_S_CACHE_MASK; cpu_idcache_wbinv_range(tmpva, PAGE_SIZE); -#ifdef ARM_L2_PIPT - cpu_l2cache_wbinv_range(pte & L2_S_FRAME, PAGE_SIZE); -#else - cpu_l2cache_wbinv_range(tmpva, PAGE_SIZE); -#endif + pmap_l2cache_wbinv_range(tmpva, pte & L2_S_FRAME, PAGE_SIZE); *ptep = pte; cpu_tlb_flushID_SE(tmpva); @@ -2754,6 +2755,9 @@ do_l2b_alloc: else if (PV_BEEN_REFD(oflags)) cpu_tlb_flushD_SE(va); } + + if ((pmap != pmap_kernel()) && (pmap == &curproc->p_vmspace->vm_pmap)) + cpu_icache_sync_range(va, PAGE_SIZE); } /* @@ -3197,6 +3201,16 @@ pmap_zero_page_gen(vm_page_t pg, int off else bzero_page(cdstp); + /* + * Although aliasing is not possible if we use + * cdstp temporary mappings with memory that + * will be mapped later as non-cached or with write-through + * caches we might end up overwriting it when calling wbinv_all + * So make sure caches are clean after copy operation + */ + cpu_idcache_wbinv_range(cdstp, size); + pmap_l2cache_wbinv_range(cdstp, phys, size); + mtx_unlock(&cmtx); } @@ -3276,12 +3290,23 @@ pmap_copy_page_generic(vm_paddr_t src, v *cdst_pte = L2_S_PROTO | dst | pte_l2_s_cache_mode; pmap_set_prot(cdst_pte, VM_PROT_READ | VM_PROT_WRITE, 0); PTE_SYNC(cdst_pte); + cpu_tlb_flushD_SE(csrcp); cpu_tlb_flushD_SE(cdstp); cpu_cpwait(); + /* + * Although aliasing is not possible if we use + * cdstp temporary mappings with memory that + * will be mapped later as non-cached or with write-through + * caches we might end up overwriting it when calling wbinv_all + * So make sure caches are clean after copy operation + */ bcopy_page(csrcp, cdstp); + cpu_idcache_wbinv_range(cdstp, PAGE_SIZE); + pmap_l2cache_wbinv_range(cdstp, dst, PAGE_SIZE); + mtx_unlock(&cmtx); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 02:40:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 11CB6A73; Tue, 8 Jan 2013 02:40:21 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 046143FB; Tue, 8 Jan 2013 02:40:21 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r082eKqg080303; Tue, 8 Jan 2013 02:40:20 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r082eKVq080302; Tue, 8 Jan 2013 02:40:20 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201301080240.r082eKVq080302@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 8 Jan 2013 02:40:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245147 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 02:40:21 -0000 Author: gonzo Date: Tue Jan 8 02:40:20 2013 New Revision: 245147 URL: http://svnweb.freebsd.org/changeset/base/245147 Log: Switch default cache type for ARMv6/ARMv7 from write-through to writeback-writeallocate Modified: head/sys/arm/include/pmap.h Modified: head/sys/arm/include/pmap.h ============================================================================== --- head/sys/arm/include/pmap.h Tue Jan 8 02:38:38 2013 (r245146) +++ head/sys/arm/include/pmap.h Tue Jan 8 02:40:20 2013 (r245147) @@ -61,7 +61,7 @@ #else #define PTE_NOCACHE 1 #endif -#define PTE_CACHE 4 +#define PTE_CACHE 6 #define PTE_DEVICE 2 #define PTE_PAGETABLE 4 #else From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 03:00:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CFEC2EDC; Tue, 8 Jan 2013 03:00:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 45C156EE; Tue, 8 Jan 2013 03:00:33 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id r0830M6G028151; Tue, 8 Jan 2013 05:00:22 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r0830M6G028151 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id r0830Mpt028150; Tue, 8 Jan 2013 05:00:22 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 8 Jan 2013 05:00:22 +0200 From: Konstantin Belousov To: Oleksandr Tymoshenko Subject: Re: svn commit: r245147 - head/sys/arm/include Message-ID: <20130108030022.GC82219@kib.kiev.ua> References: <201301080240.r082eKVq080302@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+plSmdOTvOCX/8Oy" Content-Disposition: inline In-Reply-To: <201301080240.r082eKVq080302@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 03:00:33 -0000 --+plSmdOTvOCX/8Oy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 08, 2013 at 02:40:20AM +0000, Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Tue Jan 8 02:40:20 2013 > New Revision: 245147 > URL: http://svnweb.freebsd.org/changeset/base/245147 >=20 > Log: > Switch default cache type for ARMv6/ARMv7 from write-through to > writeback-writeallocate Could you, please, describe how this is supposed to work. Assume that a process mapped the same file page at two different addresses, both read-write, and writes to both mappings. Usermode code does not consider the need to flush caches or synchronize writes into non-overlapping regions, usually. Would it break, i.e. could the values appear in the page which were never written to it ? Another similar question, sf buffers on ARM flush the cache on sf_buf_free() (sometimes). If the page, for which the sf buffer is created, mapped into the userspace read-write, could it be that a value appears that was never written ? Note that sf buffers are used e.g. by uiomove_fromphys(). --+plSmdOTvOCX/8Oy Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ64vFAAoJEJDCuSvBvK1BfEwP/A4xXCfW82HgQHNeT5mxlRp6 /Gw2UD7T7c6+3/1cQUDN10hrlv52hVI8et30Q0S5/2rjB3YeQ/SROHwzXRNCtOgI JM/sAw3LS6ksXvMGzqsUK53676G/Oso4C+bYLUJELkIihhXxDvpscbI7O2s1VLBZ fMjSuiMpMhHypV2+Y48RP5EdsDXbVNkloMvifHEcBaN+HePK4qkQHZgnAyDoz3+E YC+FOdORExzSYUyuBYXEWLEMtNBkHKJhMaGIXaqzCnuyO2bvY5uW91MQu+rk/iCy DpC3cnIcFlnRX6WdZQoOHoVJDXl9jYaQynMZTDfbM9s1qTbUd5H+wjb+LXcw8C4Y j6ovmaL8CnEU/i7VcWlodwib/ZoCiBv5hjFILi3A08kfUKtiM8iijEyVe8YUALR2 AbkRRpM6Ce8Obu+T+/BXO9VX7UQC5ayyqmHSBE8NI4HlBjKAWguR+53WjmxDhbf7 R+Mquegi8zVEZ7/gnwdv1sleukheb3QfJAXE6WGWEfxEtSj7sqCC8UozBupIKRe7 zVUzkKpdcNCcvUi6hiYYGH2XUMzfa9cyY2yFIRAF9HCiHn2/zQC2wLQ1ZqcPwqur LHQwf02mbRz87k+P0V61FxkJhUrUFe6s36GlyeoPO4V6t5ImTzFOsGpI9p/VWKXL 4n+lb/EuD0RfkpdKnKyk =f1Yd -----END PGP SIGNATURE----- --+plSmdOTvOCX/8Oy-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 03:27:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 22470508; Tue, 8 Jan 2013 03:27:38 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04379837; Tue, 8 Jan 2013 03:27:38 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r083RbP9095054; Tue, 8 Jan 2013 03:27:37 GMT (envelope-from grehan@svn.freebsd.org) Received: (from grehan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r083Rb3N095050; Tue, 8 Jan 2013 03:27:37 GMT (envelope-from grehan@svn.freebsd.org) Message-Id: <201301080327.r083Rb3N095050@svn.freebsd.org> From: Peter Grehan Date: Tue, 8 Jan 2013 03:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245148 - in head/sys/boot: common userboot/userboot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 03:27:38 -0000 Author: grehan Date: Tue Jan 8 03:27:37 2013 New Revision: 245148 URL: http://svnweb.freebsd.org/changeset/base/245148 Log: Bring in some userboot changes from the bhyve branch to reduce diffs. r238966 Bump up the heap size to 1MB. With a few kernel modules, libstand zalloc and userboot seem to want to use ~600KB of heap space, which results in a segfault when malloc fails in bhyveload. r241180 Clarify comment about default number of FICL dictionary cells. r241153 Allow the number of FICL dictionary cells to be overridden. Loading a 7.3 ISO with userboot/amd64 takes up 10035 cells, overflowing the long-standing default of 10000. Bump userboot's value up to 15000 cells. Reviewed by: dteske (r238966,241180) Obtained from: NetApp Modified: head/sys/boot/common/interp_forth.c head/sys/boot/userboot/userboot/Makefile head/sys/boot/userboot/userboot/main.c Modified: head/sys/boot/common/interp_forth.c ============================================================================== --- head/sys/boot/common/interp_forth.c Tue Jan 8 02:40:20 2013 (r245147) +++ head/sys/boot/common/interp_forth.c Tue Jan 8 03:27:37 2013 (r245148) @@ -51,6 +51,13 @@ extern char bootprog_rev[]; #define BF_PARSE 100 /* + * FreeBSD loader default dictionary cells + */ +#ifndef BF_DICTSIZE +#define BF_DICTSIZE 10000 +#endif + +/* * BootForth Interface to Ficl Forth interpreter. */ @@ -239,8 +246,8 @@ bf_init(void) struct bootblk_command **cmdp; char create_buf[41]; /* 31 characters-long builtins */ int fd; - - bf_sys = ficlInitSystem(10000); /* Default dictionary ~4000 cells */ + + bf_sys = ficlInitSystem(BF_DICTSIZE); bf_vm = ficlNewVM(bf_sys); /* Put all private definitions in a "builtins" vocabulary */ Modified: head/sys/boot/userboot/userboot/Makefile ============================================================================== --- head/sys/boot/userboot/userboot/Makefile Tue Jan 8 02:40:20 2013 (r245147) +++ head/sys/boot/userboot/userboot/Makefile Tue Jan 8 03:27:37 2013 (r245148) @@ -45,6 +45,7 @@ CLEANFILES= vers.c .if ${MK_FORTH} != "no" BOOT_FORTH= yes CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 +CFLAGS+= -DBF_DICTSIZE=15000 LIBFICL= ${.OBJDIR}/../ficl/libficl.a LIBSTAND= ${.OBJDIR}/../libstand/libstand.a .endif Modified: head/sys/boot/userboot/userboot/main.c ============================================================================== --- head/sys/boot/userboot/userboot/main.c Tue Jan 8 02:40:20 2013 (r245147) +++ head/sys/boot/userboot/userboot/main.c Tue Jan 8 03:27:37 2013 (r245148) @@ -69,7 +69,7 @@ exit(int v) void loader_main(struct loader_callbacks *cb, void *arg, int version, int ndisks) { - static char malloc[512*1024]; + static char malloc[1024*1024]; const char *var; int i; @@ -85,7 +85,7 @@ loader_main(struct loader_callbacks *cb, * alloc() is usable. The stack is buried inside us, so this is * safe. */ - setheap((void *)malloc, (void *)(malloc + 512*1024)); + setheap((void *)malloc, (void *)(malloc + 1024*1024)); /* * Hook up the console From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 05:06:27 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 899B1DC; Tue, 8 Jan 2013 05:06:27 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id 25EAAA66; Tue, 8 Jan 2013 05:06:26 +0000 (UTC) Received: from [88.198.91.248] (helo=[IPv6:::1]) by id.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1TsROC-0004oB-Ry; Mon, 07 Jan 2013 21:06:18 -0800 Message-ID: <50EBA947.1030902@freebsd.org> Date: Mon, 07 Jan 2013 21:06:15 -0800 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r245147 - head/sys/arm/include References: <201301080240.r082eKVq080302@svn.freebsd.org> <20130108030022.GC82219@kib.kiev.ua> In-Reply-To: <20130108030022.GC82219@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 1/7/2013 7:00 PM, Konstantin Belousov wrote: > On Tue, Jan 08, 2013 at 02:40:20AM +0000, Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Tue Jan 8 02:40:20 2013 >> New Revision: 245147 >> URL: http://svnweb.freebsd.org/changeset/base/245147 >> >> Log: >> Switch default cache type for ARMv6/ARMv7 from write-through to >> writeback-writeallocate > Could you, please, describe how this is supposed to work. > > Assume that a process mapped the same file page at two different > addresses, both read-write, and writes to both mappings. Usermode code > does not consider the need to flush caches or synchronize writes into > non-overlapping regions, usually. Would it break, i.e. could the values > appear in the page which were never written to it ? [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 05:06:27 -0000 On 1/7/2013 7:00 PM, Konstantin Belousov wrote: > On Tue, Jan 08, 2013 at 02:40:20AM +0000, Oleksandr Tymoshenko wrote: >> Author: gonzo >> Date: Tue Jan 8 02:40:20 2013 >> New Revision: 245147 >> URL: http://svnweb.freebsd.org/changeset/base/245147 >> >> Log: >> Switch default cache type for ARMv6/ARMv7 from write-through to >> writeback-writeallocate > Could you, please, describe how this is supposed to work. > > Assume that a process mapped the same file page at two different > addresses, both read-write, and writes to both mappings. Usermode code > does not consider the need to flush caches or synchronize writes into > non-overlapping regions, usually. Would it break, i.e. could the values > appear in the page which were never written to it ? I might misunderstood question so let me rephrase it: One physical page P, virtual addresses A and B both mapped to it. Two conditions should be true: - if I write word to A+0x200 same value should appear at B+0x200 next time it is read - If there are no writes to P either through A or B each next read should yield same result. These conditions are met for ARMv7 devices for both WT and WBWA caches. They're PIPT so no aliasing in this case. Up until now I believed that "no aliasing" is true for all ARM CPUs we target but quick check proved me wrong: ARM1176 on which Raspberry Pi is based is prone to cache aliasing problem. Which might explain memory corruption easily reproducible under load. Again the problem is not related to cache type itself but to the lack of handling of this situation in pmap module. Some info on subject: http://blogs.arm.com/software-enablement/716-page-colouring-on-armv6-and-a-bit-on-armv7/ Thank you for raising this topic. I hope people more ARM-savvy then me can confirm or refute my point of view. > > Another similar question, sf buffers on ARM flush the cache on sf_buf_free() > (sometimes). If the page, for which the sf buffer is created, mapped into > the userspace read-write, could it be that a value appears that was never > written ? Note that sf buffers are used e.g. by uiomove_fromphys(). I believe the stuff above is applicable to this question too. From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 06:59:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 584E7E1E; Tue, 8 Jan 2013 06:59:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 35845E39; Tue, 8 Jan 2013 06:59:22 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r086xMmU057389; Tue, 8 Jan 2013 06:59:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r086xMgY057388; Tue, 8 Jan 2013 06:59:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301080659.r086xMgY057388@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Jan 2013 06:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245156 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 06:59:22 -0000 Author: adrian Date: Tue Jan 8 06:59:21 2013 New Revision: 245156 URL: http://svnweb.freebsd.org/changeset/base/245156 Log: Add in the missing radiotap definitions from the sipsolutions.net radiotap "upstream" source. Modified: head/sys/net80211/ieee80211_radiotap.h Modified: head/sys/net80211/ieee80211_radiotap.h ============================================================================== --- head/sys/net80211/ieee80211_radiotap.h Tue Jan 8 06:00:32 2013 (r245155) +++ head/sys/net80211/ieee80211_radiotap.h Tue Jan 8 06:59:21 2013 (r245156) @@ -194,9 +194,20 @@ enum ieee80211_radiotap_type { IEEE80211_RADIOTAP_ANTENNA = 11, IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, IEEE80211_RADIOTAP_DB_ANTNOISE = 13, - /* NB: gap for netbsd definitions */ + /* + * 14-17 are from Linux, they overlap the netbsd-specific + * fields. + */ + IEEE80211_RADIOTAP_RX_FLAGS = 14, + IEEE80211_RADIOTAP_TX_FLAGS = 15, + IEEE80211_RADIOTAP_RTS_RETRIES = 16, + IEEE80211_RADIOTAP_DATA_RETRIES = 17, + IEEE80211_RADIOTAP_XCHANNEL = 18, IEEE80211_RADIOTAP_MCS = 19, + IEEE80211_RADIOTAP_AMPDU_STATUS = 20, + + IEEE80211_RADIOTAP_RADIOTAP_NAMESPACE = 29, IEEE80211_RADIOTAP_VENDOREXT = 30, IEEE80211_RADIOTAP_EXT = 31, }; From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 12:21:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0FEB7D01; Tue, 8 Jan 2013 12:21:51 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE287DD7; Tue, 8 Jan 2013 12:21:50 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08CLoDW055427; Tue, 8 Jan 2013 12:21:50 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08CLoSj055426; Tue, 8 Jan 2013 12:21:50 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201301081221.r08CLoSj055426@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 8 Jan 2013 12:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245164 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 12:21:51 -0000 Author: bapt Date: Tue Jan 8 12:21:50 2013 New Revision: 245164 URL: http://svnweb.freebsd.org/changeset/base/245164 Log: Add support for IO_APPEND flag in fuse This make open(..., O_APPEND) actually works on fuse filesystem. Reviewed by: attilio Modified: head/sys/fs/fuse/fuse_io.c Modified: head/sys/fs/fuse/fuse_io.c ============================================================================== --- head/sys/fs/fuse/fuse_io.c Tue Jan 8 09:05:09 2013 (r245163) +++ head/sys/fs/fuse/fuse_io.c Tue Jan 8 12:21:50 2013 (r245164) @@ -113,7 +113,7 @@ fuse_write_directbackend(struct vnode *v struct ucred *cred, struct fuse_filehandle *fufh); static int fuse_write_biobackend(struct vnode *vp, struct uio *uio, - struct ucred *cred, struct fuse_filehandle *fufh); + struct ucred *cred, struct fuse_filehandle *fufh, int ioflag); int fuse_io_dispatch(struct vnode *vp, struct uio *uio, int ioflag, @@ -162,7 +162,7 @@ fuse_io_dispatch(struct vnode *vp, struc } else { FS_DEBUG("buffered write of vnode %ju\n", (uintmax_t)VTOILLU(vp)); - err = fuse_write_biobackend(vp, uio, cred, fufh); + err = fuse_write_biobackend(vp, uio, cred, fufh, ioflag); } break; default: @@ -371,7 +371,7 @@ fuse_write_directbackend(struct vnode *v static int fuse_write_biobackend(struct vnode *vp, struct uio *uio, - struct ucred *cred, struct fuse_filehandle *fufh) + struct ucred *cred, struct fuse_filehandle *fufh, int ioflag) { struct fuse_vnode_data *fvdat = VTOFUD(vp); struct buf *bp; @@ -390,6 +390,8 @@ fuse_write_biobackend(struct vnode *vp, return (EINVAL); if (uio->uio_resid == 0) return (0); + if (ioflag & IO_APPEND) + uio_setoffset(uio, fvdat->filesize); /* * Find all of this file's B_NEEDCOMMIT buffers. If our writes From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 15:56:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4B72259C; Tue, 8 Jan 2013 15:56:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 978239DE; Tue, 8 Jan 2013 15:56:54 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id r08FufSL002786; Tue, 8 Jan 2013 17:56:41 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r08FufSL002786 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id r08Fuf3A002785; Tue, 8 Jan 2013 17:56:41 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 8 Jan 2013 17:56:41 +0200 From: Konstantin Belousov To: Oleksandr Tymoshenko Subject: Re: svn commit: r245147 - head/sys/arm/include Message-ID: <20130108155641.GG82219@kib.kiev.ua> References: <201301080240.r082eKVq080302@svn.freebsd.org> <20130108030022.GC82219@kib.kiev.ua> <50EBA947.1030902@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="26XRljEL7Ier68ao" Content-Disposition: inline In-Reply-To: <50EBA947.1030902@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 15:56:55 -0000 --26XRljEL7Ier68ao Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 07, 2013 at 09:06:15PM -0800, Oleksandr Tymoshenko wrote: > On 1/7/2013 7:00 PM, Konstantin Belousov wrote: > > On Tue, Jan 08, 2013 at 02:40:20AM +0000, Oleksandr Tymoshenko wrote: > >> Author: gonzo > >> Date: Tue Jan 8 02:40:20 2013 > >> New Revision: 245147 > >> URL: http://svnweb.freebsd.org/changeset/base/245147 > >> > >> Log: > >> Switch default cache type for ARMv6/ARMv7 from write-through to > >> writeback-writeallocate > > Could you, please, describe how this is supposed to work. > > > > Assume that a process mapped the same file page at two different > > addresses, both read-write, and writes to both mappings. Usermode code > > does not consider the need to flush caches or synchronize writes into > > non-overlapping regions, usually. Would it break, i.e. could the values > > appear in the page which were never written to it ? >=20 > I might misunderstood question so let me rephrase it: > One physical page P, virtual addresses A and B both mapped to it. Two=20 > conditions should > be true: >=20 > - if I write word to A+0x200 same value should appear at B+0x200 next= =20 > time it is read > - If there are no writes to P either through A or B each next read=20 > should yield same result. I am more concerned with the following: assume that current content in the page is 0x200:u, 0x201:v, and a byte x was written at A+0x200, byte y at B+0x201. Is it possible that future read of the bytes at A+0x200, A+0x201 (on the same core) returns (x, v) ? >=20 > These conditions are met for ARMv7 devices for both WT and WBWA caches.= =20 > They're PIPT > so no aliasing in this case. Up until now I believed that "no aliasing"= =20 > is true for all ARM CPUs > we target but quick check proved me wrong: ARM1176 on which Raspberry Pi > is based is prone to cache aliasing problem. Which might explain memory= =20 > corruption > easily reproducible under load. Again the problem is not related to=20 > cache type itself but > to the lack of handling of this situation in pmap module. I am trying to find a way through the ARM ARM and some additional texts. Could it be that cache aliasing is only limited to the I-cache on ARM, at least for recent cores ? My concern is hopefully not valid than. Hm, it seems, according to the link below, that ARMv6 is affected. >=20 > Some info on subject: > http://blogs.arm.com/software-enablement/716-page-colouring-on-armv6-and-= a-bit-on-armv7/ This seems to support the idea that mmap does not work on ARM, at least for ARMv6. It seems that sf buffers do not obey the arch requirements for aliasing as well. Thank you for the link. >=20 > Thank you for raising this topic. I hope people more ARM-savvy then me= =20 > can confirm or refute > my point of view. >=20 > > > > Another similar question, sf buffers on ARM flush the cache on sf_buf_f= ree() > > (sometimes). If the page, for which the sf buffer is created, mapped in= to > > the userspace read-write, could it be that a value appears that was nev= er > > written ? Note that sf buffers are used e.g. by uiomove_fromphys(). > I believe the stuff above is applicable to this question too. --26XRljEL7Ier68ao Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ7EG4AAoJEJDCuSvBvK1BxroP/REtvf7+RNuafkf6qYTfP/yV zngWz3OasRTmBmuPY9tgJMdt2LpQ9amCBIPELe3Tr2NHFxXmwCtDL6LG/gAHC9Wl eAQDqlOYYexhZ221NWHQYNcv7fRh80YRzXxQeCLefRgYPpNoZ7uhJaXm1ZAUxSC+ 2Ubs6TWsPqnXjr53TqaLJFZobAZXy5D18sK2EddyRMtE3YFfkFwCz7SD/qUIeBZ8 qT/Sv4DyaDouF/MgdZLAEtTs9o4XnzpueBsGnEfAG6csSeSTk8seCq1cAQUdVLac VbxWGANaLq4qnHvzdS+z7Tdtl/CxDpbeuthw0W1H4wu29ATsyIWC2JCxfw1/g0cO H7M9XN1K+ziFMkdI1CUfVoEGT+CakWDYVvvlI2vc09Ydh87qnxFNGf9N+fOHyRNX F/MZerIHWUpqLyYQNppgmvhMhXTYxd4PPmM8Ci7iLfAA66owCIBXIJ7eabk2JFVb dEFpbXrZh6AtTvUdrDysk+kE+EFpqtDW0dHIfIk09RoIf2jCgoW5AZ/SrL0QQR3I N/FUqcPTLidKervOAgZzsx2zefFYUNzt7YZF+SA9Z8olS9E4QBsqeaF4ID85AuyP RAKQtPhnIy2WAUWdrl30ICKacsY++IlG3VmTcfE9Vkkpen62iD2KLCVYnmfLAERw TTuaTtF2OceuycM+cCCz =yDzv -----END PGP SIGNATURE----- --26XRljEL7Ier68ao-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 16:31:26 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7FA9A23C; Tue, 8 Jan 2013 16:31:26 +0000 (UTC) (envelope-from gonzo@id.bluezbox.com) Received: from id.bluezbox.com (id.bluezbox.com [88.198.91.248]) by mx1.freebsd.org (Postfix) with ESMTP id 23C62B55; Tue, 8 Jan 2013 16:31:25 +0000 (UTC) Received: from [207.6.254.8] (helo=[192.168.1.67]) by id.bluezbox.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Tsc5C-000D1m-8t; Tue, 08 Jan 2013 08:31:24 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r245147 - head/sys/arm/include From: Oleksandr Tymoshenko In-Reply-To: <20130108155641.GG82219@kib.kiev.ua> Date: Tue, 8 Jan 2013 08:28:40 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201301080240.r082eKVq080302@svn.freebsd.org> <20130108030022.GC82219@kib.kiev.ua> <50EBA947.1030902@freebsd.org> <20130108155641.GG82219@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1499) Sender: gonzo@id.bluezbox.com X-Spam-Level: -- X-Spam-Report: Spam detection software, running on the system "id.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 2013-01-08, at 7:56 AM, Konstantin Belousov wrote: > On Mon, Jan 07, 2013 at 09:06:15PM -0800, Oleksandr Tymoshenko wrote: >> On 1/7/2013 7:00 PM, Konstantin Belousov wrote: >>> On Tue, Jan 08, 2013 at 02:40:20AM +0000, Oleksandr Tymoshenko wrote: >>>> Author: gonzo >>>> Date: Tue Jan 8 02:40:20 2013 >>>> New Revision: 245147 >>>> URL: http://svnweb.freebsd.org/changeset/base/245147 >>>> >>>> Log: >>>> Switch default cache type for ARMv6/ARMv7 from write-through to >>>> writeback-writeallocate >>> Could you, please, describe how this is supposed to work. >>> >>> Assume that a process mapped the same file page at two different >>> addresses, both read-write, and writes to both mappings. Usermode code >>> does not consider the need to flush caches or synchronize writes into >>> non-overlapping regions, usually. Would it break, i.e. could the values >>> appear in the page which were never written to it ? >> >> I might misunderstood question so let me rephrase it: >> One physical page P, virtual addresses A and B both mapped to it. Two >> conditions should >> be true: >> >> - if I write word to A+0x200 same value should appear at B+0x200 next >> time it is read >> - If there are no writes to P either through A or B each next read >> should yield same result. > I am more concerned with the following: > assume that current content in the page is 0x200:u, 0x201:v, and a byte > x was written at A+0x200, byte y at B+0x201. Is it possible that > future read of the bytes at A+0x200, A+0x201 (on the same core) > returns (x, v) ? On ARMv7 - no, it's not possible. On ARMv6 - it seems to be possible from what I gather. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 16:31:26 -0000 On 2013-01-08, at 7:56 AM, Konstantin Belousov = wrote: > On Mon, Jan 07, 2013 at 09:06:15PM -0800, Oleksandr Tymoshenko wrote: >> On 1/7/2013 7:00 PM, Konstantin Belousov wrote: >>> On Tue, Jan 08, 2013 at 02:40:20AM +0000, Oleksandr Tymoshenko = wrote: >>>> Author: gonzo >>>> Date: Tue Jan 8 02:40:20 2013 >>>> New Revision: 245147 >>>> URL: http://svnweb.freebsd.org/changeset/base/245147 >>>>=20 >>>> Log: >>>> Switch default cache type for ARMv6/ARMv7 from write-through to >>>> writeback-writeallocate >>> Could you, please, describe how this is supposed to work. >>>=20 >>> Assume that a process mapped the same file page at two different >>> addresses, both read-write, and writes to both mappings. Usermode = code >>> does not consider the need to flush caches or synchronize writes = into >>> non-overlapping regions, usually. Would it break, i.e. could the = values >>> appear in the page which were never written to it ? >>=20 >> I might misunderstood question so let me rephrase it: >> One physical page P, virtual addresses A and B both mapped to it. Two=20= >> conditions should >> be true: >>=20 >> - if I write word to A+0x200 same value should appear at B+0x200 = next=20 >> time it is read >> - If there are no writes to P either through A or B each next read=20 >> should yield same result. > I am more concerned with the following: > assume that current content in the page is 0x200:u, 0x201:v, and a = byte > x was written at A+0x200, byte y at B+0x201. Is it possible that > future read of the bytes at A+0x200, A+0x201 (on the same core) > returns (x, v) ? On ARMv7 - no, it's not possible. On ARMv6 - it seems to be possible=20= from what I gather.=20 >>=20 >> These conditions are met for ARMv7 devices for both WT and WBWA = caches.=20 >> They're PIPT >> so no aliasing in this case. Up until now I believed that "no = aliasing"=20 >> is true for all ARM CPUs >> we target but quick check proved me wrong: ARM1176 on which Raspberry = Pi >> is based is prone to cache aliasing problem. Which might explain = memory=20 >> corruption >> easily reproducible under load. Again the problem is not related to=20= >> cache type itself but >> to the lack of handling of this situation in pmap module. > I am trying to find a way through the ARM ARM and some additional = texts. > Could it be that cache aliasing is only limited to the I-cache on ARM, > at least for recent cores ? My concern is hopefully not valid than. >=20 > Hm, it seems, according to the link below, that ARMv6 is affected. >=20 >>=20 >> Some info on subject: >> = http://blogs.arm.com/software-enablement/716-page-colouring-on-armv6-and-a= -bit-on-armv7/ >=20 > This seems to support the idea that mmap does not work on ARM, at = least > for ARMv6. It seems that sf buffers do not obey the arch requirements > for aliasing as well. >=20 > Thank you for the link. From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 17:01:22 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 77918E7A; Tue, 8 Jan 2013 17:01:22 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 480A0D79; Tue, 8 Jan 2013 17:01:21 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id r08H1FZQ028033; Tue, 8 Jan 2013 10:01:15 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r08H1BRN095165; Tue, 8 Jan 2013 10:01:11 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r245147 - head/sys/arm/include From: Ian Lepore To: Konstantin Belousov In-Reply-To: <20130108155641.GG82219@kib.kiev.ua> References: <201301080240.r082eKVq080302@svn.freebsd.org> <20130108030022.GC82219@kib.kiev.ua> <50EBA947.1030902@freebsd.org> <20130108155641.GG82219@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" Date: Tue, 08 Jan 2013 10:01:11 -0700 Message-ID: <1357664471.1088.131.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Oleksandr Tymoshenko , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 17:01:22 -0000 On Tue, 2013-01-08 at 17:56 +0200, Konstantin Belousov wrote: > On Mon, Jan 07, 2013 at 09:06:15PM -0800, Oleksandr Tymoshenko wrote: > > On 1/7/2013 7:00 PM, Konstantin Belousov wrote: > > > On Tue, Jan 08, 2013 at 02:40:20AM +0000, Oleksandr Tymoshenko wrote: > > >> Author: gonzo > > >> Date: Tue Jan 8 02:40:20 2013 > > >> New Revision: 245147 > > >> URL: http://svnweb.freebsd.org/changeset/base/245147 > > >> > > >> Log: > > >> Switch default cache type for ARMv6/ARMv7 from write-through to > > >> writeback-writeallocate > > > Could you, please, describe how this is supposed to work. > > > > > > Assume that a process mapped the same file page at two different > > > addresses, both read-write, and writes to both mappings. Usermode code > > > does not consider the need to flush caches or synchronize writes into > > > non-overlapping regions, usually. Would it break, i.e. could the values > > > appear in the page which were never written to it ? > > > > I might misunderstood question so let me rephrase it: > > One physical page P, virtual addresses A and B both mapped to it. Two > > conditions should > > be true: > > > > - if I write word to A+0x200 same value should appear at B+0x200 next > > time it is read > > - If there are no writes to P either through A or B each next read > > should yield same result. > I am more concerned with the following: > assume that current content in the page is 0x200:u, 0x201:v, and a byte > x was written at A+0x200, byte y at B+0x201. Is it possible that > future read of the bytes at A+0x200, A+0x201 (on the same core) > returns (x, v) ? > > > > > These conditions are met for ARMv7 devices for both WT and WBWA caches. > > They're PIPT > > so no aliasing in this case. Up until now I believed that "no aliasing" > > is true for all ARM CPUs > > we target but quick check proved me wrong: ARM1176 on which Raspberry Pi > > is based is prone to cache aliasing problem. Which might explain memory > > corruption > > easily reproducible under load. Again the problem is not related to > > cache type itself but > > to the lack of handling of this situation in pmap module. > I am trying to find a way through the ARM ARM and some additional texts. > Could it be that cache aliasing is only limited to the I-cache on ARM, > at least for recent cores ? My concern is hopefully not valid than. > > Hm, it seems, according to the link below, that ARMv6 is affected. > > > > > Some info on subject: > > http://blogs.arm.com/software-enablement/716-page-colouring-on-armv6-and-a-bit-on-armv7/ > > This seems to support the idea that mmap does not work on ARM, at least > for ARMv6. It seems that sf buffers do not obey the arch requirements > for aliasing as well. > > Thank you for the link. > > > > > Thank you for raising this topic. I hope people more ARM-savvy then me > > can confirm or refute > > my point of view. > > > > > > > > Another similar question, sf buffers on ARM flush the cache on sf_buf_free() > > > (sometimes). If the page, for which the sf buffer is created, mapped into > > > the userspace read-write, could it be that a value appears that was never > > > written ? Note that sf buffers are used e.g. by uiomove_fromphys(). > > I believe the stuff above is applicable to this question too. I'm just learning the armv6/v7 stuff myself right now, but I can answer your question for our current armv4/v5 implementation... When there is more than one mapping of a page in v4/v5 and any one of those mappings is writable, then the pmap.c code changes all existing mappings to be uncacheable to maintain coherency. If the writable mapping is removed and all that remains are read/exec mappings, the existing mappings are made cacheable again. Yes, that's just as inefficient and expensive as it sounds. :) -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 17:21:44 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DDD536DF; Tue, 8 Jan 2013 17:21:44 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 555BCE50; Tue, 8 Jan 2013 17:21:44 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r08HLZfQ023555; Tue, 8 Jan 2013 19:21:35 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r08HLZfQ023555 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r08HLZlh023554; Tue, 8 Jan 2013 19:21:35 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 8 Jan 2013 19:21:35 +0200 From: Konstantin Belousov To: Ian Lepore Subject: Re: svn commit: r245147 - head/sys/arm/include Message-ID: <20130108172135.GA2561@kib.kiev.ua> References: <201301080240.r082eKVq080302@svn.freebsd.org> <20130108030022.GC82219@kib.kiev.ua> <50EBA947.1030902@freebsd.org> <20130108155641.GG82219@kib.kiev.ua> <1357664471.1088.131.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: <1357664471.1088.131.camel@revolution.hippie.lan> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@FreeBSD.org, Oleksandr Tymoshenko , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 17:21:44 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 08, 2013 at 10:01:11AM -0700, Ian Lepore wrote: > I'm just learning the armv6/v7 stuff myself right now, but I can answer > your question for our current armv4/v5 implementation... >=20 > When there is more than one mapping of a page in v4/v5 and any one of > those mappings is writable, then the pmap.c code changes all existing > mappings to be uncacheable to maintain coherency. If the writable > mapping is removed and all that remains are read/exec mappings, the > existing mappings are made cacheable again. Yes, that's just as > inefficient and expensive as it sounds. :) Interesting, so the arm/pmap.c in fact maintain pv entries even for the unmanaged pages and kernel mappings ? But this approach, requiring pv entries for the kernel mappings, makes kernel pv entries non-reclamable on the low memory condition. In fact, I cannot find any traces of the pv reclaim in the arm/pmap.c. --uAKRQypu60I7Lcqm Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ7FWeAAoJEJDCuSvBvK1B2QIP/RjN9Fome0N2bCdPF1iPpHdo 61hXwZuKgOf24W8EVKf19vJxd9OXrLiCBN/gAqx5fXStF2u3F8wjHN2Kfjsqh030 44ar2ccg2wuQ2rK1fHU9/rBryC2J4L9XyY6GReDW92T84QOevyDm9oY8k3nNW12t AVB3sqde6jdNvpYp9wzR8k6FRDUX3nRT9rsaEBO10YxIzDJvRiJuZoAGTidkIxeg Me2geRSGYJnq82Ot8ev8kRVsqOSAGWqSf+04jRoPx0etHa42gcWBdFEAfjogiZHp xRvyf0wnLlke+3rAllJRQWBTRv9KgPwkjVFdaID5JaS6XcgvHkd3Er2arUv2qpdI rZRk2Pbgo2N36r+dFY5WtY+p8sB193WwhZy5dPpzE6NDkVSF+dkhCMrNzsdmorpS 8K/dETIkTiMe3enGuHZLophS0wlUXBEJqoRX09lHzZpxtqpFn8JvMCxNn1bKfp+W gxbEOdSz12jgXzd7idUv4tsR5z24afjVv7QZZpp9JvBccNP037Qa7tQ36a7ZpO6L tKjcAHQ6zKDRWF78QUVOwb4c/v4xRjrfRFd1+DTbyj3LdzzyBrtyhh67mNku+yhb glbVuXuLHmmK6h9Hf1gI05oBCr7rti+22Siuq5nJlVB7EhOBdEMBVnfsEeiGqfx9 PYPp+8UGHC2avldRqV7u =4a0+ -----END PGP SIGNATURE----- --uAKRQypu60I7Lcqm-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 17:24:44 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 501D1A50; Tue, 8 Jan 2013 17:24:44 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4414EE89; Tue, 8 Jan 2013 17:24:44 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08HOiCP042920; Tue, 8 Jan 2013 17:24:44 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08HOi6L042919; Tue, 8 Jan 2013 17:24:44 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201301081724.r08HOi6L042919@svn.freebsd.org> From: Hiroki Sato Date: Tue, 8 Jan 2013 17:24:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245168 - head/sbin/route X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 17:24:44 -0000 Author: hrs Date: Tue Jan 8 17:24:43 2013 New Revision: 245168 URL: http://svnweb.freebsd.org/changeset/base/245168 Log: Fix -iface and -interface modifiers. Spotted by: Ian FREISLICH Modified: head/sbin/route/route.c Modified: head/sbin/route/route.c ============================================================================== --- head/sbin/route/route.c Tue Jan 8 17:01:32 2013 (r245167) +++ head/sbin/route/route.c Tue Jan 8 17:24:43 2013 (r245168) @@ -94,7 +94,7 @@ typedef union sockunion *sup; int pid, rtm_addrs; int s; int forcehost, forcenet, doflush, nflag, af, qflag, tflag; -int iflag, verbose, aflen = sizeof (struct sockaddr_in); +int verbose, aflen = sizeof (struct sockaddr_in); int locking, lockrest, debugonly; struct rt_metrics rt_metrics; u_long rtm_inits; @@ -107,7 +107,7 @@ static char *atalk_ntoa(struct at_addr); static void bprintf(FILE *, int, u_char *); static void flushroutes(int argc, char *argv[]); static int flushroutes_fib(int); -static int getaddr(int, char *, struct hostent **); +static int getaddr(int, char *, struct hostent **, int); static int keyword(const char *); static void inet_makenetandmask(u_long, struct sockaddr_in *, u_long); #ifdef INET6 @@ -833,34 +833,34 @@ newroute(int argc, char **argv) case K_IFA: if (!--argc) usage(NULL); - (void) getaddr(RTA_IFA, *++argv, 0); + getaddr(RTA_IFA, *++argv, 0, nrflags); break; case K_IFP: if (!--argc) usage(NULL); - (void) getaddr(RTA_IFP, *++argv, 0); + getaddr(RTA_IFP, *++argv, 0, nrflags); break; case K_GENMASK: if (!--argc) usage(NULL); - (void) getaddr(RTA_GENMASK, *++argv, 0); + getaddr(RTA_GENMASK, *++argv, 0, nrflags); break; case K_GATEWAY: if (!--argc) usage(NULL); - (void) getaddr(RTA_GATEWAY, *++argv, 0); + getaddr(RTA_GATEWAY, *++argv, 0, nrflags); break; case K_DST: if (!--argc) usage(NULL); - if (getaddr(RTA_DST, *++argv, &hp)) + if (getaddr(RTA_DST, *++argv, &hp, nrflags)) nrflags |= F_ISHOST; dest = *argv; break; case K_NETMASK: if (!--argc) usage(NULL); - (void) getaddr(RTA_NETMASK, *++argv, 0); + getaddr(RTA_NETMASK, *++argv, 0, nrflags); /* FALLTHROUGH */ case K_NET: nrflags |= F_FORCENET; @@ -895,13 +895,13 @@ newroute(int argc, char **argv) } else { if ((rtm_addrs & RTA_DST) == 0) { dest = *argv; - if (getaddr(RTA_DST, *argv, &hp)) + if (getaddr(RTA_DST, *argv, &hp, nrflags)) nrflags |= F_ISHOST; } else if ((rtm_addrs & RTA_GATEWAY) == 0) { gateway = *argv; - (void) getaddr(RTA_GATEWAY, *argv, &hp); + getaddr(RTA_GATEWAY, *argv, &hp, nrflags); } else { - (void) getaddr(RTA_NETMASK, *argv, 0); + getaddr(RTA_NETMASK, *argv, 0, nrflags); nrflags |= F_FORCENET; } } @@ -1116,7 +1116,7 @@ inet6_makenetandmask(struct sockaddr_in6 * returning 1 if a host address, 0 if a network address. */ static int -getaddr(int which, char *str, struct hostent **hpp) +getaddr(int which, char *str, struct hostent **hpp, int nrflags) { sup su; struct hostent *hp; @@ -1137,7 +1137,7 @@ getaddr(int which, char *str, struct hos break; case RTA_GATEWAY: su = &so_gate; - if (iflag) { + if (nrflags & F_INTERFACE) { struct ifaddrs *ifap, *ifa; struct sockaddr_dl *sdl = NULL; @@ -1197,7 +1197,7 @@ getaddr(int which, char *str, struct hos #if 0 bzero(su, sizeof(*su)); /* for readability */ #endif - getaddr(RTA_NETMASK, str, 0); + getaddr(RTA_NETMASK, str, 0, nrflags); break; #if 0 case RTA_NETMASK: From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 17:40:57 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CAC2516E; Tue, 8 Jan 2013 17:40:57 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by mx1.freebsd.org (Postfix) with ESMTP id A6280F53; Tue, 8 Jan 2013 17:40:57 +0000 (UTC) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 5133F4601B7; Tue, 8 Jan 2013 11:35:27 -0600 (CST) Received: from mh1.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh1.mail.rice.edu (Postfix) with ESMTP id 4F6CA4601FA; Tue, 8 Jan 2013 11:35:27 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from mh1.mail.rice.edu ([127.0.0.1]) by mh1.mail.rice.edu (mh1.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id rlPTR0Tj4pGB; Tue, 8 Jan 2013 11:35:27 -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 mh1.mail.rice.edu (Postfix) with ESMTPSA id B38A74601F2; Tue, 8 Jan 2013 11:35:26 -0600 (CST) Message-ID: <50EC58DE.2050402@rice.edu> Date: Tue, 08 Jan 2013 11:35:26 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r245147 - head/sys/arm/include References: <201301080240.r082eKVq080302@svn.freebsd.org> <20130108030022.GC82219@kib.kiev.ua> <50EBA947.1030902@freebsd.org> <20130108155641.GG82219@kib.kiev.ua> <1357664471.1088.131.camel@revolution.hippie.lan> <20130108172135.GA2561@kib.kiev.ua> In-Reply-To: <20130108172135.GA2561@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Ian Lepore , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Oleksandr Tymoshenko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 17:40:57 -0000 On 01/08/2013 11:21, Konstantin Belousov wrote: > On Tue, Jan 08, 2013 at 10:01:11AM -0700, Ian Lepore wrote: >> I'm just learning the armv6/v7 stuff myself right now, but I can answer >> your question for our current armv4/v5 implementation... >> >> When there is more than one mapping of a page in v4/v5 and any one of >> those mappings is writable, then the pmap.c code changes all existing >> mappings to be uncacheable to maintain coherency. If the writable >> mapping is removed and all that remains are read/exec mappings, the >> existing mappings are made cacheable again. Yes, that's just as >> inefficient and expensive as it sounds. :) > Interesting, so the arm/pmap.c in fact maintain pv entries even for the > unmanaged pages and kernel mappings ? There is a special case mechanism for such mappings. Look for the kva field in the md page struct. > ... But this approach, requiring pv > entries for the kernel mappings, makes kernel pv entries non-reclamable > on the low memory condition. In fact, I cannot find any traces of the pv > reclaim in the arm/pmap.c. Yes, arm will simply panic. Moreover, the individual pv entries are more than twice the size of i386 or mips. From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 17:42:27 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7E20141C; Tue, 8 Jan 2013 17:42:27 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 2A61FF76; Tue, 8 Jan 2013 17:42:27 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id r08HgQpD028419; Tue, 8 Jan 2013 10:42:26 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r08HgNDU095239; Tue, 8 Jan 2013 10:42:23 -0700 (MST) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r245147 - head/sys/arm/include From: Ian Lepore To: Konstantin Belousov In-Reply-To: <20130108172135.GA2561@kib.kiev.ua> References: <201301080240.r082eKVq080302@svn.freebsd.org> <20130108030022.GC82219@kib.kiev.ua> <50EBA947.1030902@freebsd.org> <20130108155641.GG82219@kib.kiev.ua> <1357664471.1088.131.camel@revolution.hippie.lan> <20130108172135.GA2561@kib.kiev.ua> Content-Type: text/plain; charset="us-ascii" Date: Tue, 08 Jan 2013 10:42:23 -0700 Message-ID: <1357666943.1088.137.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Oleksandr Tymoshenko , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 17:42:27 -0000 On Tue, 2013-01-08 at 19:21 +0200, Konstantin Belousov wrote: > On Tue, Jan 08, 2013 at 10:01:11AM -0700, Ian Lepore wrote: > > I'm just learning the armv6/v7 stuff myself right now, but I can answer > > your question for our current armv4/v5 implementation... > > > > When there is more than one mapping of a page in v4/v5 and any one of > > those mappings is writable, then the pmap.c code changes all existing > > mappings to be uncacheable to maintain coherency. If the writable > > mapping is removed and all that remains are read/exec mappings, the > > existing mappings are made cacheable again. Yes, that's just as > > inefficient and expensive as it sounds. :) > > Interesting, so the arm/pmap.c in fact maintain pv entries even for the > unmanaged pages and kernel mappings ? But this approach, requiring pv > entries for the kernel mappings, makes kernel pv entries non-reclamable > on the low memory condition. In fact, I cannot find any traces of the pv > reclaim in the arm/pmap.c. Well, I didn't say it did all this *correctly*. (I guess I implied that.) The first added kernel mapping doesn't generate a separate pv entry, it gets noted in the main pv struct, but then if yet another kernel entry is added it gets added as a normal pv entry. I've always assumed that was intended as a performance boost for short-lived temporary kernel mappings. I don't know about the reclaiming stuff. All my work with armv4 has been on small embedded systems compiled with option NO_SWAPPING, so in my experience one is just careful to not use too much memory, because when you do, things start to die. -- Ian From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 18:37:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C6D6E380; Tue, 8 Jan 2013 18:37:13 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B8CAF2C3; Tue, 8 Jan 2013 18:37:13 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08IbDa9062420; Tue, 8 Jan 2013 18:37:13 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08IbCwq062414; Tue, 8 Jan 2013 18:37:12 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201301081837.r08IbCwq062414@svn.freebsd.org> From: "David E. O'Brien" Date: Tue, 8 Jan 2013 18:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245171 - in head: tools/build/make_check tools/build/options usr.bin/grep X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 18:37:13 -0000 Author: obrien Date: Tue Jan 8 18:37:12 2013 New Revision: 245171 URL: http://svnweb.freebsd.org/changeset/base/245171 Log: Following r226271, allow disabling lzma support with "WITHOUT_LZMA_SUPPORT". Correct r226271 which should have used WITHOUT_BZIP2_SUPPORT per r166255. Obtained from: Juniper Networks Added: head/tools/build/options/WITHOUT_LZMA_SUPPORT - copied, changed from r245170, head/tools/build/options/WITHOUT_BZIP2_SUPPORT Modified: head/tools/build/make_check/Makefile head/usr.bin/grep/Makefile head/usr.bin/grep/file.c Modified: head/tools/build/make_check/Makefile ============================================================================== --- head/tools/build/make_check/Makefile Tue Jan 8 17:42:03 2013 (r245170) +++ head/tools/build/make_check/Makefile Tue Jan 8 18:37:12 2013 (r245171) @@ -24,7 +24,7 @@ SMAKE= MAKEFLAGS= ${MAKE} -C ${.CURDIR} all: @echo '1..16' - @${SMAKE} C_check || { cd ${.CURDIR} ; ${MAKE} failure ; } + @${SMAKE} C_check || { ${MAKE} -C ${.CURDIR} failure ; } @echo "ok 1 - C_check # Test of -C flag existence detected no regression." @echo 1:${DATA1} 2:${DATA2} 3:${DATA3} 4:${DATA4} 5:${DATA5} | \ diff -u ${.CURDIR}/regress.variables.out - || \ Copied and modified: head/tools/build/options/WITHOUT_LZMA_SUPPORT (from r245170, head/tools/build/options/WITHOUT_BZIP2_SUPPORT) ============================================================================== --- head/tools/build/options/WITHOUT_BZIP2_SUPPORT Tue Jan 8 17:42:03 2013 (r245170, copy source) +++ head/tools/build/options/WITHOUT_LZMA_SUPPORT Tue Jan 8 18:37:12 2013 (r245171) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to build some programs without optional bzip2 support. +Set to build some programs without optional lzma compression support. Modified: head/usr.bin/grep/Makefile ============================================================================== --- head/usr.bin/grep/Makefile Tue Jan 8 17:42:03 2013 (r245170) +++ head/usr.bin/grep/Makefile Tue Jan 8 18:37:12 2013 (r245171) @@ -40,17 +40,24 @@ MLINKS= grep.1 egrep.1 \ grep.1 lzfgrep.1 .endif +LDADD= -lz +DPADD= ${LIBZ} + +.if !defined(WITHOUT_LZMA_SUPPORT) +LDADD+= -llzma +DPADD+= ${LIBLZMA} + LINKS+= ${BINDIR}/${PROG} ${BINDIR}/xzgrep \ ${BINDIR}/${PROG} ${BINDIR}/xzegrep \ ${BINDIR}/${PROG} ${BINDIR}/xzfgrep \ ${BINDIR}/${PROG} ${BINDIR}/lzgrep \ ${BINDIR}/${PROG} ${BINDIR}/lzegrep \ ${BINDIR}/${PROG} ${BINDIR}/lzfgrep +.else +CFLAGS+= -DWITHOUT_LZMA +.endif -LDADD= -lz -llzma -DPADD= ${LIBZ} ${LIBLZMA} - -.if !defined(WITHOUT_BZIP2) +.if !defined(WITHOUT_BZIP2_SUPPORT) LDADD+= -lbz2 DPADD+= ${LIBBZ2} Modified: head/usr.bin/grep/file.c ============================================================================== --- head/usr.bin/grep/file.c Tue Jan 8 17:42:03 2013 (r245170) +++ head/usr.bin/grep/file.c Tue Jan 8 18:37:12 2013 (r245171) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -50,6 +49,10 @@ __FBSDID("$FreeBSD$"); #include #include +#ifndef WITHOUT_LZMA +#include +#endif + #ifndef WITHOUT_BZIP2 #include #endif @@ -60,7 +63,9 @@ __FBSDID("$FreeBSD$"); #define LNBUFBUMP 80 static gzFile gzbufdesc; +#ifndef WITHOUT_LZMA static lzma_stream lstrm = LZMA_STREAM_INIT; +#endif #ifndef WITHOUT_BZIP2 static BZFILE* bzbufdesc; #endif @@ -116,6 +121,7 @@ grep_refill(struct file *f) nr = -1; } #endif +#ifndef WITHOUT_LZMA } else if ((filebehave == FILE_XZ) || (filebehave == FILE_LZMA)) { lzma_action action = LZMA_RUN; uint8_t in_buf[MAXBUFSIZ]; @@ -146,6 +152,7 @@ grep_refill(struct file *f) return (-1); bufrem = MAXBUFSIZ - lstrm.avail_out; return (0); +#endif /* WIHTOUT_LZMA */ } else nr = read(f->fd, buffer, MAXBUFSIZ); From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 19:38:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8C5A73D; Tue, 8 Jan 2013 19:38:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BAADC7D0; Tue, 8 Jan 2013 19:38:57 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08JcvlD079387; Tue, 8 Jan 2013 19:38:57 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08JcvpD079386; Tue, 8 Jan 2013 19:38:57 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301081938.r08JcvpD079386@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 8 Jan 2013 19:38:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245175 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 19:38:57 -0000 Author: hselasky Date: Tue Jan 8 19:38:57 2013 New Revision: 245175 URL: http://svnweb.freebsd.org/changeset/base/245175 Log: Shave off another register write to save some more microseconds of PCI access time. Tested by: sos @ Submitted by: sos @ MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Tue Jan 8 19:16:28 2013 (r245174) +++ head/sys/dev/usb/controller/xhci.c Tue Jan 8 19:38:57 2013 (r245175) @@ -1440,24 +1440,33 @@ void xhci_interrupt(struct xhci_softc *sc) { uint32_t status; - uint32_t temp; + uint32_t iman; USB_BUS_LOCK(&sc->sc_bus); status = XREAD4(sc, oper, XHCI_USBSTS); + if (status == 0) + goto done; /* acknowledge interrupts */ XWRITE4(sc, oper, XHCI_USBSTS, status); - temp = XREAD4(sc, runt, XHCI_IMAN(0)); - - /* acknowledge pending event */ - - XWRITE4(sc, runt, XHCI_IMAN(0), temp); - - DPRINTFN(16, "real interrupt (sts=0x%08x, " - "iman=0x%08x)\n", status, temp); + DPRINTFN(16, "real interrupt (status=0x%08x)\n", status); + + if (status & XHCI_STS_EINT) { + + /* acknowledge pending event */ + iman = XREAD4(sc, runt, XHCI_IMAN(0)); + + /* reset interrupt */ + XWRITE4(sc, runt, XHCI_IMAN(0), iman); + + DPRINTFN(16, "real interrupt (iman=0x%08x)\n", iman); + + /* check for event(s) */ + xhci_interrupt_poll(sc); + } if (status & (XHCI_STS_PCD | XHCI_STS_HCH | XHCI_STS_HSE | XHCI_STS_HCE)) { @@ -1481,11 +1490,7 @@ xhci_interrupt(struct xhci_softc *sc) __FUNCTION__); } } - - /* check if we need to check the event rings */ - if ((status != 0) || (temp & XHCI_IMAN_INTR_PEND)) - xhci_interrupt_poll(sc); - +done: USB_BUS_UNLOCK(&sc->sc_bus); } From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 19:40:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 47FBC8C1; Tue, 8 Jan 2013 19:40:03 +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 C1B557E1; Tue, 8 Jan 2013 19:40:02 +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 14D6F2165CD; Tue, 8 Jan 2013 21:31:48 +0200 (EET) Date: Tue, 8 Jan 2013 21:31:47 +0200 From: Jaakko Heinonen To: John Baldwin Subject: Re: svn commit: r244585 - in head: . sys/geom/label Message-ID: <20130108193146.GA1815@a91-153-116-96.elisa-laajakaista.fi> References: <201212221343.qBMDhCHa086834@svn.freebsd.org> <201301041218.07804.john@baldwin.cx> <20130105092252.GA1832@a91-153-116-96.elisa-laajakaista.fi> <201301070927.07157.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201301070927.07157.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: src-committers@freebsd.org, pjd@FreeBSD.org, svn-src-all@freebsd.org, kib@FreeBSD.org, svn-src-head@freebsd.org, imp@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 19:40:03 -0000 On 2013-01-07, John Baldwin wrote: > I think if it isn't hard to do so, we should aim to preserve labels as they > are generally intended to be human readable as-is. Just preserving spaces is > probably sufficient for this as they are probably the most commonly used > character in labels affected by this change. All right. I have prepared patches for review. - Quote device names in devctl(4) device events. This allows events to work for device names containing spaces. - Allow spaces again in device names. Requested by: jhb PR: kern/161912 %%% Index: sys/kern/kern_conf.c =================================================================== --- sys/kern/kern_conf.c (revision 245155) +++ sys/kern/kern_conf.c (working copy) @@ -536,17 +536,17 @@ notify(struct cdev *dev, const char *ev, { static const char prefix[] = "cdev="; char *data; - int namelen, mflags; + size_t datalen; + int mflags; if (cold) return; mflags = (flags & MAKEDEV_NOWAIT) ? M_NOWAIT : M_WAITOK; - namelen = strlen(dev->si_name); - data = malloc(namelen + sizeof(prefix), M_TEMP, mflags); + datalen = strlen(dev->si_name) + sizeof(prefix) + 2; + data = malloc(datalen, M_TEMP, mflags); if (data == NULL) return; - memcpy(data, prefix, sizeof(prefix) - 1); - memcpy(data + sizeof(prefix) - 1, dev->si_name, namelen + 1); + snprintf(data, datalen, "%s\"%s\"", prefix, dev->si_name); devctl_notify_f("DEVFS", "CDEV", ev, data, mflags); free(data, M_TEMP); } @@ -699,11 +699,11 @@ prep_devname(struct cdev *dev, const cha for (to = dev->si_name; *from != '\0'; from++, to++) { /* - * Spaces and double quotation marks cause - * problems for the devctl(4) protocol. - * Reject names containing those characters. + * Double quotation marks cause problems for the + * devctl(4) protocol. Reject names containing + * those characters. */ - if (isspace(*from) || *from == '"') + if (*from == '"') return (EINVAL); /* Treat multiple sequential slashes as single. */ while (from[0] == '/' && from[1] == '/') Index: sys/geom/geom_dev.c =================================================================== --- sys/geom/geom_dev.c (revision 245155) +++ sys/geom/geom_dev.c (working copy) @@ -107,15 +107,15 @@ static void g_dev_attrchanged(struct g_consumer *cp, const char *attr) { struct cdev *dev; - char buf[SPECNAMELEN + 6]; + char buf[SPECNAMELEN + 8]; if (strcmp(attr, "GEOM::media") == 0) { dev = cp->geom->softc; - snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); + snprintf(buf, sizeof(buf), "cdev=\"%s\"", dev->si_name); devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); dev = cp->cp_alias_dev; if (dev != NULL) { - snprintf(buf, sizeof(buf), "cdev=%s", dev->si_name); + snprintf(buf, sizeof(buf), "cdev=\"%s\"", dev->si_name); devctl_notify_f("DEVFS", "CDEV", "MEDIACHANGE", buf, M_WAITOK); } %%% Don't mangle spaces in label names. Requested by: jhb %%% Index: sys/geom/label/g_label.c =================================================================== --- sys/geom/label/g_label.c (revision 245155) +++ sys/geom/label/g_label.c (working copy) @@ -148,7 +148,7 @@ g_label_mangle_name(char *label, size_t sb = sbuf_new(NULL, NULL, size, SBUF_FIXEDLEN); for (c = label; *c != '\0'; c++) { - if (!isprint(*c) || isspace(*c) || *c =='"' || *c == '%') + if (!isprint(*c) || *c =='"' || *c == '%') sbuf_printf(sb, "%%%02X", *c); else sbuf_putc(sb, *c); Index: UPDATING =================================================================== --- UPDATING (revision 245155) +++ UPDATING (working copy) @@ -33,9 +33,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 20121222: GEOM_LABEL now mangles label names read from file system metadata. - Mangling affect labels containing spaces, non-printable characters, - '%' or '"'. Device names in /etc/fstab and other places may need to - be updated. + Mangling affect labels containing non-printable characters, '%' or + '"'. Device names in /etc/fstab and other places may need to be + updated. 20121217: By default, only the 10 most recent kernel dumps will be saved. To %%% -- Jaakko From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 21:14:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8696AA04; Tue, 8 Jan 2013 21:14:00 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6DFF8B8B; Tue, 8 Jan 2013 21:14:00 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08LE0aW007478; Tue, 8 Jan 2013 21:14:00 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08LDxAD007458; Tue, 8 Jan 2013 21:13:59 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201301082113.r08LDxAD007458@svn.freebsd.org> From: Hiroki Sato Date: Tue, 8 Jan 2013 21:13:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245177 - in head/release: amd64 i386 ia64 pc98 powerpc sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 21:14:00 -0000 Author: hrs Date: Tue Jan 8 21:13:58 2013 New Revision: 245177 URL: http://svnweb.freebsd.org/changeset/base/245177 Log: ISO 9660 specification allows only "d-characters" and "a-characters" in the Volume Descriptor (section 7.4). In short, upper-case alphanumeric + some symbols only. While the makefs utility automatically converts the characters, $LABEL should be consistent in the scripts. Modified: head/release/amd64/mkisoimages.sh head/release/i386/mkisoimages.sh head/release/ia64/mkisoimages.sh head/release/pc98/mkisoimages.sh head/release/powerpc/mkisoimages.sh head/release/sparc64/mkisoimages.sh Modified: head/release/amd64/mkisoimages.sh ============================================================================== --- head/release/amd64/mkisoimages.sh Tue Jan 8 20:49:43 2013 (r245176) +++ head/release/amd64/mkisoimages.sh Tue Jan 8 21:13:58 2013 (r245177) @@ -36,9 +36,9 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* rm $1/etc/fstab Modified: head/release/i386/mkisoimages.sh ============================================================================== --- head/release/i386/mkisoimages.sh Tue Jan 8 20:49:43 2013 (r245176) +++ head/release/i386/mkisoimages.sh Tue Jan 8 21:13:58 2013 (r245177) @@ -36,9 +36,9 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* rm $1/etc/fstab Modified: head/release/ia64/mkisoimages.sh ============================================================================== --- head/release/ia64/mkisoimages.sh Tue Jan 8 20:49:43 2013 (r245176) +++ head/release/ia64/mkisoimages.sh Tue Jan 8 21:13:58 2013 (r245177) @@ -37,7 +37,7 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift BASE=$1; shift Modified: head/release/pc98/mkisoimages.sh ============================================================================== --- head/release/pc98/mkisoimages.sh Tue Jan 8 20:49:43 2013 (r245176) +++ head/release/pc98/mkisoimages.sh Tue Jan 8 21:13:58 2013 (r245177) @@ -36,9 +36,9 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* rm $1/etc/fstab Modified: head/release/powerpc/mkisoimages.sh ============================================================================== --- head/release/powerpc/mkisoimages.sh Tue Jan 8 20:49:43 2013 (r245176) +++ head/release/powerpc/mkisoimages.sh Tue Jan 8 21:13:58 2013 (r245177) @@ -58,10 +58,10 @@ if [ $# -lt 3 ]; then exit 1 fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift -echo "/dev/iso9660/`echo $LABEL | tr '[:lower:]' '[:upper:]'` / cd9660 ro 0 0" > $1/etc/fstab +echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab makefs -t cd9660 $bootable -o rockridge -o label=$LABEL $NAME $* rm $1/etc/fstab rm /tmp/hfs-boot-block Modified: head/release/sparc64/mkisoimages.sh ============================================================================== --- head/release/sparc64/mkisoimages.sh Tue Jan 8 20:49:43 2013 (r245176) +++ head/release/sparc64/mkisoimages.sh Tue Jan 8 21:13:58 2013 (r245177) @@ -63,7 +63,7 @@ if [ $? -ne 0 ]; then fi fi -LABEL=$1; shift +LABEL=`echo $1 | tr '[:lower:]' '[:upper:]'`; shift NAME=$1; shift echo "/dev/iso9660/$LABEL / cd9660 ro 0 0" > $1/etc/fstab From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 22:11:41 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 79388A8C; Tue, 8 Jan 2013 22:11:41 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id 1D9ADEA6; Tue, 8 Jan 2013 22:11:40 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r08MBYba076420; Tue, 8 Jan 2013 15:11:34 -0700 (MST) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r08MBYZc076419; Tue, 8 Jan 2013 15:11:34 -0700 (MST) (envelope-from ken) Date: Tue, 8 Jan 2013 15:11:34 -0700 From: "Kenneth D. Merry" To: Konstantin Belousov Subject: Re: svn commit: r227530 - head/sys/vm Message-ID: <20130108221134.GA75088@nargothrond.kdm.org> References: <201111151440.pAFEe0xJ004636@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <201111151440.pAFEe0xJ004636@svn.freebsd.org> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, alc@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 22:11:41 -0000 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Nov 15, 2011 at 14:40:00 +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Nov 15 14:40:00 2011 > New Revision: 227530 > URL: http://svn.freebsd.org/changeset/base/227530 > > Log: > Update the device pager interface, while keeping the compatibility > layer for old KPI and KBI. New interface should be used together with > d_mmap_single cdevsw method. > > Device pager can be allocated with the cdev_pager_allocate(9) > function, which takes struct cdev_pager_ops, containing > constructor/destructor and page fault handler methods supplied by > driver. > > Constructor and destructor, called at the pager allocation and > deallocation time, allow the driver to handle per-object private data. > > The pager handler is called to handle page fault on the vm map entry > backed by the driver pager. Driver shall return either the vm_page_t > which should be mapped, or error code (which does not cause kernel > panic anymore). The page handler interface has a placeholder to > specify the access mode causing the fault, but currently PROT_READ is > always passed there. > > Sponsored by: The FreeBSD Foundation > Reviewed by: alc > MFC after: 1 month This is an old commit, but I believe there is a bug introduced by this commit that triggered the following panic: panic: dev_rel((null)) gave negative count cpuid = 5 KDB: stack backtrace: db_trace_self_wrapper() at 0xffffffff803639da = db_trace_self_wrapper+0x2a kdb_backtrace() at 0xffffffff8090e677 = kdb_backtrace+0x37 panic() at 0xffffffff808d6bd8 = panic+0x1d8 dev_rel() at 0xffffffff8088f929 = dev_rel+0xc9 dev_pager_dealloc() at 0xffffffff80b2be30 = dev_pager_dealloc+0x30 vm_object_terminate() at 0xffffffff80b44d7d = vm_object_terminate+0x13d vm_object_deallocate() at 0xffffffff80b465ca = vm_object_deallocate+0x17a cdev_pager_allocate() at 0xffffffff80b2c5e6 = cdev_pager_allocate+0x236 dev_pager_alloc() at 0xffffffff80b2c697 = dev_pager_alloc+0x27 vm_mmap_cdev() at 0xffffffff80b41b86 = vm_mmap_cdev+0x116 vm_mmap() at 0xffffffff80b42221 = vm_mmap+0x671 sys_mmap() at 0xffffffff80b428c6 = sys_mmap+0x1d6 amd64_syscall() at 0xffffffff80bd1ed8 = amd64_syscall+0x318 Xfast_syscall() at 0xffffffff80bbd387 = Xfast_syscall+0xf7 --- syscall (477, FreeBSD ELF64, sys_mmap), rip = 0x8008ae25c, rsp = 0x7fffffffd968, rbp = 0 --- KDB: enter: panic [ thread pid 4109 tid 102348 ] Stopped at 0xffffffff8090e33b = kdb_enter+0x3b: movq $0,0xb433e2(%rip) This is a stable/9 system, but the code is the same in head. I triggered it by running dmidecode (perhaps a few times) on a machine with INVARIANTS enabled. You can probably trigger it before too long with something like this: ((i=0)); while [ $i -lt 50 ]; do dmidecode > /dev/null & ((i++)); done Run that loop until the system panics. The problem is that dev_pager_dealloc() passes in the VM object handle to the cdev_pg_dtor() method (in this case old_dev_pager_dtor()), which assumes that it is a struct cdev. But there is a case in cdev_pager_allocate() where if a race condition is hit, the object handle is set to the object itself. In that case, we wind up triggering an assertion in dev_rel(), because it is not operating on a struct cdev, but rather a VM object. I've attached my local commit and diffs. This does work, but you may have a better solution. Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="device_pager_dtor.20130108.1.txt" Change 649772 by kenm@ken.spectrabsd9 on 2013/01/08 14:54:45 Fix a bug in the device pager code that can trigger an assertion in devfs if a particular race condition is hit in the device pager code. This fixes BUG25532. This was a side effect of FreeBSD SVN change 227530 (our Perforce change 513754), which changed the device pager interface to call a new destructor routine for the cdev. That destructor routine, old_dev_pager_dtor(), takes a VM object handle. The object handle is cast to a struct cdev *, and passed into dev_rel(). That works in most cases, except the case in cdev_pager_allocate() where there is a race condition between two threads allocating an object backed by the same device. The loser of the race deallocates its object at the end of the function. The problem is that before inserting the object into the dev_pager_object_list, the object's handle is changed from the struct cdev pointer to the object's own address. This is to avoid conflicts with the winner of the race, which already inserted an object in the list with a handle that is a pointer to the same cdev structure. The object is then passed to vm_object_deallocate(), and eventually makes its way down to old_dev_pager_dtor(). That function passes the handle pointer (which is actually a VM object, not a struct cdev as usual) into dev_rel(). dev_rel() decrements the reference count in the assumed struct cdev (which happens to be 0), and that triggers the assertion in dev_rel() that the reference count is greater than or equal to 0. The fix is to add a cdev pointer to the VM object, and use that pointer when calling the cdev_pg_dtor() routine. There may be other, better, ways to fix this, so I'll ask for a review by the appropriate FreeBSD VM maintainers. vm_object.h: Add a struct cdev pointer to the VM object structure. device_pager.c: In cdev_pager_allocate(), populate the new cdev pointer. In dev_pager_dealloc(), use the new cdev pointer when calling the object's cdev_pg_dtor() routine. TeamTrack: BUG25532 Affected files ... ... //SpectraBSD/stable/sys/vm/device_pager.c#3 edit ... //SpectraBSD/stable/sys/vm/vm_object.h#3 edit Differences ... ==== //SpectraBSD/stable/sys/vm/device_pager.c#3 (text) ==== @@ -156,6 +156,7 @@ object1->pg_color = color; object1->handle = handle; object1->un_pager.devp.ops = ops; + object1->un_pager.devp.dev = handle; TAILQ_INIT(&object1->un_pager.devp.devp_pglist); mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); @@ -233,7 +234,7 @@ vm_page_t m; VM_OBJECT_UNLOCK(object); - object->un_pager.devp.ops->cdev_pg_dtor(object->handle); + object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.dev); mtx_lock(&dev_pager_mtx); TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list); ==== //SpectraBSD/stable/sys/vm/vm_object.h#3 (text) ==== @@ -123,6 +123,7 @@ struct { TAILQ_HEAD(, vm_page) devp_pglist; struct cdev_pager_ops *ops; + struct cdev *dev; } devp; /* --5mCyUwZo2JvN/JJP-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 22:12:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 39377C0C; Tue, 8 Jan 2013 22:12:47 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2779FEB9; Tue, 8 Jan 2013 22:12:47 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08MCjbY024742; Tue, 8 Jan 2013 22:12:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08MCjF3024741; Tue, 8 Jan 2013 22:12:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301082212.r08MCjF3024741@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Jan 2013 22:12:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245183 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 22:12:47 -0000 Author: adrian Date: Tue Jan 8 22:12:45 2013 New Revision: 245183 URL: http://svnweb.freebsd.org/changeset/base/245183 Log: If spectral scan is enabled, ensure radar report PHY errors are also enabled. Modified: head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Tue Jan 8 21:42:30 2013 (r245182) +++ head/sys/dev/ath/if_ath_rx.c Tue Jan 8 22:12:45 2013 (r245183) @@ -210,6 +210,13 @@ ath_calcrxfilter(struct ath_softc *sc) if (sc->sc_dodfs) rfilt |= HAL_RX_FILTER_PHYRADAR; + /* + * Enable spectral PHY errors if requested by the + * spectral module. + */ + if (sc->sc_dospectral) + rfilt |= HAL_RX_FILTER_PHYRADAR; + DPRINTF(sc, ATH_DEBUG_MODE, "%s: RX filter 0x%x, %s if_flags 0x%x\n", __func__, rfilt, ieee80211_opmode_name[ic->ic_opmode], ifp->if_flags); return rfilt; From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 22:14:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7BDEFE51; Tue, 8 Jan 2013 22:14:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6D07AEE1; Tue, 8 Jan 2013 22:14:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08MEkPr025007; Tue, 8 Jan 2013 22:14:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08MEkhm025006; Tue, 8 Jan 2013 22:14:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301082214.r08MEkhm025006@svn.freebsd.org> From: Xin LI Date: Tue, 8 Jan 2013 22:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245184 - head/usr.bin/tail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 22:14:46 -0000 Author: delphij Date: Tue Jan 8 22:14:45 2013 New Revision: 245184 URL: http://svnweb.freebsd.org/changeset/base/245184 Log: Use calloc() to get zeroed memory. MFC after: 1 month Modified: head/usr.bin/tail/read.c Modified: head/usr.bin/tail/read.c ============================================================================== --- head/usr.bin/tail/read.c Tue Jan 8 22:12:45 2013 (r245183) +++ head/usr.bin/tail/read.c Tue Jan 8 22:14:45 2013 (r245184) @@ -143,9 +143,8 @@ lines(FILE *fp, const char *fn, off_t of char *p, *sp; int blen, cnt, recno, wrap; - if ((llines = malloc(off * sizeof(*llines))) == NULL) - err(1, "malloc"); - bzero(llines, off * sizeof(*llines)); + if ((llines = calloc(off, sizeof(*llines))) == NULL) + err(1, "calloc"); p = sp = NULL; blen = cnt = recno = wrap = 0; rc = 0; From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 22:15:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 41607FC3; Tue, 8 Jan 2013 22:15:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 348B9EEA; Tue, 8 Jan 2013 22:15:14 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08MFEq3025139; Tue, 8 Jan 2013 22:15:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08MFDt6025137; Tue, 8 Jan 2013 22:15:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301082215.r08MFDt6025137@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Jan 2013 22:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245185 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 22:15:14 -0000 Author: adrian Date: Tue Jan 8 22:15:13 2013 New Revision: 245185 URL: http://svnweb.freebsd.org/changeset/base/245185 Log: Add support for triggering spectral scan upon a channel reset/change. This is intended to support reporting FFT results during active channel scans, for users who would like to fiddle around with writing applications that do both FFT visualisation _and_ AP scanning. * add a new ioctl to enable/trigger spectral scan at channel change/reset; * set do_spectral consistently if it's enabled, so a channel set/reset will carry forth the correct PHY error configuration so frames are actually received; * for NICs that don't do spectral scan, don't bother checking the spectral scan state on channel change/reset. Tested: * AR9280 - STA and scanning; * AR5416 - STA, ensured that the SS code doesn't panic Modified: head/sys/dev/ath/if_ath_spectral.c head/sys/dev/ath/if_athioctl.h Modified: head/sys/dev/ath/if_ath_spectral.c ============================================================================== --- head/sys/dev/ath/if_ath_spectral.c Tue Jan 8 22:14:45 2013 (r245184) +++ head/sys/dev/ath/if_ath_spectral.c Tue Jan 8 22:15:13 2013 (r245185) @@ -73,8 +73,21 @@ __FBSDID("$FreeBSD$"); struct ath_spectral_state { HAL_SPECTRAL_PARAM spectral_state; - int spectral_active; - int spectral_enabled; + + /* + * Should we enable spectral scan upon + * each network interface reset/change? + * + * This is intended to allow spectral scan + * frame reporting during channel scans. + * + * Later on it can morph into a larger + * scale config method where it pushes + * a "channel scan" config into the hardware + * rather than just the spectral_state + * config. + */ + int spectral_enable_after_reset; }; /* @@ -135,7 +148,20 @@ ath_spectral_detach(struct ath_softc *sc int ath_spectral_enable(struct ath_softc *sc, struct ieee80211_channel *ch) { + struct ath_spectral_state *ss = sc->sc_spectral; + /* Default to disable spectral PHY reporting */ + sc->sc_dospectral = 0; + + if (ss == NULL) + return (0); + + if (ss->spectral_enable_after_reset) { + ath_hal_spectral_configure(sc->sc_ah, + &ss->spectral_state); + (void) ath_hal_spectral_start(sc->sc_ah); + sc->sc_dospectral = 1; + } return (0); } @@ -158,6 +184,7 @@ ath_ioctl_spectral(struct ath_softc *sc, HAL_SPECTRAL_PARAM peout; HAL_SPECTRAL_PARAM *pe; struct ath_spectral_state *ss = sc->sc_spectral; + int val; if (! ath_hal_spectral_supported(sc->sc_ah)) return (EINVAL); @@ -212,9 +239,32 @@ ath_ioctl_spectral(struct ath_softc *sc, ath_hal_spectral_configure(sc->sc_ah, &ss->spectral_state); (void) ath_hal_spectral_start(sc->sc_ah); + sc->sc_dospectral = 1; + /* XXX need to update the PHY mask in the driver */ break; case SPECTRAL_CONTROL_STOP: (void) ath_hal_spectral_stop(sc->sc_ah); + sc->sc_dospectral = 0; + /* XXX need to update the PHY mask in the driver */ + break; + case SPECTRAL_CONTROL_ENABLE_AT_RESET: + if (insize < sizeof(int)) { + device_printf(sc->sc_dev, "%d != %d\n", + insize, + sizeof(int)); + error = EINVAL; + break; + } + if (indata == NULL) { + device_printf(sc->sc_dev, "indata=NULL\n"); + error = EINVAL; + break; + } + val = * ((int *) indata); + if (val == 0) + ss->spectral_enable_after_reset = 0; + else + ss->spectral_enable_after_reset = 1; break; case SPECTRAL_CONTROL_ENABLE: /* XXX TODO */ Modified: head/sys/dev/ath/if_athioctl.h ============================================================================== --- head/sys/dev/ath/if_athioctl.h Tue Jan 8 22:14:45 2013 (r245184) +++ head/sys/dev/ath/if_athioctl.h Tue Jan 8 22:15:13 2013 (r245185) @@ -427,5 +427,7 @@ struct ath_tx_radiotap_header { #define SPECTRAL_CONTROL_STOP 5 #define SPECTRAL_CONTROL_GET_PARAMS 6 #define SPECTRAL_CONTROL_SET_PARAMS 7 +#define SPECTRAL_CONTROL_ENABLE_AT_RESET 8 +#define SPECTRAL_CONTROL_DISABLE_AT_RESET 9 #endif /* _DEV_ATH_ATHIOCTL_H */ From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 22:42:16 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7F428D29; Tue, 8 Jan 2013 22:42:16 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5B1A989; Tue, 8 Jan 2013 22:42:16 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08MgGnm033661; Tue, 8 Jan 2013 22:42:16 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08MgGcB033660; Tue, 8 Jan 2013 22:42:16 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301082242.r08MgGcB033660@svn.freebsd.org> From: Adrian Chadd Date: Tue, 8 Jan 2013 22:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245190 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 22:42:16 -0000 Author: adrian Date: Tue Jan 8 22:42:15 2013 New Revision: 245190 URL: http://svnweb.freebsd.org/changeset/base/245190 Log: Fix format size. Modified: head/sys/dev/ath/if_ath_spectral.c Modified: head/sys/dev/ath/if_ath_spectral.c ============================================================================== --- head/sys/dev/ath/if_ath_spectral.c Tue Jan 8 22:30:12 2013 (r245189) +++ head/sys/dev/ath/if_ath_spectral.c Tue Jan 8 22:42:15 2013 (r245190) @@ -251,7 +251,7 @@ ath_ioctl_spectral(struct ath_softc *sc, if (insize < sizeof(int)) { device_printf(sc->sc_dev, "%d != %d\n", insize, - sizeof(int)); + (int) sizeof(int)); error = EINVAL; break; } From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 22:49:38 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 110C7E4; Tue, 8 Jan 2013 22:49:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6039FE4; Tue, 8 Jan 2013 22:49:37 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r08MnVuK057005; Wed, 9 Jan 2013 00:49:31 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r08MnVuK057005 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r08MnV4D057004; Wed, 9 Jan 2013 00:49:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 9 Jan 2013 00:49:31 +0200 From: Konstantin Belousov To: "Kenneth D. Merry" Subject: Re: svn commit: r227530 - head/sys/vm Message-ID: <20130108224931.GC2561@kib.kiev.ua> References: <201111151440.pAFEe0xJ004636@svn.freebsd.org> <20130108221134.GA75088@nargothrond.kdm.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7gGkHNMELEOhSGF6" Content-Disposition: inline In-Reply-To: <20130108221134.GA75088@nargothrond.kdm.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@FreeBSD.org, alc@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 22:49:38 -0000 --7gGkHNMELEOhSGF6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 08, 2013 at 03:11:34PM -0700, Kenneth D. Merry wrote: > On Tue, Nov 15, 2011 at 14:40:00 +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Tue Nov 15 14:40:00 2011 > > New Revision: 227530 > > URL: http://svn.freebsd.org/changeset/base/227530 > >=20 > > Log: > > Update the device pager interface, while keeping the compatibility > > layer for old KPI and KBI. New interface should be used together with > > d_mmap_single cdevsw method. > > =20 > > Device pager can be allocated with the cdev_pager_allocate(9) > > function, which takes struct cdev_pager_ops, containing > > constructor/destructor and page fault handler methods supplied by > > driver. > > =20 > > Constructor and destructor, called at the pager allocation and > > deallocation time, allow the driver to handle per-object private data. > > =20 > > The pager handler is called to handle page fault on the vm map entry > > backed by the driver pager. Driver shall return either the vm_page_t > > which should be mapped, or error code (which does not cause kernel > > panic anymore). The page handler interface has a placeholder to > > specify the access mode causing the fault, but currently PROT_READ is > > always passed there. > > =20 > > Sponsored by: The FreeBSD Foundation > > Reviewed by: alc > > MFC after: 1 month >=20 > This is an old commit, but I believe there is a bug introduced by this > commit that triggered the following panic: >=20 > panic: dev_rel((null)) gave negative count > cpuid =3D 5 > KDB: stack backtrace: > db_trace_self_wrapper() at 0xffffffff803639da =3D db_trace_self_wrapper+0= x2a > kdb_backtrace() at 0xffffffff8090e677 =3D kdb_backtrace+0x37 > panic() at 0xffffffff808d6bd8 =3D panic+0x1d8 > dev_rel() at 0xffffffff8088f929 =3D dev_rel+0xc9 > dev_pager_dealloc() at 0xffffffff80b2be30 =3D dev_pager_dealloc+0x30 > vm_object_terminate() at 0xffffffff80b44d7d =3D vm_object_terminate+0x13d > vm_object_deallocate() at 0xffffffff80b465ca =3D vm_object_deallocate+0x1= 7a > cdev_pager_allocate() at 0xffffffff80b2c5e6 =3D cdev_pager_allocate+0x236 > dev_pager_alloc() at 0xffffffff80b2c697 =3D dev_pager_alloc+0x27 > vm_mmap_cdev() at 0xffffffff80b41b86 =3D vm_mmap_cdev+0x116 > vm_mmap() at 0xffffffff80b42221 =3D vm_mmap+0x671 > sys_mmap() at 0xffffffff80b428c6 =3D sys_mmap+0x1d6 > amd64_syscall() at 0xffffffff80bd1ed8 =3D amd64_syscall+0x318 > Xfast_syscall() at 0xffffffff80bbd387 =3D Xfast_syscall+0xf7 > --- syscall (477, FreeBSD ELF64, sys_mmap), rip =3D 0x8008ae25c, rsp =3D > 0x7fffffffd968, rbp =3D 0 --- > KDB: enter: panic > [ thread pid 4109 tid 102348 ] > Stopped at 0xffffffff8090e33b =3D kdb_enter+0x3b: movq $0,0xb433e= 2(%rip) >=20 > This is a stable/9 system, but the code is the same in head. >=20 > I triggered it by running dmidecode (perhaps a few times) on a machine wi= th > INVARIANTS enabled. You can probably trigger it before too long with > something like this: >=20 > ((i=3D0)); while [ $i -lt 50 ]; do dmidecode > /dev/null & ((i++)); done >=20 > Run that loop until the system panics. >=20 > The problem is that dev_pager_dealloc() passes in the VM object handle to > the cdev_pg_dtor() method (in this case old_dev_pager_dtor()), which > assumes that it is a struct cdev. >=20 > But there is a case in cdev_pager_allocate() where if a race condition is > hit, the object handle is set to the object itself. In that case, we wind > up triggering an assertion in dev_rel(), because it is not operating on a > struct cdev, but rather a VM object. >=20 > I've attached my local commit and diffs. This does work, but you may > have a better solution. >=20 > Thanks, >=20 > Ken > --=20 > Kenneth Merry > ken@FreeBSD.ORG > Change 649772 by kenm@ken.spectrabsd9 on 2013/01/08 14:54:45 >=20 > Fix a bug in the device pager code that can trigger an assertion > in devfs if a particular race condition is hit in the device pager > code. > =09 > This fixes BUG25532. > =09 > This was a side effect of FreeBSD SVN change 227530 (our Perforce > change 513754), which changed the device pager interface to call > a new destructor routine for the cdev. That destructor routine, > old_dev_pager_dtor(), takes a VM object handle. > =09 > The object handle is cast to a struct cdev *, and passed into > dev_rel(). > =09 > That works in most cases, except the case in cdev_pager_allocate() > where there is a race condition between two threads allocating an > object backed by the same device. The loser of the race > deallocates its object at the end of the function. > =09 > The problem is that before inserting the object into the > dev_pager_object_list, the object's handle is changed from the > struct cdev pointer to the object's own address. This is to avoid > conflicts with the winner of the race, which already inserted an > object in the list with a handle that is a pointer to the same cdev > structure. > =09 > The object is then passed to vm_object_deallocate(), and eventually > makes its way down to old_dev_pager_dtor(). That function passes > the handle pointer (which is actually a VM object, not a struct > cdev as usual) into dev_rel(). dev_rel() decrements the reference > count in the assumed struct cdev (which happens to be 0), and > that triggers the assertion in dev_rel() that the reference count > is greater than or equal to 0. > =09 > The fix is to add a cdev pointer to the VM object, and use that > pointer when calling the cdev_pg_dtor() routine. There may be > other, better, ways to fix this, so I'll ask for a review by the > appropriate FreeBSD VM maintainers. > =09 > vm_object.h: Add a struct cdev pointer to the VM object > structure. > =09 > device_pager.c: In cdev_pager_allocate(), populate the new cdev > pointer. > =09 > In dev_pager_dealloc(), use the new cdev pointer > when calling the object's cdev_pg_dtor() routine. > =09 > TeamTrack: BUG25532 >=20 > Affected files ... >=20 > ... //SpectraBSD/stable/sys/vm/device_pager.c#3 edit > ... //SpectraBSD/stable/sys/vm/vm_object.h#3 edit >=20 > Differences ... >=20 > =3D=3D=3D=3D //SpectraBSD/stable/sys/vm/device_pager.c#3 (text) =3D=3D=3D= =3D >=20 > @@ -156,6 +156,7 @@ > object1->pg_color =3D color; > object1->handle =3D handle; > object1->un_pager.devp.ops =3D ops; > + object1->un_pager.devp.dev =3D handle; > TAILQ_INIT(&object1->un_pager.devp.devp_pglist); > mtx_lock(&dev_pager_mtx); > object =3D vm_pager_object_lookup(&dev_pager_object_list, handle); > @@ -233,7 +234,7 @@ > vm_page_t m; > =20 > VM_OBJECT_UNLOCK(object); > - object->un_pager.devp.ops->cdev_pg_dtor(object->handle); > + object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.dev); > =20 > mtx_lock(&dev_pager_mtx); > TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list); >=20 > =3D=3D=3D=3D //SpectraBSD/stable/sys/vm/vm_object.h#3 (text) =3D=3D=3D=3D >=20 > @@ -123,6 +123,7 @@ > struct { > TAILQ_HEAD(, vm_page) devp_pglist; > struct cdev_pager_ops *ops; > + struct cdev *dev; > } devp; > =20 > /* Hm, yes, I remembered this. I had the following patch sitting in my local repository since the autumn, I think. Might be, your solution is more clean, but the main idea is the same, to put the cdev pointer into the additional place. diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c index ba70571..538c887 100644 --- a/sys/vm/device_pager.c +++ b/sys/vm/device_pager.c @@ -183,6 +183,7 @@ cdev_pager_allocate(void *handle, enum obj_type tp, str= uct cdev_pager_ops *ops, mtx_unlock(&dev_pager_mtx); if (object1 !=3D NULL) { object1->handle =3D object1; + object1->un_pager.devp.bhandle =3D handle; mtx_lock(&dev_pager_mtx); TAILQ_INSERT_TAIL(&dev_pager_object_list, object1, pager_object_list); @@ -233,13 +234,15 @@ dev_pager_dealloc(object) vm_object_t object; { vm_page_t m; + void *h; =20 VM_OBJECT_UNLOCK(object); - object->un_pager.devp.ops->cdev_pg_dtor(object->handle); - mtx_lock(&dev_pager_mtx); TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list); mtx_unlock(&dev_pager_mtx); + h =3D object->handle =3D=3D object ? object->un_pager.devp.bhandle : + object->handle; + object->un_pager.devp.ops->cdev_pg_dtor(h); VM_OBJECT_LOCK(object); =20 if (object->type =3D=3D OBJT_DEVICE) { diff --git a/sys/vm/vm_object.h b/sys/vm/vm_object.h index b584239..6a39e18 100644 --- a/sys/vm/vm_object.h +++ b/sys/vm/vm_object.h @@ -136,6 +136,7 @@ struct vm_object { struct { TAILQ_HEAD(, vm_page) devp_pglist; struct cdev_pager_ops *ops; + void *bhandle; } devp; =20 /* --7gGkHNMELEOhSGF6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ7KJ6AAoJEJDCuSvBvK1B6/MP/RCk//QYDfZ/YYmB2auL4xJc Sb2roVmbCoAs4rUnytaogkRZ/txEK/h1dk0E/5H3LG6bgM5xe0kUWNDK+r7VtIl1 0V8felbcOR4iQaw9m78F/iS1TCKX0ycT5YNyhUoeC0jbDzXK/uncbNUUm2BTp85e ugZXEJ7uzXO1CoNvWBg8oELdlDIPOFw22RMeAUxS72xOOdFMi3U6lACXLlC+6z3z 3jBN886VJRFCHiPHMM+kNJAZeFTrm3oqWm+7J/ANmqXzhpzLJ7lU6+lTxH4LhJFa jZEwzLGG0Mwghd6CCYn2OyNEdzw5JBq7AJyLq0OoW7pDZ/Vr69/Rre+bulBXPqSq srhKtlbyrF+TzJdzzrFsqF1QNiyDAuaBlqQ8WFDxmj9TxAenuLEXrwKtNrprYvdh k/BrBeRqaFZD+m9nK9Hlfr9OJDx0KyLxS6YiFYzyueaZ2hTvHkyb2YBESk6nzAB9 7TyrbQ2WgZFFozKS3YAobWXNXo6VnNMZF166A9WGo6g9fzrBMBIjEnD47RD/0k7R EZYq1iAqETePvC5wNcwy1EEGZLj5OLvp3+ZMCCfefiqxXA6gczcmhYQx87S6EtKK b1usG3mgWaFon5fb+378mzRiF2eqZ30knFbpT/qzOquChqN+Rq+cTPp4uilMWxX3 YiD3j26Wm5iLGHeOkZtD =6B2x -----END PGP SIGNATURE----- --7gGkHNMELEOhSGF6-- From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 22:55:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E1292435; Tue, 8 Jan 2013 22:55:39 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D37EF128; Tue, 8 Jan 2013 22:55:39 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r08MtdVp037083; Tue, 8 Jan 2013 22:55:39 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r08Mtd3s037082; Tue, 8 Jan 2013 22:55:39 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201301082255.r08Mtd3s037082@svn.freebsd.org> From: Olivier Houchard Date: Tue, 8 Jan 2013 22:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245192 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 22:55:40 -0000 Author: cognet Date: Tue Jan 8 22:55:39 2013 New Revision: 245192 URL: http://svnweb.freebsd.org/changeset/base/245192 Log: Remove old declarations. Modified: head/sys/arm/arm/pl310.c Modified: head/sys/arm/arm/pl310.c ============================================================================== --- head/sys/arm/arm/pl310.c Tue Jan 8 22:51:48 2013 (r245191) +++ head/sys/arm/arm/pl310.c Tue Jan 8 22:55:39 2013 (r245192) @@ -73,13 +73,6 @@ __FBSDID("$FreeBSD$"); static int pl310_enabled = 1; TUNABLE_INT("pl310.enabled", &pl310_enabled); -void omap4_l2cache_wbinv_range(vm_paddr_t physaddr, vm_size_t size); -void omap4_l2cache_inv_range(vm_paddr_t physaddr, vm_size_t size); -void omap4_l2cache_wb_range(vm_paddr_t physaddr, vm_size_t size); -void omap4_l2cache_wbinv_all(void); -void omap4_l2cache_inv_all(void); -void omap4_l2cache_wb_all(void); - static uint32_t g_l2cache_way_mask; static const uint32_t g_l2cache_line_size = 32; From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 23:03:13 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 110528BE; Tue, 8 Jan 2013 23:03:13 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id C3F6F17F; Tue, 8 Jan 2013 23:03:12 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r08N3CH2077892; Tue, 8 Jan 2013 16:03:12 -0700 (MST) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r08N3Bp3077891; Tue, 8 Jan 2013 16:03:11 -0700 (MST) (envelope-from ken) Date: Tue, 8 Jan 2013 16:03:11 -0700 From: "Kenneth D. Merry" To: Konstantin Belousov Subject: Re: svn commit: r227530 - head/sys/vm Message-ID: <20130108230311.GA77847@nargothrond.kdm.org> References: <201111151440.pAFEe0xJ004636@svn.freebsd.org> <20130108221134.GA75088@nargothrond.kdm.org> <20130108224931.GC2561@kib.kiev.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130108224931.GC2561@kib.kiev.ua> User-Agent: Mutt/1.4.2i Cc: svn-src-head@FreeBSD.org, alc@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 23:03:13 -0000 On Wed, Jan 09, 2013 at 00:49:31 +0200, Konstantin Belousov wrote: > On Tue, Jan 08, 2013 at 03:11:34PM -0700, Kenneth D. Merry wrote: > > On Tue, Nov 15, 2011 at 14:40:00 +0000, Konstantin Belousov wrote: > > > Author: kib > > > Date: Tue Nov 15 14:40:00 2011 > > > New Revision: 227530 > > > URL: http://svn.freebsd.org/changeset/base/227530 > > > > > > Log: > > > Update the device pager interface, while keeping the compatibility > > > layer for old KPI and KBI. New interface should be used together with > > > d_mmap_single cdevsw method. > > > > > > Device pager can be allocated with the cdev_pager_allocate(9) > > > function, which takes struct cdev_pager_ops, containing > > > constructor/destructor and page fault handler methods supplied by > > > driver. > > > > > > Constructor and destructor, called at the pager allocation and > > > deallocation time, allow the driver to handle per-object private data. > > > > > > The pager handler is called to handle page fault on the vm map entry > > > backed by the driver pager. Driver shall return either the vm_page_t > > > which should be mapped, or error code (which does not cause kernel > > > panic anymore). The page handler interface has a placeholder to > > > specify the access mode causing the fault, but currently PROT_READ is > > > always passed there. > > > > > > Sponsored by: The FreeBSD Foundation > > > Reviewed by: alc > > > MFC after: 1 month > > > > This is an old commit, but I believe there is a bug introduced by this > > commit that triggered the following panic: > > > > panic: dev_rel((null)) gave negative count > > cpuid = 5 > > KDB: stack backtrace: > > db_trace_self_wrapper() at 0xffffffff803639da = db_trace_self_wrapper+0x2a > > kdb_backtrace() at 0xffffffff8090e677 = kdb_backtrace+0x37 > > panic() at 0xffffffff808d6bd8 = panic+0x1d8 > > dev_rel() at 0xffffffff8088f929 = dev_rel+0xc9 > > dev_pager_dealloc() at 0xffffffff80b2be30 = dev_pager_dealloc+0x30 > > vm_object_terminate() at 0xffffffff80b44d7d = vm_object_terminate+0x13d > > vm_object_deallocate() at 0xffffffff80b465ca = vm_object_deallocate+0x17a > > cdev_pager_allocate() at 0xffffffff80b2c5e6 = cdev_pager_allocate+0x236 > > dev_pager_alloc() at 0xffffffff80b2c697 = dev_pager_alloc+0x27 > > vm_mmap_cdev() at 0xffffffff80b41b86 = vm_mmap_cdev+0x116 > > vm_mmap() at 0xffffffff80b42221 = vm_mmap+0x671 > > sys_mmap() at 0xffffffff80b428c6 = sys_mmap+0x1d6 > > amd64_syscall() at 0xffffffff80bd1ed8 = amd64_syscall+0x318 > > Xfast_syscall() at 0xffffffff80bbd387 = Xfast_syscall+0xf7 > > --- syscall (477, FreeBSD ELF64, sys_mmap), rip = 0x8008ae25c, rsp = > > 0x7fffffffd968, rbp = 0 --- > > KDB: enter: panic > > [ thread pid 4109 tid 102348 ] > > Stopped at 0xffffffff8090e33b = kdb_enter+0x3b: movq $0,0xb433e2(%rip) > > > > This is a stable/9 system, but the code is the same in head. > > > > I triggered it by running dmidecode (perhaps a few times) on a machine with > > INVARIANTS enabled. You can probably trigger it before too long with > > something like this: > > > > ((i=0)); while [ $i -lt 50 ]; do dmidecode > /dev/null & ((i++)); done > > > > Run that loop until the system panics. > > > > The problem is that dev_pager_dealloc() passes in the VM object handle to > > the cdev_pg_dtor() method (in this case old_dev_pager_dtor()), which > > assumes that it is a struct cdev. > > > > But there is a case in cdev_pager_allocate() where if a race condition is > > hit, the object handle is set to the object itself. In that case, we wind > > up triggering an assertion in dev_rel(), because it is not operating on a > > struct cdev, but rather a VM object. > > > > I've attached my local commit and diffs. This does work, but you may > > have a better solution. > > > > Thanks, > > > > Ken > > -- > > Kenneth Merry > > ken@FreeBSD.ORG > > > Change 649772 by kenm@ken.spectrabsd9 on 2013/01/08 14:54:45 > > > > Fix a bug in the device pager code that can trigger an assertion > > in devfs if a particular race condition is hit in the device pager > > code. > > > > This fixes BUG25532. > > > > This was a side effect of FreeBSD SVN change 227530 (our Perforce > > change 513754), which changed the device pager interface to call > > a new destructor routine for the cdev. That destructor routine, > > old_dev_pager_dtor(), takes a VM object handle. > > > > The object handle is cast to a struct cdev *, and passed into > > dev_rel(). > > > > That works in most cases, except the case in cdev_pager_allocate() > > where there is a race condition between two threads allocating an > > object backed by the same device. The loser of the race > > deallocates its object at the end of the function. > > > > The problem is that before inserting the object into the > > dev_pager_object_list, the object's handle is changed from the > > struct cdev pointer to the object's own address. This is to avoid > > conflicts with the winner of the race, which already inserted an > > object in the list with a handle that is a pointer to the same cdev > > structure. > > > > The object is then passed to vm_object_deallocate(), and eventually > > makes its way down to old_dev_pager_dtor(). That function passes > > the handle pointer (which is actually a VM object, not a struct > > cdev as usual) into dev_rel(). dev_rel() decrements the reference > > count in the assumed struct cdev (which happens to be 0), and > > that triggers the assertion in dev_rel() that the reference count > > is greater than or equal to 0. > > > > The fix is to add a cdev pointer to the VM object, and use that > > pointer when calling the cdev_pg_dtor() routine. There may be > > other, better, ways to fix this, so I'll ask for a review by the > > appropriate FreeBSD VM maintainers. > > > > vm_object.h: Add a struct cdev pointer to the VM object > > structure. > > > > device_pager.c: In cdev_pager_allocate(), populate the new cdev > > pointer. > > > > In dev_pager_dealloc(), use the new cdev pointer > > when calling the object's cdev_pg_dtor() routine. > > > > TeamTrack: BUG25532 > > > > Affected files ... > > > > ... //SpectraBSD/stable/sys/vm/device_pager.c#3 edit > > ... //SpectraBSD/stable/sys/vm/vm_object.h#3 edit > > > > Differences ... > > > > ==== //SpectraBSD/stable/sys/vm/device_pager.c#3 (text) ==== > > > > @@ -156,6 +156,7 @@ > > object1->pg_color = color; > > object1->handle = handle; > > object1->un_pager.devp.ops = ops; > > + object1->un_pager.devp.dev = handle; > > TAILQ_INIT(&object1->un_pager.devp.devp_pglist); > > mtx_lock(&dev_pager_mtx); > > object = vm_pager_object_lookup(&dev_pager_object_list, handle); > > @@ -233,7 +234,7 @@ > > vm_page_t m; > > > > VM_OBJECT_UNLOCK(object); > > - object->un_pager.devp.ops->cdev_pg_dtor(object->handle); > > + object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.dev); > > > > mtx_lock(&dev_pager_mtx); > > TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list); > > > > ==== //SpectraBSD/stable/sys/vm/vm_object.h#3 (text) ==== > > > > @@ -123,6 +123,7 @@ > > struct { > > TAILQ_HEAD(, vm_page) devp_pglist; > > struct cdev_pager_ops *ops; > > + struct cdev *dev; > > } devp; > > > > /* > > Hm, yes, I remembered this. I had the following patch sitting in my > local repository since the autumn, I think. > > Might be, your solution is more clean, but the main idea is the same, > to put the cdev pointer into the additional place. Okay, cool! Well, in that case could you pick the solution you prefer and commit it? Thanks, Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-head@FreeBSD.ORG Tue Jan 8 23:46:05 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 902F774E; Tue, 8 Jan 2013 23:46:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id DF661380; Tue, 8 Jan 2013 23:46:04 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r08NjsEt063287; Wed, 9 Jan 2013 01:45:54 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r08NjsEt063287 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r08NjsW1063286; Wed, 9 Jan 2013 01:45:54 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 9 Jan 2013 01:45:54 +0200 From: Konstantin Belousov To: "Kenneth D. Merry" Subject: Re: svn commit: r227530 - head/sys/vm Message-ID: <20130108234554.GD2561@kib.kiev.ua> References: <201111151440.pAFEe0xJ004636@svn.freebsd.org> <20130108221134.GA75088@nargothrond.kdm.org> <20130108224931.GC2561@kib.kiev.ua> <20130108230311.GA77847@nargothrond.kdm.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bjuZg6miEcdLYP6q" Content-Disposition: inline In-Reply-To: <20130108230311.GA77847@nargothrond.kdm.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@FreeBSD.org, alc@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 23:46:05 -0000 --bjuZg6miEcdLYP6q Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 08, 2013 at 04:03:11PM -0700, Kenneth D. Merry wrote: > On Wed, Jan 09, 2013 at 00:49:31 +0200, Konstantin Belousov wrote: > > On Tue, Jan 08, 2013 at 03:11:34PM -0700, Kenneth D. Merry wrote: > > > On Tue, Nov 15, 2011 at 14:40:00 +0000, Konstantin Belousov wrote: > > > > Author: kib > > > > Date: Tue Nov 15 14:40:00 2011 > > > > New Revision: 227530 > > > > URL: http://svn.freebsd.org/changeset/base/227530 > > > >=20 > > > > Log: > > > > Update the device pager interface, while keeping the compatibility > > > > layer for old KPI and KBI. New interface should be used together= with > > > > d_mmap_single cdevsw method. > > > > =20 > > > > Device pager can be allocated with the cdev_pager_allocate(9) > > > > function, which takes struct cdev_pager_ops, containing > > > > constructor/destructor and page fault handler methods supplied by > > > > driver. > > > > =20 > > > > Constructor and destructor, called at the pager allocation and > > > > deallocation time, allow the driver to handle per-object private = data. > > > > =20 > > > > The pager handler is called to handle page fault on the vm map en= try > > > > backed by the driver pager. Driver shall return either the vm_pag= e_t > > > > which should be mapped, or error code (which does not cause kernel > > > > panic anymore). The page handler interface has a placeholder to > > > > specify the access mode causing the fault, but currently PROT_REA= D is > > > > always passed there. > > > > =20 > > > > Sponsored by: The FreeBSD Foundation > > > > Reviewed by: alc > > > > MFC after: 1 month > > >=20 > > > This is an old commit, but I believe there is a bug introduced by this > > > commit that triggered the following panic: > > >=20 > > > panic: dev_rel((null)) gave negative count > > > cpuid =3D 5 > > > KDB: stack backtrace: > > > db_trace_self_wrapper() at 0xffffffff803639da =3D db_trace_self_wrapp= er+0x2a > > > kdb_backtrace() at 0xffffffff8090e677 =3D kdb_backtrace+0x37 > > > panic() at 0xffffffff808d6bd8 =3D panic+0x1d8 > > > dev_rel() at 0xffffffff8088f929 =3D dev_rel+0xc9 > > > dev_pager_dealloc() at 0xffffffff80b2be30 =3D dev_pager_dealloc+0x30 > > > vm_object_terminate() at 0xffffffff80b44d7d =3D vm_object_terminate+0= x13d > > > vm_object_deallocate() at 0xffffffff80b465ca =3D vm_object_deallocate= +0x17a > > > cdev_pager_allocate() at 0xffffffff80b2c5e6 =3D cdev_pager_allocate+0= x236 > > > dev_pager_alloc() at 0xffffffff80b2c697 =3D dev_pager_alloc+0x27 > > > vm_mmap_cdev() at 0xffffffff80b41b86 =3D vm_mmap_cdev+0x116 > > > vm_mmap() at 0xffffffff80b42221 =3D vm_mmap+0x671 > > > sys_mmap() at 0xffffffff80b428c6 =3D sys_mmap+0x1d6 > > > amd64_syscall() at 0xffffffff80bd1ed8 =3D amd64_syscall+0x318 > > > Xfast_syscall() at 0xffffffff80bbd387 =3D Xfast_syscall+0xf7 > > > --- syscall (477, FreeBSD ELF64, sys_mmap), rip =3D 0x8008ae25c, rsp = =3D > > > 0x7fffffffd968, rbp =3D 0 --- > > > KDB: enter: panic > > > [ thread pid 4109 tid 102348 ] > > > Stopped at 0xffffffff8090e33b =3D kdb_enter+0x3b: movq $0,0xb= 433e2(%rip) > > >=20 > > > This is a stable/9 system, but the code is the same in head. > > >=20 > > > I triggered it by running dmidecode (perhaps a few times) on a machin= e with > > > INVARIANTS enabled. You can probably trigger it before too long with > > > something like this: > > >=20 > > > ((i=3D0)); while [ $i -lt 50 ]; do dmidecode > /dev/null & ((i++)); d= one > > >=20 > > > Run that loop until the system panics. > > >=20 > > > The problem is that dev_pager_dealloc() passes in the VM object handl= e to > > > the cdev_pg_dtor() method (in this case old_dev_pager_dtor()), which > > > assumes that it is a struct cdev. > > >=20 > > > But there is a case in cdev_pager_allocate() where if a race conditio= n is > > > hit, the object handle is set to the object itself. In that case, we= wind > > > up triggering an assertion in dev_rel(), because it is not operating = on a > > > struct cdev, but rather a VM object. > > >=20 > > > I've attached my local commit and diffs. This does work, but you may > > > have a better solution. > > >=20 > > > Thanks, > > >=20 > > > Ken > > > --=20 > > > Kenneth Merry > > > ken@FreeBSD.ORG > >=20 > > > Change 649772 by kenm@ken.spectrabsd9 on 2013/01/08 14:54:45 > > >=20 > > > Fix a bug in the device pager code that can trigger an assertion > > > in devfs if a particular race condition is hit in the device pager > > > code. > > > =09 > > > This fixes BUG25532. > > > =09 > > > This was a side effect of FreeBSD SVN change 227530 (our Perforce > > > change 513754), which changed the device pager interface to call > > > a new destructor routine for the cdev. That destructor routine, > > > old_dev_pager_dtor(), takes a VM object handle. > > > =09 > > > The object handle is cast to a struct cdev *, and passed into > > > dev_rel(). > > > =09 > > > That works in most cases, except the case in cdev_pager_allocate() > > > where there is a race condition between two threads allocating an > > > object backed by the same device. The loser of the race > > > deallocates its object at the end of the function. > > > =09 > > > The problem is that before inserting the object into the > > > dev_pager_object_list, the object's handle is changed from the > > > struct cdev pointer to the object's own address. This is to avoid > > > conflicts with the winner of the race, which already inserted an > > > object in the list with a handle that is a pointer to the same cdev > > > structure. > > > =09 > > > The object is then passed to vm_object_deallocate(), and eventually > > > makes its way down to old_dev_pager_dtor(). That function passes > > > the handle pointer (which is actually a VM object, not a struct > > > cdev as usual) into dev_rel(). dev_rel() decrements the reference > > > count in the assumed struct cdev (which happens to be 0), and > > > that triggers the assertion in dev_rel() that the reference count > > > is greater than or equal to 0. > > > =09 > > > The fix is to add a cdev pointer to the VM object, and use that > > > pointer when calling the cdev_pg_dtor() routine. There may be > > > other, better, ways to fix this, so I'll ask for a review by the > > > appropriate FreeBSD VM maintainers. > > > =09 > > > vm_object.h: Add a struct cdev pointer to the VM object > > > structure. > > > =09 > > > device_pager.c: In cdev_pager_allocate(), populate the new cdev > > > pointer. > > > =09 > > > In dev_pager_dealloc(), use the new cdev pointer > > > when calling the object's cdev_pg_dtor() routine. > > > =09 > > > TeamTrack: BUG25532 > > >=20 > > > Affected files ... > > >=20 > > > ... //SpectraBSD/stable/sys/vm/device_pager.c#3 edit > > > ... //SpectraBSD/stable/sys/vm/vm_object.h#3 edit > > >=20 > > > Differences ... > > >=20 > > > =3D=3D=3D=3D //SpectraBSD/stable/sys/vm/device_pager.c#3 (text) =3D= =3D=3D=3D > > >=20 > > > @@ -156,6 +156,7 @@ > > > object1->pg_color =3D color; > > > object1->handle =3D handle; > > > object1->un_pager.devp.ops =3D ops; > > > + object1->un_pager.devp.dev =3D handle; > > > TAILQ_INIT(&object1->un_pager.devp.devp_pglist); > > > mtx_lock(&dev_pager_mtx); > > > object =3D vm_pager_object_lookup(&dev_pager_object_list, handle); > > > @@ -233,7 +234,7 @@ > > > vm_page_t m; > > > =20 > > > VM_OBJECT_UNLOCK(object); > > > - object->un_pager.devp.ops->cdev_pg_dtor(object->handle); > > > + object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.dev); > > > =20 > > > mtx_lock(&dev_pager_mtx); > > > TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list); > > >=20 > > > =3D=3D=3D=3D //SpectraBSD/stable/sys/vm/vm_object.h#3 (text) =3D=3D= =3D=3D > > >=20 > > > @@ -123,6 +123,7 @@ > > > struct { > > > TAILQ_HEAD(, vm_page) devp_pglist; > > > struct cdev_pager_ops *ops; > > > + struct cdev *dev; > > > } devp; > > > =20 > > > /* > >=20 > > Hm, yes, I remembered this. I had the following patch sitting in my > > local repository since the autumn, I think. > >=20 > > Might be, your solution is more clean, but the main idea is the same, > > to put the cdev pointer into the additional place. >=20 > Okay, cool! >=20 > Well, in that case could you pick the solution you prefer and commit it? Please commit your change yourself. Note that merge to stable/9 would probably require moving the devp.dev member out of the union, to the end of the structure, to preserve struct vm_object layout. --bjuZg6miEcdLYP6q Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ7K+xAAoJEJDCuSvBvK1BSJoP/jkTe/G6aR7SZsuWCCrVVgbT bm09+zkaGqFopO2p834eDxGi5RO7Or8rqwBZzt3q8kvhLV0OMkRrzN0CkIptfNsG kfc4DgOotVyToeJgRyXD7D15OX4J6o2E+iGklFpntioDwfvJfJFYYZGrgBKtMsNY UzGsRyZamzvRQtLtOXyj/j5B/fHDstI8Os3ktuMx8QihU0lbJy1I71w/0hTasHPR fz/7OyUZG5O8aUJw/h163dop7nIfDVawJ4XzEGxsoYTKj+Zv9OvBGLTbVtOaJSOW kAiFO+9bQ4O70S2Zjt3eYZckXbVE/AsKgIwMFQDq6qbFw4iPohGpM2y0Y1aHYGfo 6oz5v4qOiEWY382F2y+kfnGY31qTT9El3KEhmYR1TUHVoWl137q6/wbl2/vTtrf2 PssGqBptBOTNNS4H1gKUIUM0avXk8YR6v9pQRQFsT1kISMT223slse7Jb1AgZPWx rC5PN1SY8ZLgQTfjXYDC/RJmfg8dLbQFQqkYUV31acWGFwcQKsSJjVDf6WNoYKpH oOhU9Qgq6lXaxXmi3LeV5AWA1dliT9ATzaoMTRY3S6erE2P43NT4iIH5rbZBWPlA ZKkuyTd+Abz1CU21Yo8bjMT2WhuIfgBlGGh/c1PDRV05OhCQcf8OIngwKG/+MMzh MebKALEvzvughhQt6skv =MFyj -----END PGP SIGNATURE----- --bjuZg6miEcdLYP6q-- From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 00:36:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DB28CA04; Wed, 9 Jan 2013 00:36:06 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE39F7D5; Wed, 9 Jan 2013 00:36:06 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r090a6Fj065526; Wed, 9 Jan 2013 00:36:06 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r090a6va065525; Wed, 9 Jan 2013 00:36:06 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201301090036.r090a6va065525@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 9 Jan 2013 00:36:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245199 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 00:36:06 -0000 Author: ae Date: Wed Jan 9 00:36:06 2013 New Revision: 245199 URL: http://svnweb.freebsd.org/changeset/base/245199 Log: The in6_setscope() function determines the scope zone id of an address and embeds it into address. Inside the kernel we keep addresses with embedded zone id only for two scopes: link-local and interface-local. For other scopes this function is nop in most cases. To reduce an overhead of locking, first check that address is capable for embedding. Also, handle the loopback address before acquire the lock. Sponsored by: Yandex LLC MFC after: 1 week Modified: head/sys/netinet6/scope6.c Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Wed Jan 9 00:22:53 2013 (r245198) +++ head/sys/netinet6/scope6.c Wed Jan 9 00:36:06 2013 (r245199) @@ -420,33 +420,34 @@ in6_setscope(struct in6_addr *in6, struc u_int32_t zoneid = 0; struct scope6_id *sid; - IF_AFDATA_RLOCK(ifp); - - sid = SID(ifp); - -#ifdef DIAGNOSTIC - if (sid == NULL) { /* should not happen */ - panic("in6_setscope: scope array is NULL"); - /* NOTREACHED */ - } -#endif - /* * special case: the loopback address can only belong to a loopback * interface. */ if (IN6_IS_ADDR_LOOPBACK(in6)) { if (!(ifp->if_flags & IFF_LOOPBACK)) { - IF_AFDATA_RUNLOCK(ifp); return (EINVAL); } else { if (ret_id != NULL) *ret_id = 0; /* there's no ambiguity */ - IF_AFDATA_RUNLOCK(ifp); return (0); } } + if (ret_id == NULL && !IN6_IS_SCOPE_EMBED(in6)) + return (0); + + IF_AFDATA_RLOCK(ifp); + + sid = SID(ifp); + +#ifdef DIAGNOSTIC + if (sid == NULL) { /* should not happen */ + panic("in6_setscope: scope array is NULL"); + /* NOTREACHED */ + } +#endif + scope = in6_addrscope(in6); switch (scope) { case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */ @@ -474,7 +475,7 @@ in6_setscope(struct in6_addr *in6, struc if (ret_id != NULL) *ret_id = zoneid; - if (IN6_IS_SCOPE_LINKLOCAL(in6) || IN6_IS_ADDR_MC_INTFACELOCAL(in6)) + if (IN6_IS_SCOPE_EMBED(in6)) in6->s6_addr16[1] = htons(zoneid & 0xffff); /* XXX */ return (0); From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 01:52:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5BAAF88B; Wed, 9 Jan 2013 01:52:29 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 353ED9F0; Wed, 9 Jan 2013 01:52:29 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r091qTtQ087669; Wed, 9 Jan 2013 01:52:29 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r091qTcX087668; Wed, 9 Jan 2013 01:52:29 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201301090152.r091qTcX087668@svn.freebsd.org> From: Olivier Houchard Date: Wed, 9 Jan 2013 01:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245202 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 01:52:29 -0000 Author: cognet Date: Wed Jan 9 01:52:28 2013 New Revision: 245202 URL: http://svnweb.freebsd.org/changeset/base/245202 Log: Use get_pcpu() instead of using pcpup, as it's wrong for SMP. Submitted by: Lukasz Plachno Modified: head/sys/arm/include/pcpu.h Modified: head/sys/arm/include/pcpu.h ============================================================================== --- head/sys/arm/include/pcpu.h Wed Jan 9 01:19:30 2013 (r245201) +++ head/sys/arm/include/pcpu.h Wed Jan 9 01:52:28 2013 (r245202) @@ -100,8 +100,8 @@ set_tls(void *tls) #define PCPU_GET(member) (get_pcpu()->pc_ ## member) #define PCPU_ADD(member, value) (get_pcpu()->pc_ ## member += (value)) #define PCPU_INC(member) PCPU_ADD(member, 1) -#define PCPU_PTR(member) (&pcpup->pc_ ## member) -#define PCPU_SET(member,value) (pcpup->pc_ ## member = (value)) +#define PCPU_PTR(member) (&get_pcpu()->pc_ ## member) +#define PCPU_SET(member,value) (get_pcpu()->pc_ ## member = (value)) void pcpu0_init(void); #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 01:54:18 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6B6D5A09; Wed, 9 Jan 2013 01:54:18 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 52A50A01; Wed, 9 Jan 2013 01:54:18 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r091sIPt087891; Wed, 9 Jan 2013 01:54:18 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r091sICr087890; Wed, 9 Jan 2013 01:54:18 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201301090154.r091sICr087890@svn.freebsd.org> From: Olivier Houchard Date: Wed, 9 Jan 2013 01:54:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245203 - head/sys/arm/ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 01:54:18 -0000 Author: cognet Date: Wed Jan 9 01:54:17 2013 New Revision: 245203 URL: http://svnweb.freebsd.org/changeset/base/245203 Log: Define IPI_IRQ_START and IPI_IRQ_END. Modified: head/sys/arm/ti/omap4/std.omap4 Modified: head/sys/arm/ti/omap4/std.omap4 ============================================================================== --- head/sys/arm/ti/omap4/std.omap4 Wed Jan 9 01:52:28 2013 (r245202) +++ head/sys/arm/ti/omap4/std.omap4 Wed Jan 9 01:54:17 2013 (r245203) @@ -19,3 +19,7 @@ options STARTUP_PAGETABLE_ADDR=0x800000 options SOC_OMAP4 options ARM_L2_PIPT + +options IPI_IRQ_START=0 +options IPI_IRQ_END=15 + From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 02:11:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 516C0DD8; Wed, 9 Jan 2013 02:11:17 +0000 (UTC) (envelope-from neel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F90FA92; Wed, 9 Jan 2013 02:11:17 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r092BHu8093542; Wed, 9 Jan 2013 02:11:17 GMT (envelope-from neel@svn.freebsd.org) Received: (from neel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r092BHxV093541; Wed, 9 Jan 2013 02:11:17 GMT (envelope-from neel@svn.freebsd.org) Message-Id: <201301090211.r092BHxV093541@svn.freebsd.org> From: Neel Natu Date: Wed, 9 Jan 2013 02:11:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245204 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 02:11:17 -0000 Author: neel Date: Wed Jan 9 02:11:16 2013 New Revision: 245204 URL: http://svnweb.freebsd.org/changeset/base/245204 Log: Add a "pause" to busy wait loops in the cpu reset path. This should not matter much when running on bare metal but it makes the guest more friendly when running inside a virtual machine. Discussed with: jhb Obtained from: NetApp Modified: head/sys/amd64/amd64/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Wed Jan 9 01:54:17 2013 (r245203) +++ head/sys/amd64/amd64/vm_machdep.c Wed Jan 9 02:11:16 2013 (r245204) @@ -575,7 +575,8 @@ cpu_reset_proxy() cpu_reset_proxy_active = 1; while (cpu_reset_proxy_active == 1) - ; /* Wait for other cpu to see that we've started */ + ia32_pause(); /* Wait for other cpu to see that we've started */ + CPU_SETOF(cpu_reset_proxyid, &tcrp); stop_cpus(tcrp); printf("cpu_reset_proxy: Stopped CPU %d\n", cpu_reset_proxyid); @@ -611,14 +612,17 @@ cpu_reset() wmb(); cnt = 0; - while (cpu_reset_proxy_active == 0 && cnt < 10000000) + while (cpu_reset_proxy_active == 0 && cnt < 10000000) { + ia32_pause(); cnt++; /* Wait for BSP to announce restart */ + } if (cpu_reset_proxy_active == 0) printf("cpu_reset: Failed to restart BSP\n"); enable_intr(); cpu_reset_proxy_active = 2; - while (1); + while (1) + ia32_pause(); /* NOTREACHED */ } From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 09:09:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3904BCB3; Wed, 9 Jan 2013 09:09:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2C781B47; Wed, 9 Jan 2013 09:09:10 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0999AxV013795; Wed, 9 Jan 2013 09:09:10 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09999kV013794; Wed, 9 Jan 2013 09:09:09 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301090909.r09999kV013794@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 9 Jan 2013 09:09:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245222 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 09:09:10 -0000 Author: hselasky Date: Wed Jan 9 09:09:09 2013 New Revision: 245222 URL: http://svnweb.freebsd.org/changeset/base/245222 Log: Fix compile warning when using GCC: Comparison between signed and unsigned. MFC after: 1 week Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Jan 9 08:52:44 2013 (r245221) +++ head/sys/sys/mbuf.h Wed Jan 9 09:09:09 2013 (r245222) @@ -557,7 +557,7 @@ m_get2(int how, short type, int flags, i args.flags = flags; args.type = type; - if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) + if (size <= ((int)MHLEN) || (size <= ((int)MLEN) && (flags & M_PKTHDR) == 0)) return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); if (size <= MCLBYTES) return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 09:12:20 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3A217E33; Wed, 9 Jan 2013 09:12:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) by mx1.freebsd.org (Postfix) with ESMTP id 9CD05B5D; Wed, 9 Jan 2013 09:12:18 +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 r099CH2w075309; Wed, 9 Jan 2013 13:12:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id r099CHfF075308; Wed, 9 Jan 2013 13:12:17 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 9 Jan 2013 13:12:17 +0400 From: Gleb Smirnoff To: Hans Petter Selasky Subject: Re: svn commit: r245222 - head/sys/sys Message-ID: <20130109091217.GL66284@FreeBSD.org> References: <201301090909.r09999kV013794@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201301090909.r09999kV013794@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 09:12:20 -0000 On Wed, Jan 09, 2013 at 09:09:09AM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Wed Jan 9 09:09:09 2013 H> New Revision: 245222 H> URL: http://svnweb.freebsd.org/changeset/base/245222 H> H> Log: H> Fix compile warning when using GCC: H> Comparison between signed and unsigned. H> H> MFC after: 1 week H> H> Modified: H> head/sys/sys/mbuf.h H> H> Modified: head/sys/sys/mbuf.h H> ============================================================================== H> --- head/sys/sys/mbuf.h Wed Jan 9 08:52:44 2013 (r245221) H> +++ head/sys/sys/mbuf.h Wed Jan 9 09:09:09 2013 (r245222) H> @@ -557,7 +557,7 @@ m_get2(int how, short type, int flags, i H> args.flags = flags; H> args.type = type; H> H> - if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) H> + if (size <= ((int)MHLEN) || (size <= ((int)MLEN) && (flags & M_PKTHDR) == 0)) H> return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); H> if (size <= MCLBYTES) H> return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); The function is new and present only in head. I suggest just change its argument to u_int or size_t, instead of casting. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 09:29:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EC581900; Wed, 9 Jan 2013 09:29:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF87BFF4; Wed, 9 Jan 2013 09:29:22 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r099TMtd019447; Wed, 9 Jan 2013 09:29:22 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r099TMew019446; Wed, 9 Jan 2013 09:29:22 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301090929.r099TMew019446@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 9 Jan 2013 09:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245223 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 09:29:23 -0000 Author: hselasky Date: Wed Jan 9 09:29:22 2013 New Revision: 245223 URL: http://svnweb.freebsd.org/changeset/base/245223 Log: Change function argument type instead of casting. Suggested by: glebius @ Modified: head/sys/sys/mbuf.h Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Wed Jan 9 09:09:09 2013 (r245222) +++ head/sys/sys/mbuf.h Wed Jan 9 09:29:22 2013 (r245223) @@ -396,7 +396,7 @@ extern uma_zone_t zone_ext_refcnt; static __inline struct mbuf *m_getcl(int how, short type, int flags); static __inline struct mbuf *m_get(int how, short type); static __inline struct mbuf *m_get2(int how, short type, int flags, - int size); + u_int size); static __inline struct mbuf *m_gethdr(int how, short type); static __inline struct mbuf *m_getjcl(int how, short type, int flags, int size); @@ -548,7 +548,7 @@ m_getcl(int how, short type, int flags) * XXX: This is rather large, should be real function maybe. */ static __inline struct mbuf * -m_get2(int how, short type, int flags, int size) +m_get2(int how, short type, int flags, u_int size) { struct mb_args args; struct mbuf *m, *n; @@ -557,7 +557,7 @@ m_get2(int how, short type, int flags, i args.flags = flags; args.type = type; - if (size <= ((int)MHLEN) || (size <= ((int)MLEN) && (flags & M_PKTHDR) == 0)) + if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); if (size <= MCLBYTES) return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 15:22:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C389B20; Wed, 9 Jan 2013 15:22:38 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F347E80E; Wed, 9 Jan 2013 15:22:37 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09FMbom022814; Wed, 9 Jan 2013 15:22:37 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09FMbP5022813; Wed, 9 Jan 2013 15:22:37 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201301091522.r09FMbP5022813@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 9 Jan 2013 15:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245225 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 15:22:38 -0000 Author: ume Date: Wed Jan 9 15:22:37 2013 New Revision: 245225 URL: http://svnweb.freebsd.org/changeset/base/245225 Log: Disable destination address selection support of getipnodebyname(1). RFC 2553 mentions IPv6 addresses are returned 1st. Spotted by: uqs MFC after: 1 week Modified: head/lib/libc/net/name6.c Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Wed Jan 9 11:58:47 2013 (r245224) +++ head/lib/libc/net/name6.c Wed Jan 9 15:22:37 2013 (r245225) @@ -200,6 +200,7 @@ static struct hostent *_hpmapv6(struct #endif static struct hostent *_hpsort(struct hostent *, res_state); +#ifdef ENABLE_IP6ADDRCTL static struct hostent *_hpreorder(struct hostent *); static int get_addrselectpolicy(struct policyhead *); static void free_addrselectpolicy(struct policyhead *); @@ -209,6 +210,7 @@ static void set_source(struct hp_order static int matchlen(struct sockaddr *, struct sockaddr *); static int comp_dst(const void *, const void *); static int gai_addr2scopetype(struct sockaddr *); +#endif /* * Functions defined in RFC2553 @@ -309,7 +311,11 @@ getipnodebyname(const char *name, int af *errp = statp->res_h_errno; statp->options = options; +#ifdef ENABLE_IP6ADDRCTL return _hpreorder(_hpsort(hp, statp)); +#else + return _hpsort(hp, statp); +#endif } struct hostent * @@ -632,6 +638,7 @@ _hpsort(struct hostent *hp, res_state st return hp; } +#ifdef ENABLE_IP6ADDRCTL /* * _hpreorder: sort address by default address selection */ @@ -1109,3 +1116,4 @@ gai_addr2scopetype(struct sockaddr *sa) return(-1); } } +#endif From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 16:48:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 214DE5E5; Wed, 9 Jan 2013 16:48:39 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CDB5DD15; Wed, 9 Jan 2013 16:48:38 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09GmcbD048697; Wed, 9 Jan 2013 16:48:38 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09Gmcki048695; Wed, 9 Jan 2013 16:48:38 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201301091648.r09Gmcki048695@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 9 Jan 2013 16:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245226 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 16:48:39 -0000 Author: ken Date: Wed Jan 9 16:48:38 2013 New Revision: 245226 URL: http://svnweb.freebsd.org/changeset/base/245226 Log: Fix a bug in the device pager code that can trigger an assertion in devfs if a particular race condition is hit in the device pager code. This was a side effect of change 227530 which changed the device pager interface to call a new destructor routine for the cdev. That destructor routine, old_dev_pager_dtor(), takes a VM object handle. The object handle is cast to a struct cdev *, and passed into dev_rel(). That works in most cases, except the case in cdev_pager_allocate() where there is a race condition between two threads allocating an object backed by the same device. The loser of the race deallocates its object at the end of the function. The problem is that before inserting the object into the dev_pager_object_list, the object's handle is changed from the struct cdev pointer to the object's own address. This is to avoid conflicts with the winner of the race, which already inserted an object in the list with a handle that is a pointer to the same cdev structure. The object is then passed to vm_object_deallocate(), and eventually makes its way down to old_dev_pager_dtor(). That function passes the handle pointer (which is actually a VM object, not a struct cdev as usual) into dev_rel(). dev_rel() decrements the reference count in the assumed struct cdev (which happens to be 0), and that triggers the assertion in dev_rel() that the reference count is greater than or equal to 0. The fix is to add a cdev pointer to the VM object, and use that pointer when calling the cdev_pg_dtor() routine. vm_object.h: Add a struct cdev pointer to the VM object structure. device_pager.c: In cdev_pager_allocate(), populate the new cdev pointer. In dev_pager_dealloc(), use the new cdev pointer when calling the object's cdev_pg_dtor() routine. Reviewed by: kib Sponsored by: Spectra Logic Corporation MFC after: 1 week Modified: head/sys/vm/device_pager.c head/sys/vm/vm_object.h Modified: head/sys/vm/device_pager.c ============================================================================== --- head/sys/vm/device_pager.c Wed Jan 9 15:22:37 2013 (r245225) +++ head/sys/vm/device_pager.c Wed Jan 9 16:48:38 2013 (r245226) @@ -158,6 +158,7 @@ cdev_pager_allocate(void *handle, enum o object1->pg_color = color; object1->handle = handle; object1->un_pager.devp.ops = ops; + object1->un_pager.devp.dev = handle; TAILQ_INIT(&object1->un_pager.devp.devp_pglist); mtx_lock(&dev_pager_mtx); object = vm_pager_object_lookup(&dev_pager_object_list, handle); @@ -235,7 +236,7 @@ dev_pager_dealloc(object) vm_page_t m; VM_OBJECT_UNLOCK(object); - object->un_pager.devp.ops->cdev_pg_dtor(object->handle); + object->un_pager.devp.ops->cdev_pg_dtor(object->un_pager.devp.dev); mtx_lock(&dev_pager_mtx); TAILQ_REMOVE(&dev_pager_object_list, object, pager_object_list); Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Wed Jan 9 15:22:37 2013 (r245225) +++ head/sys/vm/vm_object.h Wed Jan 9 16:48:38 2013 (r245226) @@ -136,6 +136,7 @@ struct vm_object { struct { TAILQ_HEAD(, vm_page) devp_pglist; struct cdev_pager_ops *ops; + struct cdev *dev; } devp; /* From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 17:02:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 21ED6DA1; Wed, 9 Jan 2013 17:02:09 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0ED53E5F; Wed, 9 Jan 2013 17:02:09 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09H28IO053603; Wed, 9 Jan 2013 17:02:08 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09H28TD053601; Wed, 9 Jan 2013 17:02:08 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201301091702.r09H28TD053601@svn.freebsd.org> From: "Kenneth D. Merry" Date: Wed, 9 Jan 2013 17:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245228 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 17:02:09 -0000 Author: ken Date: Wed Jan 9 17:02:08 2013 New Revision: 245228 URL: http://svnweb.freebsd.org/changeset/base/245228 Log: Make CTL work a little better with loading and unloading drivers. Previously CTL would leave individual LUNs enabled in the target driver, whether or not the port as a whole was enabled. It would also leave the wildcard LUN enabled indefinitely. This change means that CTL will enable and disable any active LUNs, as well as the wildcard LUN, when enabling and disabling a port. Also, fix a bug that could crop up due to an uninitialized CCB type. ctl.c: Before calling ctl_frontend_online(), run through the LUN list and enable all active LUNs. After calling ctl_frontend_offline(), run through the LUN list and disble all active LUNs. scsi_ctl.c: Before bringing a port online, allocate the wildcard peripheral for that bus. And after taking a port offline, invalidate the wildcard peripheral for that bus. Make sure that we hold the SIM lock around all calls to xpt_action() and other transport layer interfaces that require it. Use CAM_SIM_{LOCK|UNLOCK} consistently to acquire and release the SIM lock. Update a number of outdated comments. Some of these should have been fixed long ago. Actually do LUN disbables now. The newer drivers in the tree work correctly for this as far as I know. Initialize the CCB type to CTLFE_CCB_DEFAULT to avoid a panic due to uninitialized memory. Submitted by: Chuck Tuffli (partially) MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Jan 9 16:51:47 2013 (r245227) +++ head/sys/cam/ctl/ctl.c Wed Jan 9 17:02:08 2013 (r245228) @@ -2257,11 +2257,31 @@ ctl_ioctl(struct cdev *dev, u_long cmd, */ mtx_unlock(&softc->ctl_lock); - if (cmd == CTL_ENABLE_PORT) + if (cmd == CTL_ENABLE_PORT) { + struct ctl_lun *lun; + + STAILQ_FOREACH(lun, &softc->lun_list, + links) { + fe->lun_enable(fe->targ_lun_arg, + lun->target, + lun->lun); + } + ctl_frontend_online(fe); - else if (cmd == CTL_DISABLE_PORT) + } else if (cmd == CTL_DISABLE_PORT) { + struct ctl_lun *lun; + ctl_frontend_offline(fe); + STAILQ_FOREACH(lun, &softc->lun_list, + links) { + fe->lun_disable( + fe->targ_lun_arg, + lun->target, + lun->lun); + } + } + mtx_lock(&softc->ctl_lock); if (cmd == CTL_SET_PORT_WWNS) Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Wed Jan 9 16:51:47 2013 (r245227) +++ head/sys/cam/ctl/scsi_ctl.c Wed Jan 9 17:02:08 2013 (r245228) @@ -73,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include typedef enum { + CTLFE_CCB_DEFAULT = 0x00, CTLFE_CCB_WAITING = 0x01 } ctlfe_ccb_types; @@ -304,10 +305,7 @@ ctlfeasync(void *callback_arg, uint32_t case AC_PATH_REGISTERED: { struct ctl_frontend *fe; struct ctlfe_softc *bus_softc; - struct ctlfe_lun_softc *lun_softc; - struct cam_path *path; struct ccb_pathinq *cpi; - cam_status status; int retval; cpi = (struct ccb_pathinq *)arg; @@ -330,7 +328,6 @@ ctlfeasync(void *callback_arg, uint32_t M_NOWAIT | M_ZERO); if (ccb == NULL) { printf("%s: unable to malloc CCB!\n", __func__); - xpt_free_path(path); return; } xpt_setup_ccb(&ccb->ccb_h, cpi->ccb_h.path, @@ -448,44 +445,31 @@ ctlfeasync(void *callback_arg, uint32_t mtx_unlock(&ctlfe_list_mtx); } - status = xpt_create_path(&path, /*periph*/ NULL, - bus_softc->path_id,CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD); - if (status != CAM_REQ_CMP) { - printf("%s: unable to create path for wildcard " - "periph\n", __func__); - break; - } - lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, - M_NOWAIT | M_ZERO); - if (lun_softc == NULL) { - xpt_print(path, "%s: unable to allocate softc for " - "wildcard periph\n", __func__); - xpt_free_path(path); - break; - } - - lun_softc->parent_softc = bus_softc; - lun_softc->flags |= CTLFE_LUN_WILDCARD; - - status = cam_periph_alloc(ctlferegister, - ctlfeoninvalidate, - ctlfecleanup, - ctlfestart, - "ctl", - CAM_PERIPH_BIO, - path, - ctlfeasync, - 0, - lun_softc); + break; + } + case AC_PATH_DEREGISTERED: { + struct ctlfe_softc *softc = NULL; - xpt_free_path(path); + mtx_lock(&ctlfe_list_mtx); + STAILQ_FOREACH(softc, &ctlfe_softc_list, links) { + if (softc->path_id == xpt_path_path_id(path)) { + STAILQ_REMOVE(&ctlfe_softc_list, softc, + ctlfe_softc, links); + break; + } + } + mtx_unlock(&ctlfe_list_mtx); + if (softc != NULL) { + /* + * XXX KDM are we certain at this point that there + * are no outstanding commands for this frontend? + */ + ctl_frontend_deregister(&softc->fe); + free(softc, M_CTLFE); + } break; } - case AC_PATH_DEREGISTERED: - /* ctl_frontend_deregister() */ - break; case AC_CONTRACT: { struct ac_contract *ac; @@ -699,11 +683,14 @@ ctlfecleanup(struct cam_periph *periph) softc = (struct ctlfe_lun_softc *)periph->softc; bus_softc = softc->parent_softc; - STAILQ_REMOVE(&bus_softc->lun_softc_list, softc, ctlfe_lun_softc,links); + STAILQ_REMOVE(&bus_softc->lun_softc_list, softc, ctlfe_lun_softc, links); /* * XXX KDM is there anything else that needs to be done here? */ + + callout_stop(&softc->dma_callout); + free(softc, M_CTLFE); } @@ -717,6 +704,8 @@ ctlfestart(struct cam_periph *periph, un softc->ccbs_alloced++; + start_ccb->ccb_h.ccb_type = CTLFE_CCB_DEFAULT; + ccb_h = TAILQ_FIRST(&softc->work_queue); if (periph->immediate_priority <= periph->pinfo.priority) { panic("shouldn't get to the CCB waiting case!"); @@ -857,8 +846,6 @@ ctlfestart(struct cam_periph *periph, un /* * Datamove call, we need to setup the S/G list. - * If we pass in a S/G list, the isp(4) driver at - * least expects physical/bus addresses. */ cmd_info = (struct ctlfe_lun_cmd_info *) @@ -933,12 +920,13 @@ ctlfestart(struct cam_periph *periph, un int *ti; /* - * XXX KDM this is a temporary hack. The - * isp(4) driver can't deal with S/G lists - * with virtual pointers, so we need to - * go through and send down one virtual - * pointer at a time. + * If we have more S/G list pointers than + * will fit in the available storage in the + * cmd_info structure inside the ctl_io header, + * then we need to send down the pointers + * one element at a time. */ + sglist = (struct ctl_sg_entry *) io->scsiio.kern_data_ptr; ti = &cmd_info->cur_transfer_index; @@ -1405,13 +1393,15 @@ ctlfedone(struct cam_periph *periph, uni break; default: /* - * XXX KDM the isp(4) driver doesn't really - * seem to send errors back for data - * transfers that I can tell. There is one - * case where it'll send CAM_REQ_CMP_ERR, - * but probably not that many more cases. - * So set a generic data phase error here, - * like the SXP driver sets. + * XXX KDM we probably need to figure out a + * standard set of errors that the SIM + * drivers should return in the event of a + * data transfer failure. A data phase + * error will at least point the user to a + * data transfer error of some sort. + * Hopefully the SIM printed out some + * additional information to give the user + * a clue what happened. */ io->io_hdr.port_status = 0xbad1; ctl_set_data_phase_error(&io->scsiio); @@ -1689,20 +1679,22 @@ ctlfe_onoffline(void *arg, int online) sim = bus_softc->sim; - CAM_SIM_LOCK(sim); + mtx_assert(sim->mtx, MA_OWNED); + status = xpt_create_path(&path, /*periph*/ NULL, bus_softc->path_id, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD); if (status != CAM_REQ_CMP) { printf("%s: unable to create path!\n", __func__); - CAM_SIM_UNLOCK(sim); return; } - CAM_SIM_UNLOCK(sim); - - ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_WAITOK | M_ZERO); + ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_NOWAIT | M_ZERO); + if (ccb == NULL) { + printf("%s: unable to malloc CCB!\n", __func__); + xpt_free_path(path); + return; + } xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); - /* * Copan WWN format: * @@ -1720,11 +1712,9 @@ ctlfe_onoffline(void *arg, int online) ccb->ccb_h.func_code = XPT_GET_SIM_KNOB; - CAM_SIM_LOCK(sim); xpt_action(ccb); - CAM_SIM_UNLOCK(sim); if ((ccb->knob.xport_specific.valid & KNOB_VALID_ADDRESS) != 0){ #ifdef RANDOM_WWNN @@ -1822,9 +1812,6 @@ ctlfe_onoffline(void *arg, int online) else ccb->knob.xport_specific.fc.role = KNOB_ROLE_NONE; - - CAM_SIM_LOCK(sim); - xpt_action(ccb); if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { @@ -1841,8 +1828,6 @@ ctlfe_onoffline(void *arg, int online) xpt_free_path(path); - CAM_SIM_UNLOCK(sim); - free(ccb, M_TEMP); return; @@ -1851,13 +1836,111 @@ ctlfe_onoffline(void *arg, int online) static void ctlfe_online(void *arg) { + struct ctlfe_softc *bus_softc; + struct cam_path *path; + cam_status status; + struct ctlfe_lun_softc *lun_softc; + struct cam_sim *sim; + + bus_softc = (struct ctlfe_softc *)arg; + sim = bus_softc->sim; + + CAM_SIM_LOCK(sim); + + /* + * Create the wildcard LUN before bringing the port online. + */ + status = xpt_create_path(&path, /*periph*/ NULL, + bus_softc->path_id, CAM_TARGET_WILDCARD, + CAM_LUN_WILDCARD); + if (status != CAM_REQ_CMP) { + printf("%s: unable to create path for wildcard periph\n", + __func__); + CAM_SIM_UNLOCK(sim); + return; + } + + lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, + M_NOWAIT | M_ZERO); + if (lun_softc == NULL) { + xpt_print(path, "%s: unable to allocate softc for " + "wildcard periph\n", __func__); + xpt_free_path(path); + CAM_SIM_UNLOCK(sim); + return; + } + + lun_softc->parent_softc = bus_softc; + lun_softc->flags |= CTLFE_LUN_WILDCARD; + + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); + + + status = cam_periph_alloc(ctlferegister, + ctlfeoninvalidate, + ctlfecleanup, + ctlfestart, + "ctl", + CAM_PERIPH_BIO, + path, + ctlfeasync, + 0, + lun_softc); + + if ((status & CAM_STATUS_MASK) != CAM_REQ_CMP) { + const struct cam_status_entry *entry; + + entry = cam_fetch_status_entry(status); + + printf("%s: CAM error %s (%#x) returned from " + "cam_periph_alloc()\n", __func__, (entry != NULL) ? + entry->status_text : "Unknown", status); + } + + xpt_free_path(path); + ctlfe_onoffline(arg, /*online*/ 1); + + CAM_SIM_UNLOCK(sim); } static void ctlfe_offline(void *arg) { + struct ctlfe_softc *bus_softc; + struct cam_path *path; + cam_status status; + struct cam_periph *periph; + struct cam_sim *sim; + + bus_softc = (struct ctlfe_softc *)arg; + sim = bus_softc->sim; + + CAM_SIM_LOCK(sim); + ctlfe_onoffline(arg, /*online*/ 0); + + /* + * Disable the wildcard LUN for this port now that we have taken + * the port offline. + */ + status = xpt_create_path(&path, /*periph*/ NULL, + bus_softc->path_id, CAM_TARGET_WILDCARD, + CAM_LUN_WILDCARD); + if (status != CAM_REQ_CMP) { + CAM_SIM_UNLOCK(sim); + printf("%s: unable to create path for wildcard periph\n", + __func__); + return; + } + + + if ((periph = cam_periph_find(path, "ctl")) != NULL) + cam_periph_invalidate(periph); + + xpt_free_path(path); + + CAM_SIM_UNLOCK(sim); } static int @@ -1890,21 +1973,17 @@ ctlfe_lun_enable(void *arg, struct ctl_i bus_softc = (struct ctlfe_softc *)arg; sim = bus_softc->sim; - CAM_SIM_LOCK(sim); - - status = xpt_create_path(&path, /*periph*/ NULL, bus_softc->path_id, - targ_id.id, lun_id); + status = xpt_create_path_unlocked(&path, /*periph*/ NULL, + bus_softc->path_id, + targ_id.id, lun_id); /* XXX KDM need some way to return status to CTL here? */ if (status != CAM_REQ_CMP) { printf("%s: could not create path, status %#x\n", __func__, status); - CAM_SIM_UNLOCK(sim); return (1); } - CAM_SIM_UNLOCK(sim); softc = malloc(sizeof(*softc), M_CTLFE, M_WAITOK | M_ZERO); - CAM_SIM_LOCK(sim); periph = cam_periph_find(path, "ctl"); if (periph != NULL) { @@ -1937,23 +2016,20 @@ ctlfe_lun_enable(void *arg, struct ctl_i } /* - * XXX KDM we disable LUN removal here. The problem is that the isp(4) - * driver doesn't currently handle LUN removal properly. We need to keep - * enough state here at the peripheral level even after LUNs have been - * removed inside CTL. - * - * Once the isp(4) driver is fixed, this can be re-enabled. + * This will get called when the user removes a LUN to disable that LUN + * on every bus that is attached to CTL. */ static int ctlfe_lun_disable(void *arg, struct ctl_id targ_id, int lun_id) { -#ifdef NOTYET struct ctlfe_softc *softc; struct ctlfe_lun_softc *lun_softc; + struct cam_sim *sim; softc = (struct ctlfe_softc *)arg; + sim = softc->sim; - mtx_lock(softc->sim->mtx); + CAM_SIM_LOCK(sim); STAILQ_FOREACH(lun_softc, &softc->lun_softc_list, links) { struct cam_path *path; @@ -1965,7 +2041,7 @@ ctlfe_lun_disable(void *arg, struct ctl_ } } if (lun_softc == NULL) { - mtx_unlock(softc->sim->mtx); + CAM_SIM_UNLOCK(sim); printf("%s: can't find target %d lun %d\n", __func__, targ_id.id, lun_id); return (1); @@ -1973,8 +2049,7 @@ ctlfe_lun_disable(void *arg, struct ctl_ cam_periph_invalidate(lun_softc->periph); - mtx_unlock(softc->sim->mtx); -#endif + CAM_SIM_UNLOCK(sim); return (0); } @@ -2139,7 +2214,7 @@ ctlfe_datamove_done(union ctl_io *io) sim = xpt_path_sim(ccb->ccb_h.path); - mtx_lock(sim->mtx); + CAM_SIM_LOCK(sim); periph = xpt_path_periph(ccb->ccb_h.path); @@ -2186,7 +2261,7 @@ ctlfe_datamove_done(union ctl_io *io) xpt_schedule(periph, /*priority*/ 1); } - mtx_unlock(sim->mtx); + CAM_SIM_UNLOCK(sim); } static void From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 18:18:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1E67F2D9; Wed, 9 Jan 2013 18:18:10 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 00DD32EC; Wed, 9 Jan 2013 18:18:10 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09II9ci074795; Wed, 9 Jan 2013 18:18:09 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09II8vn074784; Wed, 9 Jan 2013 18:18:08 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201301091818.r09II8vn074784@svn.freebsd.org> From: Hajimu UMEMOTO Date: Wed, 9 Jan 2013 18:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245230 - in head: sbin/ifconfig sys/netinet6 usr.sbin/ndp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 18:18:10 -0000 Author: ume Date: Wed Jan 9 18:18:08 2013 New Revision: 245230 URL: http://svnweb.freebsd.org/changeset/base/245230 Log: Add no_prefer_iface option. It stops treating the address on the interface as special by source address selection rule even when the interface is outgoing interface. This is desired in some situation. Requested by: hrs Reviewed by: IHANet folks including hrs MFC after: 1 week Modified: head/sbin/ifconfig/af_inet6.c head/sbin/ifconfig/af_nd6.c head/sbin/ifconfig/ifconfig.8 head/sys/netinet6/in6_src.c head/sys/netinet6/nd6.h head/usr.sbin/ndp/ndp.8 head/usr.sbin/ndp/ndp.c Modified: head/sbin/ifconfig/af_inet6.c ============================================================================== --- head/sbin/ifconfig/af_inet6.c Wed Jan 9 17:09:06 2013 (r245229) +++ head/sbin/ifconfig/af_inet6.c Wed Jan 9 18:18:08 2013 (r245230) @@ -473,6 +473,8 @@ static struct cmd inet6_cmds[] = { DEF_CMD("-nud", -ND6_IFF_PERFORMNUD, setnd6flags), DEF_CMD("auto_linklocal",ND6_IFF_AUTO_LINKLOCAL,setnd6flags), DEF_CMD("-auto_linklocal",-ND6_IFF_AUTO_LINKLOCAL,setnd6flags), + DEF_CMD("no_prefer_iface",ND6_IFF_NO_PREFER_IFACE,setnd6flags), + DEF_CMD("-no_prefer_iface",-ND6_IFF_NO_PREFER_IFACE,setnd6flags), DEF_CMD_ARG("pltime", setip6pltime), DEF_CMD_ARG("vltime", setip6vltime), DEF_CMD("eui64", 0, setip6eui64), Modified: head/sbin/ifconfig/af_nd6.c ============================================================================== --- head/sbin/ifconfig/af_nd6.c Wed Jan 9 17:09:06 2013 (r245229) +++ head/sbin/ifconfig/af_nd6.c Wed Jan 9 18:18:08 2013 (r245230) @@ -58,7 +58,7 @@ static const char rcsid[] = #define MAX_SYSCTL_TRY 5 #define ND6BITS "\020\001PERFORMNUD\002ACCEPT_RTADV\003PREFER_SOURCE" \ "\004IFDISABLED\005DONT_SET_IFROUTE\006AUTO_LINKLOCAL" \ - "\007NO_RADR\020DEFAULTIF" + "\007NO_RADR\010NO_PREFER_IFACE\020DEFAULTIF" static int isnd6defif(int); void setnd6flags(const char *, int, int, const struct afswtch *); Modified: head/sbin/ifconfig/ifconfig.8 ============================================================================== --- head/sbin/ifconfig/ifconfig.8 Wed Jan 9 17:09:06 2013 (r245229) +++ head/sbin/ifconfig/ifconfig.8 Wed Jan 9 18:18:08 2013 (r245230) @@ -28,7 +28,7 @@ .\" From: @(#)ifconfig.8 8.3 (Berkeley) 1/5/94 .\" $FreeBSD$ .\" -.Dd November 7, 2012 +.Dd January 10, 2013 .Dt IFCONFIG 8 .Os .Sh NAME @@ -716,6 +716,13 @@ Set a flag to enable Neighbor Unreachabi .It Cm -nud Clear a flag .Cm nud . +.It Cm no_prefer_iface +Set a flag to not prefer address on the interface as candidates of the +source address for outgoing packets, even when the interface is +outgoing interface. +.It Cm -no_prefer_iface +Clear a flag +.Cm no_prefer_iface . .El .Pp The following parameters are specific to cloning Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Wed Jan 9 17:09:06 2013 (r245229) +++ head/sys/netinet6/in6_src.c Wed Jan 9 18:18:08 2013 (r245230) @@ -383,10 +383,12 @@ in6_selectsrc(struct sockaddr_in6 *dstso */ /* Rule 5: Prefer outgoing interface */ - if (ia_best->ia_ifp == ifp && ia->ia_ifp != ifp) - NEXT(5); - if (ia_best->ia_ifp != ifp && ia->ia_ifp == ifp) - REPLACE(5); + if (!(ND_IFINFO(ifp)->flags & ND6_IFF_NO_PREFER_IFACE)) { + if (ia_best->ia_ifp == ifp && ia->ia_ifp != ifp) + NEXT(5); + if (ia_best->ia_ifp != ifp && ia->ia_ifp == ifp) + REPLACE(5); + } /* * Rule 6: Prefer matching label Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Wed Jan 9 17:09:06 2013 (r245229) +++ head/sys/netinet6/nd6.h Wed Jan 9 18:18:08 2013 (r245230) @@ -86,6 +86,7 @@ struct nd_ifinfo { #define ND6_IFF_DONT_SET_IFROUTE 0x10 #define ND6_IFF_AUTO_LINKLOCAL 0x20 #define ND6_IFF_NO_RADR 0x40 +#define ND6_IFF_NO_PREFER_IFACE 0x80 /* XXX: not related to ND. */ #define ND6_CREATE LLE_CREATE #define ND6_EXCLUSIVE LLE_EXCLUSIVE Modified: head/usr.sbin/ndp/ndp.8 ============================================================================== --- head/usr.sbin/ndp/ndp.8 Wed Jan 9 17:09:06 2013 (r245229) +++ head/usr.sbin/ndp/ndp.8 Wed Jan 9 18:18:08 2013 (r245230) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 9, 2012 +.Dd Jan 10, 2013 .Dt NDP 8 .Os .\" @@ -192,6 +192,15 @@ on This flag is set by .Va net.inet6.ip6.auto_linklocal sysctl variable. +.It Ic no_prefer_iface +The address on the outgoing interface is preferred by source addess +selection rule. +If this flag is set, stop treating the address on the +.Ar interface +as special even when the +.Ar interface +is outgoing interface. +The default value of this flag is off. .It Ic disabled Disable IPv6 operation on the interface. When disabled, the interface discards any IPv6 packets Modified: head/usr.sbin/ndp/ndp.c ============================================================================== --- head/usr.sbin/ndp/ndp.c Wed Jan 9 17:09:06 2013 (r245229) +++ head/usr.sbin/ndp/ndp.c Wed Jan 9 18:18:08 2013 (r245230) @@ -982,6 +982,9 @@ ifinfo(ifname, argc, argv) #ifdef ND6_IFF_AUTO_LINKLOCAL SETFLAG("auto_linklocal", ND6_IFF_AUTO_LINKLOCAL); #endif +#ifdef ND6_IFF_NO_PREFER_IFACE + SETFLAG("no_prefer_iface", ND6_IFF_NO_PREFER_IFACE); +#endif SETVALUE("basereachable", ND.basereachable); SETVALUE("retrans", ND.retrans); SETVALUE("curhlim", ND.chlim); @@ -1055,6 +1058,10 @@ ifinfo(ifname, argc, argv) if ((ND.flags & ND6_IFF_AUTO_LINKLOCAL)) printf("auto_linklocal "); #endif +#ifdef ND6_IFF_NO_PREFER_IFACE + if ((ND.flags & ND6_IFF_NO_PREFER_IFACE)) + printf("no_prefer_iface "); +#endif } putc('\n', stdout); #undef ND From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 18:50:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E7F95AA3; Wed, 9 Jan 2013 18:50:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C242D6AF; Wed, 9 Jan 2013 18:50:06 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09Io6rr084560; Wed, 9 Jan 2013 18:50:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09Io6PG084553; Wed, 9 Jan 2013 18:50:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301091850.r09Io6PG084553@svn.freebsd.org> From: Adrian Chadd Date: Wed, 9 Jan 2013 18:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245231 - head/tools/tools/ath/athspectral X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 18:50:07 -0000 Author: adrian Date: Wed Jan 9 18:50:06 2013 New Revision: 245231 URL: http://svnweb.freebsd.org/changeset/base/245231 Log: Add the "enable at reset" functionality to trigger spectral scan upon a channel change/reset. Modified: head/tools/tools/ath/athspectral/athspectral.c Modified: head/tools/tools/ath/athspectral/athspectral.c ============================================================================== --- head/tools/tools/ath/athspectral/athspectral.c Wed Jan 9 18:18:08 2013 (r245230) +++ head/tools/tools/ath/athspectral/athspectral.c Wed Jan 9 18:50:06 2013 (r245231) @@ -187,6 +187,29 @@ spectral_stop(struct spectralhandler *sp err(1, spectral->atd.ad_name); } +static void +spectral_enable_at_reset(struct spectralhandler *spectral, int val) +{ + int v = val; + + spectral->atd.ad_id = SPECTRAL_CONTROL_ENABLE_AT_RESET + | ATH_DIAG_IN; + + /* + * XXX don't need these, but need to eliminate the ATH_DIAG_DYN flag + * and debug + */ + spectral->atd.ad_out_data = NULL; + spectral->atd.ad_out_size = 0; + spectral->atd.ad_in_data = (caddr_t) &v; + spectral->atd.ad_in_size = sizeof(v); + + printf("%s: val=%d\n", __func__, v); + + if (ioctl(spectral->s, SIOCGATHSPECTRAL, &spectral->atd) < 0) + err(1, spectral->atd.ad_name); +} + static int spectral_set_param(struct spectralhandler *spectral, const char *param, const char *val) @@ -258,6 +281,7 @@ usage(const char *progname) printf("\tset :\t\tSet spectral parameter\n"); printf("\tstart: Start spectral scan\n"); printf("\tstop: Stop spectral scan\n"); + printf("\tenable_at_reset <0|1>: enable reporting upon channel reset\n"); } int @@ -312,6 +336,12 @@ main(int argc, char *argv[]) spectral_start(&spectral); } else if (strcasecmp(argv[1], "stop") == 0) { spectral_stop(&spectral); + } else if (strcasecmp(argv[1], "enable_at_reset") == 0) { + if (argc < 3) { + usage(progname); + exit(127); + } + spectral_enable_at_reset(&spectral, atoi(argv[2])); } else { usage(progname); exit(127); From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 18:54:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3CA46EA5; Wed, 9 Jan 2013 18:54:59 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2F348717; Wed, 9 Jan 2013 18:54:59 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09IsxT5085547; Wed, 9 Jan 2013 18:54:59 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09IsxIb085546; Wed, 9 Jan 2013 18:54:59 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201301091854.r09IsxIb085546@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 9 Jan 2013 18:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245233 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 18:54:59 -0000 Author: ae Date: Wed Jan 9 18:54:58 2013 New Revision: 245233 URL: http://svnweb.freebsd.org/changeset/base/245233 Log: Remove unneeded variable. MFC after: 1 week Modified: head/sys/netinet6/scope6.c Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Wed Jan 9 18:54:41 2013 (r245232) +++ head/sys/netinet6/scope6.c Wed Jan 9 18:54:58 2013 (r245233) @@ -336,7 +336,6 @@ scope6_addr2default(struct in6_addr *add int sa6_embedscope(struct sockaddr_in6 *sin6, int defaultok) { - struct ifnet *ifp; u_int32_t zoneid; if ((zoneid = sin6->sin6_scope_id) == 0 && defaultok) @@ -351,15 +350,11 @@ sa6_embedscope(struct sockaddr_in6 *sin6 * zone IDs assuming a one-to-one mapping between interfaces * and links. */ - if (V_if_index < zoneid) - return (ENXIO); - ifp = ifnet_byindex(zoneid); - if (ifp == NULL) /* XXX: this can happen for some OS */ + if (V_if_index < zoneid || ifnet_byindex(zoneid) == NULL) return (ENXIO); /* XXX assignment to 16bit from 32bit variable */ sin6->sin6_addr.s6_addr16[1] = htons(zoneid & 0xffff); - sin6->sin6_scope_id = 0; } From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 19:20:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B52E335F; Wed, 9 Jan 2013 19:20:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id 910B8801; Wed, 9 Jan 2013 19:20:06 +0000 (UTC) Received: from pakbsde14.localnet (unknown [38.105.238.108]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CFD81B999; Wed, 9 Jan 2013 14:20:05 -0500 (EST) From: John Baldwin To: Jaakko Heinonen Subject: Re: svn commit: r244585 - in head: . sys/geom/label Date: Wed, 9 Jan 2013 14:17:37 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p22; KDE/4.5.5; amd64; ; ) References: <201212221343.qBMDhCHa086834@svn.freebsd.org> <201301070927.07157.jhb@freebsd.org> <20130108193146.GA1815@a91-153-116-96.elisa-laajakaista.fi> In-Reply-To: <20130108193146.GA1815@a91-153-116-96.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201301091417.37451.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 09 Jan 2013 14:20:05 -0500 (EST) Cc: src-committers@freebsd.org, pjd@freebsd.org, svn-src-all@freebsd.org, kib@freebsd.org, svn-src-head@freebsd.org, imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 19:20:06 -0000 On Tuesday, January 08, 2013 2:31:47 pm Jaakko Heinonen wrote: > On 2013-01-07, John Baldwin wrote: > > I think if it isn't hard to do so, we should aim to preserve labels as they > > are generally intended to be human readable as-is. Just preserving spaces is > > probably sufficient for this as they are probably the most commonly used > > character in labels affected by this change. > > All right. I have prepared patches for review. > > - Quote device names in devctl(4) device events. This allows events to > work for device names containing spaces. > - Allow spaces again in device names. > > Requested by: jhb > PR: kern/161912 Thanks. I think your patches look fine as far as I can tell. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 19:49:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A468D954; Wed, 9 Jan 2013 19:49:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7FC88928; Wed, 9 Jan 2013 19:49:36 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09JnarN099888; Wed, 9 Jan 2013 19:49:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09Jnagx099887; Wed, 9 Jan 2013 19:49:36 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201301091949.r09Jnagx099887@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 9 Jan 2013 19:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245234 - head/lib/libradius X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 19:49:36 -0000 Author: ae Date: Wed Jan 9 19:49:35 2013 New Revision: 245234 URL: http://svnweb.freebsd.org/changeset/base/245234 Log: Fix the bindto parameter declaration. Submitted by: sem Modified: head/lib/libradius/libradius.3 Modified: head/lib/libradius/libradius.3 ============================================================================== --- head/lib/libradius/libradius.3 Wed Jan 9 18:54:58 2013 (r245233) +++ head/lib/libradius/libradius.3 Wed Jan 9 19:49:35 2013 (r245234) @@ -38,7 +38,7 @@ .Ft int .Fn rad_add_server "struct rad_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int max_tries" .Ft int -.Fn rad_add_server_ex "struct rad_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int max_tries" "int dead_time" "struct in_addr bindto" +.Fn rad_add_server_ex "struct rad_handle *h" "const char *host" "int port" "const char *secret" "int timeout" "int max_tries" "int dead_time" "struct in_addr *bindto" .Ft "struct rad_handle *" .Fn rad_auth_open "void" .Ft void From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 20:10:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9B2CF3C1; Wed, 9 Jan 2013 20:10:46 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 76B9FA48; Wed, 9 Jan 2013 20:10:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09KAkME008396; Wed, 9 Jan 2013 20:10:46 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09KAkUg008395; Wed, 9 Jan 2013 20:10:46 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201301092010.r09KAkUg008395@svn.freebsd.org> From: Glen Barber Date: Wed, 9 Jan 2013 20:10:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245236 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 20:10:46 -0000 Author: gjb (doc,ports committer) Date: Wed Jan 9 20:10:45 2013 New Revision: 245236 URL: http://svnweb.freebsd.org/changeset/base/245236 Log: Update where porters handbook lives. MFC after: 3 days Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Wed Jan 9 20:01:08 2013 (r245235) +++ head/sys/sys/param.h Wed Jan 9 20:10:45 2013 (r245236) @@ -48,9 +48,9 @@ * __FreeBSD_version numbers are documented in the Porter's Handbook. * If you bump the version for any reason, you should update the documentation * there. - * Currently this lives here: + * Currently this lives here in the doc/ repository: * - * doc/en_US.ISO8859-1/books/porters-handbook/book.sgml + * head/en_US.ISO8859-1/books/porters-handbook/book.xml * * scheme is: Rxx * 'R' is in the range 0 to 4 if this is a release branch or From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 20:27:06 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BBEDC7BF; Wed, 9 Jan 2013 20:27:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4613AF5; Wed, 9 Jan 2013 20:27:06 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09KR6q9011772; Wed, 9 Jan 2013 20:27:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09KR6Tl011771; Wed, 9 Jan 2013 20:27:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201301092027.r09KR6Tl011771@svn.freebsd.org> From: John Baldwin Date: Wed, 9 Jan 2013 20:27:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245238 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 20:27:06 -0000 Author: jhb Date: Wed Jan 9 20:27:06 2013 New Revision: 245238 URL: http://svnweb.freebsd.org/changeset/base/245238 Log: Don't drop options from the third retransmitted SYN by default. If the SYNs (or SYN/ACK replies) are dropped due to network congestion, then the remote end of the connection may act as if options such as window scaling are enabled but the local end will think they are not. This can result in very slow data transfers in the case of window scaling disagreements. The old behavior can be obtained by setting the net.inet.tcp.rexmit_drop_options sysctl to a non-zero value. Reviewed by: net@ MFC after: 2 weeks Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Wed Jan 9 20:13:47 2013 (r245237) +++ head/sys/netinet/tcp_timer.c Wed Jan 9 20:27:06 2013 (r245238) @@ -119,6 +119,11 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, keep /* max idle probes */ int tcp_maxpersistidle; +static int tcp_rexmit_drop_options = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rexmit_drop_options, CTLFLAG_RW, + &tcp_rexmit_drop_options, 0, + "Drop TCP options from 3rd and later retransmitted SYN"); + static int per_cpu_timers = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW, &per_cpu_timers , 0, "run tcp timers on all cpus"); @@ -595,7 +600,8 @@ tcp_timer_rexmt(void * xtp) * header compression code which trashes TCP segments containing * unknown-to-them TCP options. */ - if ((tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3)) + if (tcp_rexmit_drop_options && (tp->t_state == TCPS_SYN_SENT) && + (tp->t_rxtshift == 3)) tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP|TF_SACK_PERMIT); /* * If we backed off this far, our srtt estimate is probably bogus. From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 21:07:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0DDDC5E6; Wed, 9 Jan 2013 21:07:10 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8045DF7; Wed, 9 Jan 2013 21:07:09 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09L793q022773; Wed, 9 Jan 2013 21:07:09 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09L78ai022766; Wed, 9 Jan 2013 21:07:08 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301092107.r09L78ai022766@svn.freebsd.org> From: Brooks Davis Date: Wed, 9 Jan 2013 21:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245241 - in head: share/man/man5 share/mk tools/build/options usr.sbin/mtree usr.sbin/nmtree X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 21:07:10 -0000 Author: brooks Date: Wed Jan 9 21:07:08 2013 New Revision: 245241 URL: http://svnweb.freebsd.org/changeset/base/245241 Log: Always install our mtree as /usr/sbin/fmtree and link it as /usr/sbin/mtree by default. Add a src.conf option WITH_NMTREE that causes NetBSD's mtree to be linked as /usr/sbin/mtree as well as /usr/sbin/nmtree. Added: head/tools/build/options/WITH_NMTREE (contents, props changed) Modified: head/share/man/man5/src.conf.5 head/share/mk/bsd.own.mk head/usr.sbin/mtree/Makefile head/usr.sbin/nmtree/Makefile Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jan 9 20:39:29 2013 (r245240) +++ head/share/man/man5/src.conf.5 Wed Jan 9 21:07:08 2013 (r245241) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 236279 2012-05-30 02:37:20Z gjb .\" $FreeBSD$ -.Dd November 5, 2012 +.Dd January 9, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -804,6 +804,16 @@ Set to not build NLS catalogs. .\" from FreeBSD: head/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalog support for .Xr csh 1 . +.It Va WITH_NMTREE +\" $FreeBSD$ +Set to install +.Xr nmtree 8 +as +.Xr mtree 8 . +By default +.Xr fmtree 8 +is installed as +.Xr mtree 8 . .It Va WITHOUT_NS_CACHING .\" from FreeBSD: head/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru Set to disable name caching in the Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Wed Jan 9 20:39:29 2013 (r245240) +++ head/share/mk/bsd.own.mk Wed Jan 9 21:07:08 2013 (r245241) @@ -431,6 +431,7 @@ __DEFAULT_NO_OPTIONS = \ ICONV \ IDEA \ INSTALL_AS_USER \ + NMTREE \ NAND \ OFED \ SHARED_TOOLCHAIN Added: head/tools/build/options/WITH_NMTREE ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_NMTREE Wed Jan 9 21:07:08 2013 (r245241) @@ -0,0 +1,9 @@ +\" $FreeBSD$ +Set to install +.Xr nmtree 8 +as +.Xr mtree 8 . +By default +.Xr fmtree 8 +is installed as +.Xr mtree 8 . Modified: head/usr.sbin/mtree/Makefile ============================================================================== --- head/usr.sbin/mtree/Makefile Wed Jan 9 20:39:29 2013 (r245240) +++ head/usr.sbin/mtree/Makefile Wed Jan 9 21:07:08 2013 (r245241) @@ -1,10 +1,12 @@ # From: @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ +.include + .PATH: ${.CURDIR}/../../usr.bin/cksum -PROG= mtree -MAN= mtree.8 mtree.5 +PROG= fmtree +MAN= fmtree.8 mtree.5 SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c verify.c SRCS+= specspec.c @@ -12,4 +14,14 @@ CFLAGS+= -DMD5 -DSHA1 -DRMD160 -DSHA256 DPADD= ${LIBMD} LDADD= -lmd +.if ${MK_NMTREE} == "no" +LINKS= ${BINDIR}/fmtree ${BINDIR}/mtree +MLINKS= fmtree.8 mtree.8 +.endif + +CLEANFILES+= fmtree.8 + +fmtree.8: mtree.8 + cp ${.ALLSRC} ${.TARGET} + .include Modified: head/usr.sbin/nmtree/Makefile ============================================================================== --- head/usr.sbin/nmtree/Makefile Wed Jan 9 20:39:29 2013 (r245240) +++ head/usr.sbin/nmtree/Makefile Wed Jan 9 21:07:08 2013 (r245241) @@ -20,6 +20,13 @@ LIBNETBSD= ${LIBNETBSDDIR}/libnetbsd.a DPADD+= ${LIBNETBSD} LDADD+= ${LIBNETBSD} +.if ${MK_NMTREE} != "no" +LINKS= ${BINDIR}/nmtree ${BINDIR}/mtree +MLINKS= nmtree.8 mtree.8 +.endif + +CLEANFILES+= nmtree.8 + nmtree.8: mtree.8 cp ${.ALLSRC} ${.TARGET} From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 21:27:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 36B84E5D; Wed, 9 Jan 2013 21:27:15 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 10897F10; Wed, 9 Jan 2013 21:27:15 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r09LREf7028418; Wed, 9 Jan 2013 21:27:14 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r09LREMl028417; Wed, 9 Jan 2013 21:27:14 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301092127.r09LREMl028417@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 9 Jan 2013 21:27:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245243 - head/sys/dev/cxgbe/firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 21:27:15 -0000 Author: np Date: Wed Jan 9 21:27:14 2013 New Revision: 245243 URL: http://svnweb.freebsd.org/changeset/base/245243 Log: cxgbe(4): updates to the configuration file that controls how hardware resources are partitioned. - Reduce the number of virtual interfaces reserved for PF4. This leaves spare room in the source MAC table and allows the driver to setup filters that rewrite the source MAC address. - Reduce the number of filters and use the freed up space for the CLIP (Compressed Local IPv6 addresses) table. This is a prerequisite for IPv6 TOE support which will follow separately in a series of commits. MFC after: 1 week Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Wed Jan 9 21:19:00 2013 (r245242) +++ head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Wed Jan 9 21:27:14 2013 (r245243) @@ -56,7 +56,7 @@ [function "4"] wx_caps = all r_caps = all - nvi = 54 + nvi = 32 niqflint = 256 nethctrl = 128 neq = 256 @@ -74,8 +74,8 @@ # Each entry in these categories takes 4 cells each. nhash will use the # TCAM iff there is room left (that is, the rest don't add up to 2048). nroute = 32 - nclip = 0 # needed only for IPv6 offload - nfilter = 1488 + nclip = 32 + nfilter = 1456 nserver = 512 nhash = 16384 @@ -137,7 +137,7 @@ [fini] version = 0x1 - checksum = 0x162df193 + checksum = 0xfdebb6ef # # $FreeBSD$ # From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 22:25:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D1446ABE; Wed, 9 Jan 2013 22:25:48 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f170.google.com (mail-ob0-f170.google.com [209.85.214.170]) by mx1.freebsd.org (Postfix) with ESMTP id 6029719C; Wed, 9 Jan 2013 22:25:48 +0000 (UTC) Received: by mail-ob0-f170.google.com with SMTP id wp18so2783870obc.15 for ; Wed, 09 Jan 2013 14:25:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ZVCDbxZExgDRYrJz+xdPohKyRITQH5NVARRBL1vzs30=; b=x/A2o+SB/B6lILKrnpyUD9BiDHCjRKjYVR1k38tciLtN4oxhix7HNgm32sNoSPpKc+ rMBbvQjO70nEkreNlfMiUdrBjEa36WDf37JbfnOA/ZHzpxoWgTnhXteAUzi2CiDb9n3C bxDVpCwXAAHhMFfNIIKoeoNctpFikV7yPuckqunqgFg/L1onmfiYONwa+Bc4cshJXOaD RjScDgFloXHqR5cTTzqOONbY3FURcbP/EQY58JqAWT4ruwGzRe029hepO5Oi5atcNwuu 7fmwVAhBCPEvhlgC66ZfjPP8tfYRvFbde9+c5YRE2V9o0UGCDhT7P1FwsmmgPioZN2b2 z+Hw== MIME-Version: 1.0 Received: by 10.60.172.178 with SMTP id bd18mr41105761oec.133.1357770347742; Wed, 09 Jan 2013 14:25:47 -0800 (PST) Received: by 10.76.107.241 with HTTP; Wed, 9 Jan 2013 14:25:47 -0800 (PST) In-Reply-To: <201301070949.33173.jhb@freebsd.org> References: <201301051918.r05JIptx030509@svn.freebsd.org> <201301070949.33173.jhb@freebsd.org> Date: Wed, 9 Jan 2013 14:25:47 -0800 Message-ID: Subject: Re: svn commit: r245066 - head/sys/kern From: Garrett Cooper To: John Baldwin Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Neel Natu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 22:25:48 -0000 On Mon, Jan 7, 2013 at 6:49 AM, John Baldwin wrote: > On Saturday, January 05, 2013 02:18:51 PM Neel Natu wrote: >> Author: neel >> Date: Sat Jan 5 19:18:50 2013 >> New Revision: 245066 >> URL: http://svnweb.freebsd.org/changeset/base/245066 >> >> Log: >> Teach the kernel to recognize that it is executing inside a bhyve virtual >> machine. >> >> Obtained from: NetApp >> >> Modified: >> head/sys/kern/subr_param.c >> >> Modified: head/sys/kern/subr_param.c >> =========================================================================== >> === --- head/sys/kern/subr_param.c Sat Jan 5 18:48:23 2013 (r245065) >> +++ head/sys/kern/subr_param.c Sat Jan 5 19:18:50 2013 (r245066) >> @@ -160,6 +160,7 @@ static const char *const vm_bnames[] = { >> "Plex86", /* Plex86 */ >> "Bochs", /* Bochs */ >> "Xen", /* Xen */ >> + "BHYVE", /* bhyve */ >> NULL >> }; > > It would be nice to start using the CPUID leaf for VM's in preference to the > SMBIOS strings at some point. (I think it's level 0x40000000?) Yes, that's a component of it. We need to make things a little more complicated when dealing with VMware, VirtualBox, etc, and Isilon has a vested interest (not much of one, but a bit of one) to make this more sane. Thanks! -Garrett From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 22:31:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E5FC2CBE; Wed, 9 Jan 2013 22:31:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 6C7041D6; Wed, 9 Jan 2013 22:31:47 +0000 (UTC) Received: from mail13.syd.optusnet.com.au (mail13.syd.optusnet.com.au [211.29.132.194]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r09MVeSj008812; Thu, 10 Jan 2013 09:31:40 +1100 Received: from c211-30-173-106.carlnfd1.nsw.optusnet.com.au (c211-30-173-106.carlnfd1.nsw.optusnet.com.au [211.30.173.106]) by mail13.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id r09MVS1B019875 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 10 Jan 2013 09:31:29 +1100 Date: Thu, 10 Jan 2013 09:31:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Gleb Smirnoff Subject: Re: svn commit: r245222 - head/sys/sys In-Reply-To: <20130109091217.GL66284@FreeBSD.org> Message-ID: <20130110081336.L967@besplex.bde.org> References: <201301090909.r09999kV013794@svn.freebsd.org> <20130109091217.GL66284@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.0 cv=Or8XUFDt c=1 sm=1 a=5ctC8jQGzeMA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=FSHVhTTuonsA:10 a=lJKHffl9dzKZSfoYquAA:9 a=CjuIK1q_8ugA:10 a=TEtd8y5WR3g2ypngnwZWYw==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 22:31:48 -0000 On Wed, 9 Jan 2013, Gleb Smirnoff wrote: > On Wed, Jan 09, 2013 at 09:09:09AM +0000, Hans Petter Selasky wrote: > H> Log: > H> Fix compile warning when using GCC: > H> Comparison between signed and unsigned. o Add 3 style bugs: 2 sets of excessive parentheses 1 line longer than 80 columns > H> Modified: head/sys/sys/mbuf.h > H> ============================================================================== > H> --- head/sys/sys/mbuf.h Wed Jan 9 08:52:44 2013 (r245221) > H> +++ head/sys/sys/mbuf.h Wed Jan 9 09:09:09 2013 (r245222) > H> @@ -557,7 +557,7 @@ m_get2(int how, short type, int flags, i > H> args.flags = flags; > H> args.type = type; > H> > H> - if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) > H> + if (size <= ((int)MHLEN) || (size <= ((int)MLEN) && (flags & M_PKTHDR) == 0)) > H> return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); > H> if (size <= MCLBYTES) > H> return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); > > The function is new and present only in head. I suggest just change its > argument to u_int or size_t, instead of casting. Or fix the definitions of MHLEN and MLEN so that they have type int. They use sizeof() internally, and arguably suffer from the unsign extension given by this. Parameters giving small integral values should be plain ints if possible (to minimize surprises from sign extension), and basic parameters for mbufs are, but derived ones aren't: % sys/param.h:#ifndef MSIZE % sys/param.h:#define MSIZE 256 /* size of an mbuf */ % sys/param.h:#endif /* MSIZE */ MSIZE has type int (unless it is already misdefined with a different type). Its definition has many style bugs: - space instead of tab after #define - the comment on its #endif shouldn't exist since its #ifdef section is short and simple. - tab instead of space before comment on #endif - backwards comment on #endif. % sys/param.h:#define MCLBYTES (1 << MCLSHIFT) /* size of an mbuf cluster */ MCLBYTES has type int (it has the type of 1, irrespective of the type of MCLSHIFT). % sys/mbuf.h:#define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */ % sys/mbuf.h:#define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */ % sys/mbuf.h:#define MINCLSIZE (MHLEN + 1) /* smallest amount to put in cluster */ % sys/mbuf.h:#define M_MAXCOMPRESS (MHLEN / 2) /* max amount to copy for compression */ These use sizeof() internally, so they suffer from unsign extension. Their type is hard to predict in general< thanks to C's broken "value preserving" extension rules. But on non-exotic machines, size_t has a higher rank than it, so the common type of operands of type int and size_t is size_t and the result has type size_t. Re-quoting some of the above: > H> + if (size <= ((int)MHLEN) || (size <= ((int)MLEN) && (flags & M_PKTHDR) == 0)) If MHLEN and MLEN are converted to int in their declarations, then the result is the same here, and all uses of these macros might be affected. This is theoretically better than casting size_t to int or passing in a size_t for size, since on the exotic machines the type of these macros is into so it would be mismatched with the type of 'size' in the opposite way. > The function is new and present only in head. I suggest just change its > argument to u_int or size_t, instead of casting. That might be better, but mbuf APIs consistently use int for size args now: % static __inline struct mbuf *m_get2(int how, short type, int flags, % int size); % ... % static __inline struct mbuf *m_getjcl(int how, short type, int flags, % int size); % ... % static __inline int m_init(struct mbuf *m, uma_zone_t zone, % int size, int how, short type, int flags); % ... % static __inline void *m_cljget(struct mbuf *m, int how, int size); Inlines in sys/mbuf.h are generally badly written. These forward declarations of inlines are just useless. They aren't even sorted. % % static __inline int % m_gettype(int size) % ... % static __inline uma_zone_t % m_getzone(int size) % ... % static __inline struct mbuf * % m_get2(int how, short type, int flags, int size) % { % struct mb_args args; % struct mbuf *m, *n; % uma_zone_t zone; % % args.flags = flags; % args.type = type; % % if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) % return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); Inlines with large code are only effective if the args are often constant so that most of the code is optimized away. But in all (?) 1 (?) call to m_get2(), the size arg is variable. The other args are constant, but most of the tests are of the size arg. Style bugs here and later: uma_zalloc_arg() returns void *, so casting it to struct mbuf * is just verbose. % if (size <= MCLBYTES) % return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); % Style bug: extra blank line. % if (size > MJUM16BYTES) % return (NULL); Technical problem: MJUM16BYTES has type plain it, so if you change the type of (size' to size_t, then you should get a warning for this comparison. m_cljset() has a local variable 'int size'. The most fundamental size variable in the mbuf API is probably mh_len. It has type plain int. It must not be replaced by size_t size that would just waste space on arches where size_t is larger than int. It could be replaced by u_int, but I prefer plain int. ext_size has type u_int. tso_segsz has type uint16_t. The types of size variables and macros would have to be constently changed to either size_t or int to avoid these warnings. This is like const poisoning. In particular, MHLEN etc. must be cast to size_t in case the machine is exotic so that the their expression has type int. It is surprising that there aren't more of these warnings already. Repeating some context again: > H> - if (size <= MHLEN || (size <= MLEN && (flags & M_PKTHDR) == 0)) > H> + if (size <= ((int)MHLEN) || (size <= ((int)MLEN) && (flags & M_PKTHDR) == 0)) > H> return ((struct mbuf *)(uma_zalloc_arg(zone_mbuf, &args, how))); > H> if (size <= MCLBYTES) > H> return ((struct mbuf *)(uma_zalloc_arg(zone_pack, &args, how))); How did this fix work without also casting MCLBYTES? It has the same type as MHLEN and MLEN. Naybe the compiler is smart about ranges -- after passing the first test it can know than size >= 0, at least after you changed the first test to make it filter out all cases with size < 0. But later in m_getjcl(), there is the same test (size <= MCLBYTES) with no preceding tests (except possibly in callers) to filter out cases where size < 0, so I would expect a warning from this too. Otherwise, mbuf.h doesn't do many comparisons that should trigger type mismatch warnings. It does many switch (size)'s where 'size' has type int and the case statements have a mixture of plain ints and size_t's for their types. Now I think binary conversion does the right thing -- everything the case values get converted to match the type of the case selector, so all the size_t's get converted to int, and this is the right thing all the size_t's actually fit in an int. Bruce From owner-svn-src-head@FreeBSD.ORG Wed Jan 9 23:45:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ED03F9CD; Wed, 9 Jan 2013 23:45:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 7133D72A; Wed, 9 Jan 2013 23:45:30 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r09NjReJ017027; Thu, 10 Jan 2013 01:45:27 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r09NjReJ017027 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r09NjR1R017026; Thu, 10 Jan 2013 01:45:27 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 10 Jan 2013 01:45:26 +0200 From: Konstantin Belousov To: John Baldwin Subject: Re: svn commit: r244585 - in head: . sys/geom/label Message-ID: <20130109234526.GL2561@kib.kiev.ua> References: <201212221343.qBMDhCHa086834@svn.freebsd.org> <201301070927.07157.jhb@freebsd.org> <20130108193146.GA1815@a91-153-116-96.elisa-laajakaista.fi> <201301091417.37451.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QWRRbczYj8mXuejp" Content-Disposition: inline In-Reply-To: <201301091417.37451.jhb@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: Jaakko Heinonen , src-committers@freebsd.org, pjd@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jan 2013 23:45:31 -0000 --QWRRbczYj8mXuejp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 09, 2013 at 02:17:37PM -0500, John Baldwin wrote: > On Tuesday, January 08, 2013 2:31:47 pm Jaakko Heinonen wrote: > > On 2013-01-07, John Baldwin wrote: > > > I think if it isn't hard to do so, we should aim to preserve labels a= s they=20 > > > are generally intended to be human readable as-is. Just preserving s= paces is=20 > > > probably sufficient for this as they are probably the most commonly u= sed=20 > > > character in labels affected by this change. > >=20 > > All right. I have prepared patches for review. > >=20 > > - Quote device names in devctl(4) device events. This allows events to > > work for device names containing spaces. > > - Allow spaces again in device names. > >=20 > > Requested by: jhb > > PR: kern/161912 >=20 > Thanks. I think your patches look fine as far as I can tell. I do not object, but IMHO having names with the spaces in /dev is weird and possibly problematic. This was the reason of my initial request to disable spaces, together with the fact that it changes the devctl(4) protocol (there might be other /dev/devctl readers besides devd). --QWRRbczYj8mXuejp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ7gEWAAoJEJDCuSvBvK1BeTwP/1Epv5nTcwLFbAkn9Td5naB2 R+4iYsu+E7qEG0Li2paH9m3LcPOZab/NLsjoHLe7xAvEpwdyKQuJjvWsOyn2JmGh Z7nvZ3mbjdP8v8OymRSKPHHP6lee6Mt4b0UnppseRfWEbtjNWJIGCc9XdxtlsPRN 1lNX0Tu3toh7RAY8zFIHlNU9muyyb3E2MWgYlnokyouebHSXwKLBRHo2eGwa5kRy AZIDudCy++T0DTx6pZ0qPkEARxNoowgmXY22VJD0K8iqwtmhu5EM/yziKQFN8vKt JVSKUutOQhVa64rJrsHRPoQgz/XZzWBzK94jdjEjz7f5nF6ICg8lf8v1iMuCvr2C 8UcSEf6ktfoh2sLUEysWgK4uVS3Zv16w0Ub87y+i+V4tbHQfiQI29hcJ4dMd04I/ ZYZYrgA6dGWi8SoihnUzdGvFxxApRNtLmxopaNGvqWhX3XH8rFn3NRO6V5VfChS4 XyQ+ub+tLQKjxFTxgQAkviC3uz1uI7tnfKm6ld4Ai5IaZOSd9t9mjCPC5lDFuuw2 UVxOsOKw885NQEuqLs0s8jrxs60OQgWetWkY2zr0EY9v9zOwxE4Uis0SxsARv9LT xf1/Pe3zxHofhdD3znvaOe2T3uZpb4VfDSJpza1js5K+hag4xGhR2XjjkpuaabzV R/IV3OvAAenwiD0TCnRG =vDZ2 -----END PGP SIGNATURE----- --QWRRbczYj8mXuejp-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 00:08:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 91EDE90 for ; Thu, 10 Jan 2013 00:08:28 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from mail-da0-f48.google.com (mail-da0-f48.google.com [209.85.210.48]) by mx1.freebsd.org (Postfix) with ESMTP id 6BB838EE for ; Thu, 10 Jan 2013 00:08:27 +0000 (UTC) Received: by mail-da0-f48.google.com with SMTP id k18so996236dae.21 for ; Wed, 09 Jan 2013 16:08:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:subject:mime-version:content-type:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to:x-mailer:x-gm-message-state; bh=o95yIakKdnWzpjk2dGbW34ZrOANi03DW3QEuk4kiGuk=; b=K8eYzhf74mckjLG2plzANgRRv1s4MJDTpP2l8FYZ9ooQiL+TM+Jotnr2WNzKPYWlgw VPK9WIcLqZvI6RJE6wHh3h+09Um21cFRm/dHp8vFZaGwX79Rz+VbSAB5dV0hPr/0LNC3 R41dHAkLMlkU7mvTA4+bDGDq2i3wBd8/gCdkIXIo9lRKVKRwGOT9dcsT36jkXPX0d63J GGfyqK+N29rNHjCMmpmrIGkEZfpNNvjslvo6t5gr7szh6NqZiWXmIdxfpmP5Tk9PWktD 9MsfYGzOg4R6kKj2M3HxX+D1ccKGSX15mcNIHEMCrBsB6DlpC+i2XlSw353MUnjxZdP/ TO9w== X-Received: by 10.66.52.79 with SMTP id r15mr194387174pao.46.1357776507335; Wed, 09 Jan 2013 16:08:27 -0800 (PST) Received: from fusionlt2834a.int.fusionio.com ([209.117.142.2]) by mx.google.com with ESMTPS id o1sm127152paw.0.2013.01.09.16.08.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 09 Jan 2013 16:08:26 -0800 (PST) Sender: Warner Losh Subject: Re: svn commit: r244585 - in head: . sys/geom/label Mime-Version: 1.0 (Apple Message framework v1085) Content-Type: text/plain; charset=us-ascii From: Warner Losh In-Reply-To: <20130109234526.GL2561@kib.kiev.ua> Date: Wed, 9 Jan 2013 17:08:23 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201212221343.qBMDhCHa086834@svn.freebsd.org> <201301070927.07157.jhb@freebsd.org> <20130108193146.GA1815@a91-153-116-96.elisa-laajakaista.fi> <201301091417.37451.jhb@freebsd.org> <20130109234526.GL2561@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1085) X-Gm-Message-State: ALoCoQnCNAakWbIYz87nCaA2unqoDFrYt5FqU9di/QJ1AnZx3gNcvEJ3OQd6OwELyXexN5WyhVjh Cc: Jaakko Heinonen , src-committers@freebsd.org, pjd@freebsd.org, John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 00:08:28 -0000 On Jan 9, 2013, at 4:45 PM, Konstantin Belousov wrote: > On Wed, Jan 09, 2013 at 02:17:37PM -0500, John Baldwin wrote: >> On Tuesday, January 08, 2013 2:31:47 pm Jaakko Heinonen wrote: >>> On 2013-01-07, John Baldwin wrote: >>>> I think if it isn't hard to do so, we should aim to preserve labels = as they=20 >>>> are generally intended to be human readable as-is. Just preserving = spaces is=20 >>>> probably sufficient for this as they are probably the most commonly = used=20 >>>> character in labels affected by this change. >>>=20 >>> All right. I have prepared patches for review. >>>=20 >>> - Quote device names in devctl(4) device events. This allows events = to >>> work for device names containing spaces. >>> - Allow spaces again in device names. >>>=20 >>> Requested by: jhb >>> PR: kern/161912 >>=20 >> Thanks. I think your patches look fine as far as I can tell. >=20 > I do not object, but IMHO having names with the spaces in /dev is = weird > and possibly problematic. This was the reason of my initial request to > disable spaces, together with the fact that it changes the devctl(4) > protocol (there might be other /dev/devctl readers besides devd). I'm not sure that the protocol changes are quire right yet... Warner From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 00:10:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 74D2B228; Thu, 10 Jan 2013 00:10:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4ED84905; Thu, 10 Jan 2013 00:10:25 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0A0APtN074260; Thu, 10 Jan 2013 00:10:25 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0A0APJk074259; Thu, 10 Jan 2013 00:10:25 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201301100010.r0A0APJk074259@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 10 Jan 2013 00:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245244 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 00:10:25 -0000 Author: ae Date: Thu Jan 10 00:10:24 2013 New Revision: 245244 URL: http://svnweb.freebsd.org/changeset/base/245244 Log: Simplify in6_setscope() function to get better performance. Currently we use interface indeces as zone IDs for link-local and interface-local scopes, and since we don't have any tool to configure zone IDs, there is no need to acquire the afdata lock several times per packet only to read if_index value. So, now in6_setscope reads zone IDs for interface-local, link-local and global scopes without a lock. Sponsored by: Yandex LLC MFC after: 2 weeks Modified: head/sys/netinet6/scope6.c Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Wed Jan 9 21:27:14 2013 (r245243) +++ head/sys/netinet6/scope6.c Thu Jan 10 00:10:24 2013 (r245244) @@ -420,59 +420,30 @@ in6_setscope(struct in6_addr *in6, struc * interface. */ if (IN6_IS_ADDR_LOOPBACK(in6)) { - if (!(ifp->if_flags & IFF_LOOPBACK)) { + if (!(ifp->if_flags & IFF_LOOPBACK)) return (EINVAL); - } else { - if (ret_id != NULL) - *ret_id = 0; /* there's no ambiguity */ - return (0); + } else { + scope = in6_addrscope(in6); + if (scope == IPV6_ADDR_SCOPE_INTFACELOCAL || + scope == IPV6_ADDR_SCOPE_LINKLOCAL) { + /* + * Currently we use interface indeces as the + * zone IDs for interface-local and link-local + * scopes. + */ + zoneid = ifp->if_index; + in6->s6_addr16[1] = htons(zoneid & 0xffff); /* XXX */ + } else if (scope != IPV6_ADDR_SCOPE_GLOBAL) { + IF_AFDATA_RLOCK(ifp); + sid = SID(ifp); + zoneid = sid->s6id_list[scope]; + IF_AFDATA_RUNLOCK(ifp); } } - if (ret_id == NULL && !IN6_IS_SCOPE_EMBED(in6)) - return (0); - - IF_AFDATA_RLOCK(ifp); - - sid = SID(ifp); - -#ifdef DIAGNOSTIC - if (sid == NULL) { /* should not happen */ - panic("in6_setscope: scope array is NULL"); - /* NOTREACHED */ - } -#endif - - scope = in6_addrscope(in6); - switch (scope) { - case IPV6_ADDR_SCOPE_INTFACELOCAL: /* should be interface index */ - zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_INTFACELOCAL]; - break; - - case IPV6_ADDR_SCOPE_LINKLOCAL: - zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_LINKLOCAL]; - break; - - case IPV6_ADDR_SCOPE_SITELOCAL: - zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_SITELOCAL]; - break; - - case IPV6_ADDR_SCOPE_ORGLOCAL: - zoneid = sid->s6id_list[IPV6_ADDR_SCOPE_ORGLOCAL]; - break; - - default: - zoneid = 0; /* XXX: treat as global. */ - break; - } - IF_AFDATA_RUNLOCK(ifp); - if (ret_id != NULL) *ret_id = zoneid; - if (IN6_IS_SCOPE_EMBED(in6)) - in6->s6_addr16[1] = htons(zoneid & 0xffff); /* XXX */ - return (0); } From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 07:45:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C6AC2A7; Thu, 10 Jan 2013 07:45:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D899682E; Thu, 10 Jan 2013 07:45:47 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0A7jlDO006585; Thu, 10 Jan 2013 07:45:47 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0A7jlKk006578; Thu, 10 Jan 2013 07:45:47 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301100745.r0A7jlKk006578@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 10 Jan 2013 07:45:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245248 - in head/sys/dev/usb: . input X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 07:45:48 -0000 Author: hselasky Date: Thu Jan 10 07:45:46 2013 New Revision: 245248 URL: http://svnweb.freebsd.org/changeset/base/245248 Log: Fix detection of Razer Copperhead as a USB mouse. Factor out USB mouse and keyboard detection logic. Reject USB keyboards which have mouse alike HID items in their HID descriptors. Submitted by: Matthew W MFC after: 1 week Modified: head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/input/ums.c head/sys/dev/usb/usb_hid.c head/sys/dev/usb/usbhid.h Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Thu Jan 10 05:36:42 2013 (r245247) +++ head/sys/dev/usb/input/ukbd.c Thu Jan 10 07:45:46 2013 (r245248) @@ -995,13 +995,12 @@ ukbd_probe(device_t dev) if (uaa->info.bInterfaceClass != UICLASS_HID) return (ENXIO); + if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) + return (ENXIO); + if ((uaa->info.bInterfaceSubClass == UISUBCLASS_BOOT) && - (uaa->info.bInterfaceProtocol == UIPROTO_BOOT_KEYBOARD)) { - if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) - return (ENXIO); - else - return (BUS_PROBE_DEFAULT); - } + (uaa->info.bInterfaceProtocol == UIPROTO_BOOT_KEYBOARD)) + return (BUS_PROBE_DEFAULT); error = usbd_req_get_hid_desc(uaa->device, NULL, &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex); @@ -1009,23 +1008,20 @@ ukbd_probe(device_t dev) if (error) return (ENXIO); - /* - * NOTE: we currently don't support USB mouse and USB keyboard - * on the same USB endpoint. - */ - if (hid_is_collection(d_ptr, d_len, - HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE))) { - /* most likely a mouse */ - error = ENXIO; - } else if (hid_is_collection(d_ptr, d_len, - HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_KEYBOARD))) { - if (usb_test_quirk(uaa, UQ_KBD_IGNORE)) + if (hid_is_keyboard(d_ptr, d_len)) { + if (hid_is_mouse(d_ptr, d_len)) { + /* + * NOTE: We currently don't support USB mouse + * and USB keyboard on the same USB endpoint. + * Let "ums" driver win. + */ error = ENXIO; - else + } else { error = BUS_PROBE_DEFAULT; - } else + } + } else { error = ENXIO; - + } free(d_ptr, M_TEMP); return (error); } Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Thu Jan 10 05:36:42 2013 (r245247) +++ head/sys/dev/usb/input/ums.c Thu Jan 10 07:45:46 2013 (r245248) @@ -368,9 +368,7 @@ ums_probe(device_t dev) { struct usb_attach_arg *uaa = device_get_ivars(dev); void *d_ptr; - struct hid_data *hd; - struct hid_item hi; - int error, mdepth, found; + int error; uint16_t d_len; DPRINTFN(11, "\n"); @@ -394,44 +392,13 @@ ums_probe(device_t dev) if (error) return (ENXIO); - hd = hid_start_parse(d_ptr, d_len, 1 << hid_input); - if (hd == NULL) - return (0); - mdepth = 0; - found = 0; - while (hid_get_item(hd, &hi)) { - switch (hi.kind) { - case hid_collection: - if (mdepth != 0) - mdepth++; - else if (hi.collection == 1 && - hi.usage == - HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)) - mdepth++; - break; - case hid_endcollection: - if (mdepth != 0) - mdepth--; - break; - case hid_input: - if (mdepth == 0) - break; - if (hi.usage == - HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X) && - (hi.flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) - found++; - if (hi.usage == - HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y) && - (hi.flags & MOUSE_FLAGS_MASK) == MOUSE_FLAGS) - found++; - break; - default: - break; - } - } - hid_end_parse(hd); + if (hid_is_mouse(d_ptr, d_len)) + error = BUS_PROBE_DEFAULT; + else + error = ENXIO; + free(d_ptr, M_TEMP); - return (found ? BUS_PROBE_DEFAULT : ENXIO); + return (error); } static void Modified: head/sys/dev/usb/usb_hid.c ============================================================================== --- head/sys/dev/usb/usb_hid.c Thu Jan 10 05:36:42 2013 (r245247) +++ head/sys/dev/usb/usb_hid.c Thu Jan 10 07:45:46 2013 (r245248) @@ -845,3 +845,79 @@ usbd_req_get_hid_desc(struct usb_device } return (USB_ERR_NORMAL_COMPLETION); } + +/*------------------------------------------------------------------------* + * hid_is_mouse + * + * This function will decide if a USB descriptor belongs to a USB mouse. + * + * Return values: + * Zero: Not a USB mouse. + * Else: Is a USB mouse. + *------------------------------------------------------------------------*/ +int +hid_is_mouse(const void *d_ptr, uint16_t d_len) +{ + struct hid_data *hd; + struct hid_item hi; + int mdepth; + int found; + + hd = hid_start_parse(d_ptr, d_len, 1 << hid_input); + if (hd == NULL) + return (0); + + mdepth = 0; + found = 0; + + while (hid_get_item(hd, &hi)) { + switch (hi.kind) { + case hid_collection: + if (mdepth != 0) + mdepth++; + else if (hi.collection == 1 && + hi.usage == + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_MOUSE)) + mdepth++; + break; + case hid_endcollection: + if (mdepth != 0) + mdepth--; + break; + case hid_input: + if (mdepth == 0) + break; + if (hi.usage == + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_X) && + (hi.flags & (HIO_CONST|HIO_RELATIVE)) == HIO_RELATIVE) + found++; + if (hi.usage == + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_Y) && + (hi.flags & (HIO_CONST|HIO_RELATIVE)) == HIO_RELATIVE) + found++; + break; + default: + break; + } + } + hid_end_parse(hd); + return (found); +} + +/*------------------------------------------------------------------------* + * hid_is_keyboard + * + * This function will decide if a USB descriptor belongs to a USB keyboard. + * + * Return values: + * Zero: Not a USB keyboard. + * Else: Is a USB keyboard. + *------------------------------------------------------------------------*/ +int +hid_is_keyboard(const void *d_ptr, uint16_t d_len) +{ + if (hid_is_collection(d_ptr, d_len, + HID_USAGE2(HUP_GENERIC_DESKTOP, HUG_KEYBOARD))) + return (1); + return (0); +} Modified: head/sys/dev/usb/usbhid.h ============================================================================== --- head/sys/dev/usb/usbhid.h Thu Jan 10 05:36:42 2013 (r245247) +++ head/sys/dev/usb/usbhid.h Thu Jan 10 07:45:46 2013 (r245248) @@ -242,5 +242,7 @@ struct usb_hid_descriptor *hid_get_descr usb_error_t usbd_req_get_hid_desc(struct usb_device *udev, struct mtx *mtx, void **descp, uint16_t *sizep, struct malloc_type *mem, uint8_t iface_index); +int hid_is_mouse(const void *d_ptr, uint16_t d_len); +int hid_is_keyboard(const void *d_ptr, uint16_t d_len); #endif /* _KERNEL */ #endif /* _USB_HID_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 08:06:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B6BEB513; Thu, 10 Jan 2013 08:06:12 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A44DD8A3; Thu, 10 Jan 2013 08:06:12 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0A86CnZ012402; Thu, 10 Jan 2013 08:06:12 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0A86C3K012401; Thu, 10 Jan 2013 08:06:12 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201301100806.r0A86C3K012401@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 10 Jan 2013 08:06:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245249 - head/sys/dev/usb/quirk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 08:06:12 -0000 Author: hselasky Date: Thu Jan 10 08:06:12 2013 New Revision: 245249 URL: http://svnweb.freebsd.org/changeset/base/245249 Log: Bugfix: Fix sizeof() argument. Found by: Haakon Loevdal MFC after: 1 week Modified: head/sys/dev/usb/quirk/usb_quirk.c Modified: head/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- head/sys/dev/usb/quirk/usb_quirk.c Thu Jan 10 07:45:46 2013 (r245248) +++ head/sys/dev/usb/quirk/usb_quirk.c Thu Jan 10 08:06:12 2013 (r245249) @@ -799,7 +799,7 @@ usb_quirk_ioctl(unsigned long cmd, caddr } if (x == USB_SUB_QUIRKS_MAX) { /* all quirk entries are unused - release */ - memset(pqe, 0, sizeof(pqe)); + memset(pqe, 0, sizeof(*pqe)); } mtx_unlock(&usb_quirk_mtx); return (0); /* success */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 11:08:23 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 249FE773; Thu, 10 Jan 2013 11:08:23 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 173773F3; Thu, 10 Jan 2013 11:08:23 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0AB8M7E063414; Thu, 10 Jan 2013 11:08:22 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0AB8M77063413; Thu, 10 Jan 2013 11:08:22 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201301101108.r0AB8M77063413@svn.freebsd.org> From: Steven Hartland Date: Thu, 10 Jan 2013 11:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245250 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 11:08:23 -0000 Author: smh Date: Thu Jan 10 11:08:22 2013 New Revision: 245250 URL: http://svnweb.freebsd.org/changeset/base/245250 Log: Allow perl scripts to be used in rc.d scripts PR: conf/117027 Reviewed by: pjd (mentor) Approved by: hrs MFC after: 2 weeks Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Thu Jan 10 08:06:12 2013 (r245249) +++ head/etc/rc.subr Thu Jan 10 11:08:22 2013 (r245250) @@ -290,7 +290,7 @@ _find_processes() _interpbn=${1##*/} _fp_args='_argv' _fp_match='case "$_argv" in - ${_interp}|"${_interp} "*|"${_interpbn}: ${_procname}"*)' + ${_interp}|"${_interp} "*|"[${_interpbn}]"|"${_interpbn}: ${_procname}"*)' else # a normal daemon _procnamebn=${_procname##*/} _fp_args='_arg0 _argv' From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 11:28:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 06B32ACF; Thu, 10 Jan 2013 11:28:13 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ECD496C5; Thu, 10 Jan 2013 11:28:12 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ABSCp5068982; Thu, 10 Jan 2013 11:28:12 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ABSChQ068981; Thu, 10 Jan 2013 11:28:12 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201301101128.r0ABSChQ068981@svn.freebsd.org> From: Steven Hartland Date: Thu, 10 Jan 2013 11:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245251 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 11:28:13 -0000 Author: smh Date: Thu Jan 10 11:28:12 2013 New Revision: 245251 URL: http://svnweb.freebsd.org/changeset/base/245251 Log: Removes essentially unused variables from scsi_da probe setups PR: kern/169835 Reviewed by: pjd (mentor) Approved by: mav MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Jan 10 11:08:22 2013 (r245250) +++ head/sys/cam/scsi/scsi_da.c Thu Jan 10 11:28:12 2013 (r245251) @@ -2014,7 +2014,6 @@ out: } case DA_STATE_PROBE: { - struct ccb_scsiio *csio; struct scsi_read_capacity_data *rcap; rcap = (struct scsi_read_capacity_data *) @@ -2024,8 +2023,7 @@ out: /* da_free_periph??? */ break; } - csio = &start_ccb->csio; - scsi_read_capacity(csio, + scsi_read_capacity(&start_ccb->csio, /*retries*/4, dadone, MSG_SIMPLE_Q_TAG, @@ -2039,7 +2037,6 @@ out: } case DA_STATE_PROBE2: { - struct ccb_scsiio *csio; struct scsi_read_capacity_data_long *rcaplong; rcaplong = (struct scsi_read_capacity_data_long *) @@ -2049,8 +2046,7 @@ out: /* da_free_periph??? */ break; } - csio = &start_ccb->csio; - scsi_read_capacity_16(csio, + scsi_read_capacity_16(&start_ccb->csio, /*retries*/ 4, /*cbfcnp*/ dadone, /*tag_action*/ MSG_SIMPLE_Q_TAG, From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 11:57:47 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A27B25B7; Thu, 10 Jan 2013 11:57:47 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 887B5880; Thu, 10 Jan 2013 11:57:47 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ABvljF077085; Thu, 10 Jan 2013 11:57:47 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ABvlID077084; Thu, 10 Jan 2013 11:57:47 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201301101157.r0ABvlID077084@svn.freebsd.org> From: Steven Hartland Date: Thu, 10 Jan 2013 11:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245252 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 11:57:47 -0000 Author: smh Date: Thu Jan 10 11:57:46 2013 New Revision: 245252 URL: http://svnweb.freebsd.org/changeset/base/245252 Log: Updates delete_method sysctl changes to always maintain disk d_flags DISKFLAG_CANDELETE. While this change makes this layer consistent other layers such as UFS and ZFS BIO_DELETE support may not notice any change made manually via these device sysctls until the device is reopened via a mount. Also corrected var order in dadeletemethodsysctl PR: kern/169801 Reviewed by: pjd (mentor) Approved by: mav MFC after: 2 weeks Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Jan 10 11:28:12 2013 (r245251) +++ head/sys/cam/scsi/scsi_da.c Thu Jan 10 11:57:46 2013 (r245252) @@ -863,6 +863,8 @@ static void daasync(void *callback_arg, static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); +static int dadeletemethodset(struct da_softc *softc, + da_delete_methods delete_method); static periph_ctor_t daregister; static periph_dtor_t dacleanup; static periph_start_t dastart; @@ -1489,7 +1491,7 @@ dasysctlinit(void *context, int pending) */ SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "delete_method", CTLTYPE_STRING | CTLFLAG_RW, - &softc->delete_method, 0, dadeletemethodsysctl, "A", + softc, 0, dadeletemethodsysctl, "A", "BIO_DELETE execution method"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, @@ -1566,14 +1568,33 @@ dacmdsizesysctl(SYSCTL_HANDLER_ARGS) } static int +dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method) +{ + + if (delete_method < 0 || delete_method > DA_DELETE_MAX) + return (EINVAL); + + softc->delete_method = delete_method; + + if (softc->delete_method > DA_DELETE_DISABLE) + softc->disk->d_flags |= DISKFLAG_CANDELETE; + else + softc->disk->d_flags &= ~DISKFLAG_CANDELETE; + + return (0); +} + +static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS) { char buf[16]; - int error; const char *p; - int i, value; + struct da_softc *softc; + int i, error, value; - value = *(int *)arg1; + softc = (struct da_softc *)arg1; + + value = softc->delete_method; if (value < 0 || value > DA_DELETE_MAX) p = "UNKNOWN"; else @@ -1585,8 +1606,7 @@ dadeletemethodsysctl(SYSCTL_HANDLER_ARGS for (i = 0; i <= DA_DELETE_MAX; i++) { if (strcmp(buf, da_delete_method_names[i]) != 0) continue; - *(int *)arg1 = i; - return (0); + return dadeletemethodset(softc, i); } return (EINVAL); } @@ -2082,24 +2102,24 @@ cmd6workaround(union ccb *ccb) if (softc->delete_method == DA_DELETE_UNMAP) { xpt_print(ccb->ccb_h.path, "UNMAP is not supported, " "switching to WRITE SAME(16) with UNMAP.\n"); - softc->delete_method = DA_DELETE_WS16; + dadeletemethodset(softc, DA_DELETE_WS16); } else if (softc->delete_method == DA_DELETE_WS16) { xpt_print(ccb->ccb_h.path, "WRITE SAME(16) with UNMAP is not supported, " "disabling BIO_DELETE.\n"); - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); } else if (softc->delete_method == DA_DELETE_WS10) { xpt_print(ccb->ccb_h.path, "WRITE SAME(10) with UNMAP is not supported, " "disabling BIO_DELETE.\n"); - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); } else if (softc->delete_method == DA_DELETE_ZERO) { xpt_print(ccb->ccb_h.path, "WRITE SAME(10) is not supported, " "disabling BIO_DELETE.\n"); - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); } else - softc->delete_method = DA_DELETE_DISABLE; + dadeletemethodset(softc, DA_DELETE_DISABLE); while ((bp = bioq_takefirst(&softc->delete_run_queue)) != NULL) bioq_disksort(&softc->delete_queue, bp); @@ -2345,7 +2365,7 @@ dadone(struct cam_periph *periph, union rcaplong, sizeof(*rcaplong)); if ((lalba & SRC16_LBPME_A) && softc->delete_method == DA_DELETE_NONE) - softc->delete_method = DA_DELETE_UNMAP; + dadeletemethodset(softc, DA_DELETE_UNMAP); dp = &softc->params; snprintf(announce_buf, sizeof(announce_buf), "%juMB (%ju %u byte sectors: %dH %dS/T " From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 12:25:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 18425F17; Thu, 10 Jan 2013 12:25:01 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A805A30; Thu, 10 Jan 2013 12:25:01 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ACP08b085330; Thu, 10 Jan 2013 12:25:00 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ACP0sX085329; Thu, 10 Jan 2013 12:25:00 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201301101225.r0ACP0sX085329@svn.freebsd.org> From: Steven Hartland Date: Thu, 10 Jan 2013 12:25:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245253 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 12:25:01 -0000 Author: smh Date: Thu Jan 10 12:25:00 2013 New Revision: 245253 URL: http://svnweb.freebsd.org/changeset/base/245253 Log: Changed scsi_da device requests to use the sysctl tunable value for retry_count and da_default_timeout where their current hardcoded values matched the current default value for said tunables. PR: kern/169976 Reviewed by: pjd (mentor) Approved by: mav Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Thu Jan 10 11:57:46 2013 (r245252) +++ head/sys/cam/scsi/scsi_da.c Thu Jan 10 12:25:00 2013 (r245253) @@ -2044,7 +2044,7 @@ out: break; } scsi_read_capacity(&start_ccb->csio, - /*retries*/4, + /*retries*/da_retry_count, dadone, MSG_SIMPLE_Q_TAG, rcap, @@ -2067,7 +2067,7 @@ out: break; } scsi_read_capacity_16(&start_ccb->csio, - /*retries*/ 4, + /*retries*/ da_retry_count, /*cbfcnp*/ dadone, /*tag_action*/ MSG_SIMPLE_Q_TAG, /*lba*/ 0, @@ -2076,7 +2076,7 @@ out: /*rcap_buf*/ (uint8_t *)rcaplong, /*rcap_buf_len*/ sizeof(*rcaplong), /*sense_len*/ SSD_FULL_SIZE, - /*timeout*/ 60000); + /*timeout*/ da_default_timeout * 1000); start_ccb->ccb_h.ccb_bp = NULL; start_ccb->ccb_h.ccb_state = DA_CCB_PROBE2; xpt_action(start_ccb); From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 12:43:59 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C6752606; Thu, 10 Jan 2013 12:43:59 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8322B6B; Thu, 10 Jan 2013 12:43:59 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0AChxl3090557; Thu, 10 Jan 2013 12:43:59 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0AChwR7090554; Thu, 10 Jan 2013 12:43:58 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301101243.r0AChwR7090554@svn.freebsd.org> From: Andrey Zonov Date: Thu, 10 Jan 2013 12:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245255 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 12:43:59 -0000 Author: zont Date: Thu Jan 10 12:43:58 2013 New Revision: 245255 URL: http://svnweb.freebsd.org/changeset/base/245255 Log: - Reduce kernel size by removing unnecessary pointer indirections. GENERIC kernel size reduced in 16 bytes and RACCT kernel in 336 bytes. Suggested by: alc Reviewed by: alc Approved by: kib (mentor) MFC after: 1 week Modified: head/sys/vm/vm_map.c head/sys/vm/vm_mmap.c head/sys/vm/vm_unix.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Thu Jan 10 12:30:58 2013 (r245254) +++ head/sys/vm/vm_map.c Thu Jan 10 12:43:58 2013 (r245255) @@ -3281,8 +3281,7 @@ vm_map_stack(vm_map_t map, vm_offset_t a } if (!old_mlock && map->flags & MAP_WIREFUTURE) { - if (ptoa(vmspace_wired_count(curproc->p_vmspace)) + - init_ssize > lmemlim) { + if (ptoa(pmap_wired_count(map->pmap)) + init_ssize > lmemlim) { vm_map_unlock(map); return (KERN_NO_SPACE); } @@ -3505,8 +3504,7 @@ Retry: grow_amount = limit - ctob(vm->vm_ssize); #endif if (!old_mlock && map->flags & MAP_WIREFUTURE) { - if (ptoa(vmspace_wired_count(p->p_vmspace)) + grow_amount > - lmemlim) { + if (ptoa(pmap_wired_count(map->pmap)) + grow_amount > lmemlim) { vm_map_unlock_read(map); rv = KERN_NO_SPACE; goto out; @@ -3514,7 +3512,7 @@ Retry: #ifdef RACCT PROC_LOCK(p); if (racct_set(p, RACCT_MEMLOCK, - ptoa(vmspace_wired_count(p->p_vmspace)) + grow_amount)) { + ptoa(pmap_wired_count(map->pmap)) + grow_amount)) { PROC_UNLOCK(p); vm_map_unlock_read(map); rv = KERN_NO_SPACE; @@ -3645,7 +3643,7 @@ out: KASSERT(error == 0, ("decreasing RACCT_VMEM failed")); if (!old_mlock) { error = racct_set(p, RACCT_MEMLOCK, - ptoa(vmspace_wired_count(p->p_vmspace))); + ptoa(pmap_wired_count(map->pmap))); KASSERT(error == 0, ("decreasing RACCT_MEMLOCK failed")); } error = racct_set(p, RACCT_STACK, ctob(vm->vm_ssize)); Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Thu Jan 10 12:30:58 2013 (r245254) +++ head/sys/vm/vm_mmap.c Thu Jan 10 12:43:58 2013 (r245255) @@ -1038,6 +1038,7 @@ sys_mlock(td, uap) struct proc *proc; vm_offset_t addr, end, last, start; vm_size_t npages, size; + vm_map_t map; unsigned long nsize; int error; @@ -1055,8 +1056,9 @@ sys_mlock(td, uap) if (npages > vm_page_max_wired) return (ENOMEM); proc = td->td_proc; + map = &proc->p_vmspace->vm_map; PROC_LOCK(proc); - nsize = ptoa(npages + vmspace_wired_count(proc->p_vmspace)); + nsize = ptoa(npages + pmap_wired_count(map->pmap)); if (nsize > lim_cur(proc, RLIMIT_MEMLOCK)) { PROC_UNLOCK(proc); return (ENOMEM); @@ -1071,13 +1073,13 @@ sys_mlock(td, uap) if (error != 0) return (ENOMEM); #endif - error = vm_map_wire(&proc->p_vmspace->vm_map, start, end, + error = vm_map_wire(map, start, end, VM_MAP_WIRE_USER | VM_MAP_WIRE_NOHOLES); #ifdef RACCT if (error != KERN_SUCCESS) { PROC_LOCK(proc); racct_set(proc, RACCT_MEMLOCK, - ptoa(vmspace_wired_count(proc->p_vmspace))); + ptoa(pmap_wired_count(map->pmap))); PROC_UNLOCK(proc); } #endif @@ -1151,7 +1153,7 @@ sys_mlockall(td, uap) if (error != KERN_SUCCESS) { PROC_LOCK(td->td_proc); racct_set(td->td_proc, RACCT_MEMLOCK, - ptoa(vmspace_wired_count(td->td_proc->p_vmspace))); + ptoa(pmap_wired_count(map->pmap))); PROC_UNLOCK(td->td_proc); } #endif @@ -1485,16 +1487,15 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, return (ENOMEM); } if (!old_mlock && map->flags & MAP_WIREFUTURE) { - if (ptoa(vmspace_wired_count(td->td_proc->p_vmspace)) + - size > lim_cur(td->td_proc, RLIMIT_MEMLOCK)) { + if (ptoa(pmap_wired_count(map->pmap)) + size > + lim_cur(td->td_proc, RLIMIT_MEMLOCK)) { racct_set_force(td->td_proc, RACCT_VMEM, map->size); PROC_UNLOCK(td->td_proc); return (ENOMEM); } error = racct_set(td->td_proc, RACCT_MEMLOCK, - ptoa(vmspace_wired_count(td->td_proc->p_vmspace)) + - size); + ptoa(pmap_wired_count(map->pmap)) + size); if (error != 0) { racct_set_force(td->td_proc, RACCT_VMEM, map->size); Modified: head/sys/vm/vm_unix.c ============================================================================== --- head/sys/vm/vm_unix.c Thu Jan 10 12:30:58 2013 (r245254) +++ head/sys/vm/vm_unix.c Thu Jan 10 12:43:58 2013 (r245255) @@ -118,7 +118,7 @@ sys_obreak(td, uap) } if (new > old) { if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { - if (ptoa(vmspace_wired_count(td->td_proc->p_vmspace)) + + if (ptoa(pmap_wired_count(vm->vm_map.pmap)) + (new - old) > lmemlim) { error = ENOMEM; goto done; @@ -146,7 +146,7 @@ sys_obreak(td, uap) } if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { error = racct_set(td->td_proc, RACCT_MEMLOCK, - ptoa(vmspace_wired_count(td->td_proc->p_vmspace)) + + ptoa(pmap_wired_count(vm->vm_map.pmap)) + (new - old)); if (error != 0) { racct_set_force(td->td_proc, RACCT_DATA, @@ -176,8 +176,7 @@ sys_obreak(td, uap) racct_set_force(td->td_proc, RACCT_VMEM, vm->vm_map.size); if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { racct_set_force(td->td_proc, RACCT_MEMLOCK, - ptoa(vmspace_wired_count( - td->td_proc->p_vmspace))); + ptoa(pmap_wired_count(vm->vm_map.pmap))); } PROC_UNLOCK(td->td_proc); #endif @@ -212,7 +211,7 @@ sys_obreak(td, uap) racct_set_force(td->td_proc, RACCT_VMEM, vm->vm_map.size); if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { racct_set_force(td->td_proc, RACCT_MEMLOCK, - ptoa(vmspace_wired_count(td->td_proc->p_vmspace))); + ptoa(pmap_wired_count(vm->vm_map.pmap))); } PROC_UNLOCK(td->td_proc); #endif From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 14:03:39 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 19A13318; Thu, 10 Jan 2013 14:03:39 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qc0-f172.google.com (mail-qc0-f172.google.com [209.85.216.172]) by mx1.freebsd.org (Postfix) with ESMTP id 4C2BEF05; Thu, 10 Jan 2013 14:03:38 +0000 (UTC) Received: by mail-qc0-f172.google.com with SMTP id b25so364085qca.17 for ; Thu, 10 Jan 2013 06:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=CX+A31CvMan8Eqs3wRN9Pr+9J6UddJF3YNU4c+wC9l0=; b=FJQYKv1CItYivHQe78uhnEZwq+6xm/FTV++4l2d+ECDG2qc2k+hOJGZpDeKy/K3a/4 C97kC66IqLvLQ+uenlnv/AJq0fFFoeBuJMnkUgcT4fyXToF4SRKkSYre+KtRvNtS0AMh SLK6OPEEasxtaWG6kuFm+nrHJ2CUyCrvSQh34iDWktekjsGD6Lw051FUaERVmipeuf2H AeiyQA2JuFhVbITm82DY1+rd9VUdG6HARh9j/OhzjCVUB1RCIUK0itgAYaeP6Icp40vZ i6h5CQqv9fsZa+EYCtXX/F11Bx12yS1hFiBFCjTa+9fsDThOktRWnhel7yyZsgKoueG+ RWJA== MIME-Version: 1.0 Received: by 10.224.184.143 with SMTP id ck15mr56526235qab.67.1357826612211; Thu, 10 Jan 2013 06:03:32 -0800 (PST) Received: by 10.229.78.96 with HTTP; Thu, 10 Jan 2013 06:03:31 -0800 (PST) In-Reply-To: <201301101243.r0AChwR7090554@svn.freebsd.org> References: <201301101243.r0AChwR7090554@svn.freebsd.org> Date: Thu, 10 Jan 2013 17:03:31 +0300 Message-ID: Subject: Re: svn commit: r245255 - head/sys/vm From: Sergey Kandaurov To: Andrey Zonov Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 14:03:39 -0000 On 10 January 2013 16:43, Andrey Zonov wrote: > Author: zont > Date: Thu Jan 10 12:43:58 2013 > New Revision: 245255 > URL: http://svnweb.freebsd.org/changeset/base/245255 > > Log: > - Reduce kernel size by removing unnecessary pointer indirections. > > GENERIC kernel size reduced in 16 bytes and RACCT kernel in 336 bytes. > > Suggested by: alc > Reviewed by: alc > Approved by: kib (mentor) > MFC after: 1 week > > Modified: > head/sys/vm/vm_map.c > head/sys/vm/vm_mmap.c > head/sys/vm/vm_unix.c > > Modified: head/sys/vm/vm_map.c > ============================================================================== > --- head/sys/vm/vm_map.c Thu Jan 10 12:30:58 2013 (r245254) > +++ head/sys/vm/vm_map.c Thu Jan 10 12:43:58 2013 (r245255) [...] > @@ -3505,8 +3504,7 @@ Retry: > grow_amount = limit - ctob(vm->vm_ssize); > #endif > if (!old_mlock && map->flags & MAP_WIREFUTURE) { > - if (ptoa(vmspace_wired_count(p->p_vmspace)) + grow_amount > > - lmemlim) { > + if (ptoa(pmap_wired_count(map->pmap)) + grow_amount > lmemlim) { > vm_map_unlock_read(map); > rv = KERN_NO_SPACE; > goto out; > @@ -3514,7 +3512,7 @@ Retry: > #ifdef RACCT > PROC_LOCK(p); > if (racct_set(p, RACCT_MEMLOCK, > - ptoa(vmspace_wired_count(p->p_vmspace)) + grow_amount)) { > + ptoa(pmap_wired_count(map->pmap)) + grow_amount)) { > PROC_UNLOCK(p); > vm_map_unlock_read(map); > rv = KERN_NO_SPACE; > @@ -3645,7 +3643,7 @@ out: > KASSERT(error == 0, ("decreasing RACCT_VMEM failed")); > if (!old_mlock) { > error = racct_set(p, RACCT_MEMLOCK, > - ptoa(vmspace_wired_count(p->p_vmspace))); > + ptoa(pmap_wired_count(map->pmap))); > KASSERT(error == 0, ("decreasing RACCT_MEMLOCK failed")); > } > error = racct_set(p, RACCT_STACK, ctob(vm->vm_ssize)); > Hi, although vm_fault_hold() is the only caller of vm_map_growstack() and it passes curproc as a process argument, this is a public function and more callers can grow theoretically with !curproc. For the reason, shouldn't vmspace be used with vmspace_acquire_ref()/vmspace_free() ? Just nitpicking.. -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 14:08:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 10F574C5; Thu, 10 Jan 2013 14:08:20 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0377AF2C; Thu, 10 Jan 2013 14:08:20 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0AE8JAi014054; Thu, 10 Jan 2013 14:08:19 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0AE8J73014053; Thu, 10 Jan 2013 14:08:19 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201301101408.r0AE8J73014053@svn.freebsd.org> From: Hajimu UMEMOTO Date: Thu, 10 Jan 2013 14:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245256 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 14:08:20 -0000 Author: ume Date: Thu Jan 10 14:08:19 2013 New Revision: 245256 URL: http://svnweb.freebsd.org/changeset/base/245256 Log: Re-enable ip6addrctl support but only for IPv6 address. Requested by: Ben Morrow MFC after: 1 week Modified: head/lib/libc/net/name6.c Modified: head/lib/libc/net/name6.c ============================================================================== --- head/lib/libc/net/name6.c Thu Jan 10 12:43:58 2013 (r245255) +++ head/lib/libc/net/name6.c Thu Jan 10 14:08:19 2013 (r245256) @@ -200,7 +200,7 @@ static struct hostent *_hpmapv6(struct #endif static struct hostent *_hpsort(struct hostent *, res_state); -#ifdef ENABLE_IP6ADDRCTL +#ifdef INET6 static struct hostent *_hpreorder(struct hostent *); static int get_addrselectpolicy(struct policyhead *); static void free_addrselectpolicy(struct policyhead *); @@ -287,8 +287,10 @@ getipnodebyname(const char *name, int af hp = gethostbyname2(name, af); hp = _hpcopy(hp, errp); - #ifdef INET6 + if (af == AF_INET6) + hp = _hpreorder(hp); + if (af == AF_INET6 && ((flags & AI_ALL) || hp == NULL) && MAPADDRENABLED(flags)) { struct hostent *hp2 = gethostbyname2(name, AF_INET); @@ -311,11 +313,7 @@ getipnodebyname(const char *name, int af *errp = statp->res_h_errno; statp->options = options; -#ifdef ENABLE_IP6ADDRCTL - return _hpreorder(_hpsort(hp, statp)); -#else return _hpsort(hp, statp); -#endif } struct hostent * @@ -638,7 +636,7 @@ _hpsort(struct hostent *hp, res_state st return hp; } -#ifdef ENABLE_IP6ADDRCTL +#ifdef INET6 /* * _hpreorder: sort address by default address selection */ From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 18:18:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 156CCA49; Thu, 10 Jan 2013 18:18:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 636A4E72; Thu, 10 Jan 2013 18:18:24 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r0AIIJ5v043781; Thu, 10 Jan 2013 20:18:19 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r0AIIJ5v043781 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r0AIIJ8p043780; Thu, 10 Jan 2013 20:18:19 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 10 Jan 2013 20:18:19 +0200 From: Konstantin Belousov To: Sergey Kandaurov Subject: Re: svn commit: r245255 - head/sys/vm Message-ID: <20130110181819.GV2561@kib.kiev.ua> References: <201301101243.r0AChwR7090554@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="U8v/hV883cEE9JJG" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, Andrey Zonov , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 18:18:25 -0000 --U8v/hV883cEE9JJG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 10, 2013 at 05:03:31PM +0300, Sergey Kandaurov wrote: > On 10 January 2013 16:43, Andrey Zonov wrote: > > Author: zont > > Date: Thu Jan 10 12:43:58 2013 > > New Revision: 245255 > > URL: http://svnweb.freebsd.org/changeset/base/245255 > > > > Log: > > - Reduce kernel size by removing unnecessary pointer indirections. > > > > GENERIC kernel size reduced in 16 bytes and RACCT kernel in 336 bytes. > > > > Suggested by: alc > > Reviewed by: alc > > Approved by: kib (mentor) > > MFC after: 1 week > > > > Modified: > > head/sys/vm/vm_map.c > > head/sys/vm/vm_mmap.c > > head/sys/vm/vm_unix.c > > > > Modified: head/sys/vm/vm_map.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- head/sys/vm/vm_map.c Thu Jan 10 12:30:58 2013 (r24525= 4) > > +++ head/sys/vm/vm_map.c Thu Jan 10 12:43:58 2013 (r24525= 5) > [...] > > @@ -3505,8 +3504,7 @@ Retry: > > grow_amount =3D limit - ctob(vm->vm_ssize); > > #endif > > if (!old_mlock && map->flags & MAP_WIREFUTURE) { > > - if (ptoa(vmspace_wired_count(p->p_vmspace)) + grow_amou= nt > > > - lmemlim) { > > + if (ptoa(pmap_wired_count(map->pmap)) + grow_amount > l= memlim) { > > vm_map_unlock_read(map); > > rv =3D KERN_NO_SPACE; > > goto out; > > @@ -3514,7 +3512,7 @@ Retry: > > #ifdef RACCT > > PROC_LOCK(p); > > if (racct_set(p, RACCT_MEMLOCK, > > - ptoa(vmspace_wired_count(p->p_vmspace)) + grow_amou= nt)) { > > + ptoa(pmap_wired_count(map->pmap)) + grow_amount)) { > > PROC_UNLOCK(p); > > vm_map_unlock_read(map); > > rv =3D KERN_NO_SPACE; > > @@ -3645,7 +3643,7 @@ out: > > KASSERT(error =3D=3D 0, ("decreasing RACCT_VMEM failed"= )); > > if (!old_mlock) { > > error =3D racct_set(p, RACCT_MEMLOCK, > > - ptoa(vmspace_wired_count(p->p_vmspace))); > > + ptoa(pmap_wired_count(map->pmap))); > > KASSERT(error =3D=3D 0, ("decreasing RACCT_MEML= OCK failed")); > > } > > error =3D racct_set(p, RACCT_STACK, ctob(vm->vm_ssize)); > > >=20 > Hi, > although vm_fault_hold() is the only caller of vm_map_growstack() > and it passes curproc as a process argument, this is a public function > and more callers can grow theoretically with !curproc. For the reason, > shouldn't vmspace be used with vmspace_acquire_ref()/vmspace_free() ? > Just nitpicking.. >=20 No, vm_map_growstack() is not a public interface. It is indeed exposed, but this is due to the lack of the formal KBI and KPI definitions, and not by intent. Adding vmspace reference there is pointless, it adds two atomics for the path for no use. --U8v/hV883cEE9JJG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ7wXqAAoJEJDCuSvBvK1BmSUP/2kjDAAxyOe0GBZU3olbxWfY 61BO6HdAgOeZoy1zaA8ucrob4/i9AS4thRkyaK3PeIFKENGbyB504AS5XPb+dXYF C0ocm/EFzQGsQCeC9lfm1KHd/ncFPA/VKYFWObdn0nEoBER5Dgs8NHJ7kM824v3P VqAGAauRX+n7OunFV4kflnfXdf5o5eP4/g+VdZkK6Y6yNVc2KnAOym4q3Bs75e6y 0AET610tLbjkuKT+qpzqe76UrOrDxOIpsLNsuPs/jwtru4PX14rnfNu0wGJsoHsy g21mQPeKc6HtM7VxabG1Dd0IxTopJyg+YQo3g+v0K7ieowgSJruigVgSbwCIj7Cs d4zfh/TwokvJ0ja6yBDmXgDKKOpNHZTiXljk7OXzNC5he2u9a0k/D+e3Mc3x12J+ C6wWpgIcKpzwucN31qNya6b6SctgcEjOJebDbvXU+cee5iZk6bSM+oQqiLppmiZ/ jGDqFqfJUXrDQAy3RCAk7DYNHi4OF8YPSRjyvCISklWqWbER7x2r1SfOhi7WRb+c L6UNqQm+SGGu8gjyq21Yx3rPx/xOV2gBZlHSRn/bJBt6iVoXd2Xe06Tq7nBK4Tr6 4Gdax5m6LxrWuZnekSwWSv2z1ccuZghWWtmR2dPw3+6T56SHMxSaqlezyvmsEVXK caaaYMYp01uWP4c8/8gA =7W6/ -----END PGP SIGNATURE----- --U8v/hV883cEE9JJG-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 18:24:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC5BDE16; Thu, 10 Jan 2013 18:24:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A9BEAEC3; Thu, 10 Jan 2013 18:24:48 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0AIOm8e087641; Thu, 10 Jan 2013 18:24:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0AIOmJh087640; Thu, 10 Jan 2013 18:24:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301101824.r0AIOmJh087640@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 10 Jan 2013 18:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245262 - head/sys/fs/nullfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 18:24:48 -0000 Author: kib Date: Thu Jan 10 18:24:48 2013 New Revision: 245262 URL: http://svnweb.freebsd.org/changeset/base/245262 Log: When nullfs mount is forcibly unmounted and nullfs vnode is reclaimed, get back the leased write reference from the lower vnode. There is no other path which can correct v_writecount on the lowervp. Reported by: flo Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Thu Jan 10 18:04:42 2013 (r245261) +++ head/sys/fs/nullfs/null_vnops.c Thu Jan 10 18:24:48 2013 (r245262) @@ -740,6 +740,14 @@ null_reclaim(struct vop_reclaim_args *ap vp->v_object = NULL; vp->v_vnlock = &vp->v_lock; VI_UNLOCK(vp); + + /* + * If we were opened for write, we leased one write reference + * to the lower vnode. If this is a reclamation due to the + * forced unmount, undo the reference now. + */ + if (vp->v_writecount > 0) + VOP_ADD_WRITECOUNT(lowervp, -1); vput(lowervp); free(xp, M_NULLFSNODE); From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 18:51:35 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E161C6A2; Thu, 10 Jan 2013 18:51:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D3B9275; Thu, 10 Jan 2013 18:51:35 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0AIpZpo095569; Thu, 10 Jan 2013 18:51:35 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0AIpZZN095568; Thu, 10 Jan 2013 18:51:35 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301101851.r0AIpZZN095568@svn.freebsd.org> From: Warner Losh Date: Thu, 10 Jan 2013 18:51:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245263 - head/sys/dev/sym X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 18:51:36 -0000 Author: imp Date: Thu Jan 10 18:51:35 2013 New Revision: 245263 URL: http://svnweb.freebsd.org/changeset/base/245263 Log: Clang complains about the comparision of fak < 0 always being false. It is right. Delete it because on the next line we catch all 'negative' cases with the test > 2, since 'negative' numbers are just really big unsigned numbers and we do an identical action. Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Thu Jan 10 18:24:48 2013 (r245262) +++ head/sys/dev/sym/sym_hipd.c Thu Jan 10 18:51:35 2013 (r245263) @@ -3426,7 +3426,6 @@ sym_getsync(hcb_p np, u_char dt, u_char /* * Check against our hardware limits, or bugs :). */ - if (fak < 0) {fak = 0; ret = -1;} if (fak > 2) {fak = 2; ret = -1;} /* From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 19:26:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B0895A3B; Thu, 10 Jan 2013 19:26:57 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0E9E31E; Thu, 10 Jan 2013 19:26:57 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0AJQv7v002433; Thu, 10 Jan 2013 19:26:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0AJQuIx002429; Thu, 10 Jan 2013 19:26:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301101926.r0AJQuIx002429@svn.freebsd.org> From: Xin LI Date: Thu, 10 Jan 2013 19:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245264 - in head: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 19:26:57 -0000 Author: delphij Date: Thu Jan 10 19:26:56 2013 New Revision: 245264 URL: http://svnweb.freebsd.org/changeset/base/245264 Log: The current ZFS code expects ddt_zap_count to always succeed by asserting the underlying zap_count() to return no errors. However, it is possible that the pool reaches to such a state where zap_count would return error, leading to panics when a pool is imported. This commit changes the ddt_zap_count to return error returned from zap_count and handle the error appropriately. With this change, it's now possible to let zpool rollback damaged transaction groups and import the pool. Obtained from: ZFS on Linux github (e8fd45a0f975c6b8ae8cd644714fc21f14fac2bf) MFC after: 1 month Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Modified: head/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Jan 10 18:51:35 2013 (r245263) +++ head/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Jan 10 19:26:56 2013 (r245264) @@ -704,7 +704,9 @@ dump_ddt(ddt_t *ddt, enum ddt_type type, return; ASSERT(error == 0); - if ((count = ddt_object_count(ddt, type, class)) == 0) + error = ddt_object_count(ddt, type, class, &count); + ASSERT(error == 0); + if (count == 0) return; dspace = doi.doi_physical_blocks_512 << 9; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Thu Jan 10 18:51:35 2013 (r245263) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Thu Jan 10 19:26:56 2013 (r245264) @@ -89,12 +89,13 @@ ddt_object_destroy(ddt_t *ddt, enum ddt_ spa_t *spa = ddt->ddt_spa; objset_t *os = ddt->ddt_os; uint64_t *objectp = &ddt->ddt_object[type][class]; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); ASSERT(*objectp != 0); - ASSERT(ddt_object_count(ddt, type, class) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0 && count == 0); ASSERT(ddt_histogram_empty(&ddt->ddt_histogram[type][class])); VERIFY(zap_remove(os, DMU_POOL_DIRECTORY_OBJECT, name, tx) == 0); VERIFY(zap_remove(os, spa->spa_ddt_stat_object, name, tx) == 0); @@ -109,6 +110,7 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; int error; @@ -129,7 +131,11 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + error = ddt_object_count(ddt, type, class, &count); + if (error) + return error; + + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; @@ -143,6 +149,7 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); @@ -155,8 +162,9 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ * Cache DDT statistics; this is the only time they'll change. */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; } @@ -213,13 +221,13 @@ ddt_object_walk(ddt_t *ddt, enum ddt_typ ddt->ddt_object[type][class], dde, walk)); } -uint64_t -ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class) +int +ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class, uint64_t *count) { ASSERT(ddt_object_exists(ddt, type, class)); return (ddt_ops[type]->ddt_op_count(ddt->ddt_os, - ddt->ddt_object[type][class])); + ddt->ddt_object[type][class], count)); } int @@ -1079,11 +1087,13 @@ ddt_sync_table(ddt_t *ddt, dmu_tx_t *tx, } for (enum ddt_type type = 0; type < DDT_TYPES; type++) { - uint64_t count = 0; + uint64_t add, count = 0; for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { if (ddt_object_exists(ddt, type, class)) { ddt_object_sync(ddt, type, class, tx); - count += ddt_object_count(ddt, type, class); + VERIFY(ddt_object_count(ddt, type, class, + &add) == 0); + count += add; } } for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Thu Jan 10 18:51:35 2013 (r245263) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Thu Jan 10 19:26:56 2013 (r245264) @@ -133,14 +133,11 @@ ddt_zap_walk(objset_t *os, uint64_t obje return (error); } -static uint64_t -ddt_zap_count(objset_t *os, uint64_t object) +static int +ddt_zap_count(objset_t *os, uint64_t object, uint64_t *count) { - uint64_t count = 0; - VERIFY(zap_count(os, object, &count) == 0); - - return (count); + return (zap_count(os, object, count)); } const ddt_ops_t ddt_zap_ops = { Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Thu Jan 10 18:51:35 2013 (r245263) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Thu Jan 10 19:26:56 2013 (r245264) @@ -163,7 +163,7 @@ typedef struct ddt_ops { dmu_tx_t *tx); int (*ddt_op_walk)(objset_t *os, uint64_t object, ddt_entry_t *dde, uint64_t *walk); - uint64_t (*ddt_op_count)(objset_t *os, uint64_t object); + int (*ddt_op_count)(objset_t *os, uint64_t object, uint64_t *count); } ddt_ops_t; #define DDT_NAMELEN 80 @@ -172,8 +172,8 @@ extern void ddt_object_name(ddt_t *ddt, enum ddt_class cls, char *name); extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde); -extern uint64_t ddt_object_count(ddt_t *ddt, enum ddt_type type, - enum ddt_class cls); +extern int ddt_object_count(ddt_t *ddt, enum ddt_type type, + enum ddt_class class, uint64_t *count); extern int ddt_object_info(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, dmu_object_info_t *); extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type, From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 19:46:09 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23BB4FDC; Thu, 10 Jan 2013 19:46:09 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 15DED634; Thu, 10 Jan 2013 19:46:09 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0AJk8S0007763; Thu, 10 Jan 2013 19:46:08 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0AJk8aJ007762; Thu, 10 Jan 2013 19:46:08 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301101946.r0AJk8aJ007762@svn.freebsd.org> From: Brooks Davis Date: Thu, 10 Jan 2013 19:46:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245265 - head/share/zoneinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 19:46:09 -0000 Author: brooks Date: Thu Jan 10 19:46:08 2013 New Revision: 245265 URL: http://svnweb.freebsd.org/changeset/base/245265 Log: Rather than using zic to both compile and install zoneinfo files, generate the files during the build and install them with install(1). This was the one place in installworld where files (vs links) were installed by a tool other than install. Reviewed by: edwin, jilles Modified: head/share/zoneinfo/Makefile Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Thu Jan 10 19:26:56 2013 (r245264) +++ head/share/zoneinfo/Makefile Thu Jan 10 19:46:08 2013 (r245265) @@ -29,6 +29,7 @@ # CLEANFILES+= yearistype +CLEANDIRS+= builddir CONTRIBDIR= ${.CURDIR}/../../contrib/tzdata/ .PATH: ${CONTRIBDIR} @@ -48,13 +49,39 @@ TZFILES+= backward systemv TZFILES:= ${TZFILES:S/^/${CONTRIBDIR}/} -all: yearistype - -beforeinstall: +TZBUILDDIR= ${.OBJDIR}/builddir +TZBUILDSUBDIRS= \ + Africa \ + America/Argentina \ + America/Indiana \ + America/Kentucky \ + America/North_Dakota \ + Antarctica \ + Arctic \ + Asia \ + Atlantic \ + Australia \ + Etc \ + Europe \ + Indian \ + Pacific \ + SystemV + +all: zoneinfo + +.PHONY: zoneinfo +zoneinfo: yearistype ${TDATA} + mkdir -p ${TZBUILDDIR} + cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS} umask 022; cd ${.CURDIR}; \ - zic -D -d ${DESTDIR}/usr/share/zoneinfo -p ${POSIXRULES} \ - -u ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ + zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \ ${LEAPFILE} -y ${.OBJDIR}/yearistype ${TZFILES} + +beforeinstall: + cd ${TZBUILDDIR} && \ + find . -type f -print | xargs -I _FILE_ ${INSTALL} \ + -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ + _FILE_ ${DESTDIR}/usr/share/zoneinfo/_FILE_ ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 21:38:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E8E1BD69; Thu, 10 Jan 2013 21:38:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DC2E1A12; Thu, 10 Jan 2013 21:38:31 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ALcVgp039305; Thu, 10 Jan 2013 21:38:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ALcVCW039303; Thu, 10 Jan 2013 21:38:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301102138.r0ALcVCW039303@svn.freebsd.org> From: Alexander Motin Date: Thu, 10 Jan 2013 21:38:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245266 - head/sys/dev/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 21:38:32 -0000 Author: mav Date: Thu Jan 10 21:38:31 2013 New Revision: 245266 URL: http://svnweb.freebsd.org/changeset/base/245266 Log: Remove not very useful printf, that can be too chatty. ASUS P8Z77-V board reports _AC2, _AC3 and _AC4 setpoints as 0C. With active cooling already automatically set to _AC2, that still caused driver to print two useless lines about temperature above _AC3 and _AC4 every ten seconds. Three setponts of 0C is probably a board bug, but the same spam could happen also in correct case if system is runnign not with the lowest cooling level. Modified: head/sys/dev/acpica/acpi_thermal.c Modified: head/sys/dev/acpica/acpi_thermal.c ============================================================================== --- head/sys/dev/acpica/acpi_thermal.c Thu Jan 10 19:46:08 2013 (r245265) +++ head/sys/dev/acpica/acpi_thermal.c Thu Jan 10 21:38:31 2013 (r245266) @@ -509,15 +509,8 @@ acpi_tz_monitor(void *Context) */ newactive = TZ_ACTIVE_NONE; for (i = TZ_NUMLEVELS - 1; i >= 0; i--) { - if (sc->tz_zone.ac[i] != -1 && temp >= sc->tz_zone.ac[i]) { + if (sc->tz_zone.ac[i] != -1 && temp >= sc->tz_zone.ac[i]) newactive = i; - if (sc->tz_active != newactive) { - ACPI_VPRINT(sc->tz_dev, - acpi_device_get_parent_softc(sc->tz_dev), - "_AC%d: temperature %d.%d >= setpoint %d.%d\n", i, - TZ_KELVTOC(temp), TZ_KELVTOC(sc->tz_zone.ac[i])); - } - } } /* From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 22:36:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8C502E4B; Thu, 10 Jan 2013 22:36:31 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7494EE17; Thu, 10 Jan 2013 22:36:31 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0AMaVE2057113; Thu, 10 Jan 2013 22:36:31 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0AMaV2v057111; Thu, 10 Jan 2013 22:36:31 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201301102236.r0AMaV2v057111@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 10 Jan 2013 22:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245268 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 22:36:31 -0000 Author: pluknet Date: Thu Jan 10 22:36:30 2013 New Revision: 245268 URL: http://svnweb.freebsd.org/changeset/base/245268 Log: The Giant lock is no longer used in the vm_map(9) part of the VM. While here, document that the process lock is acquired in vm_map_stack, too. MFC after: 1 week Modified: head/share/man/man9/vm_map_insert.9 head/share/man/man9/vm_map_stack.9 Modified: head/share/man/man9/vm_map_insert.9 ============================================================================== --- head/share/man/man9/vm_map_insert.9 Thu Jan 10 22:15:13 2013 (r245267) +++ head/share/man/man9/vm_map_insert.9 Thu Jan 10 22:36:30 2013 (r245268) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2003 +.Dd January 11, 2013 .Dt VM_MAP_INSERT 9 .Os .Sh NAME @@ -73,9 +73,6 @@ This function implicitly creates a new .Vt vm_map_entry by calling the internal function .Fn vm_map_entry_create . -This function may use the -.Va Giant -lock to ensure that only a single thread is present in the function. .Sh RETURN VALUES The .Fn vm_map_insert Modified: head/share/man/man9/vm_map_stack.9 ============================================================================== --- head/share/man/man9/vm_map_stack.9 Thu Jan 10 22:15:13 2013 (r245267) +++ head/share/man/man9/vm_map_stack.9 Thu Jan 10 22:36:30 2013 (r245268) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 19, 2003 +.Dd January 11, 2013 .Dt VM_MAP_STACK 9 .Os .Sh NAME @@ -81,11 +81,11 @@ function calls to create its mappings. .Pp The +.Fn vm_map_stack +and .Fn vm_map_growstack -function acquires the -.Va Giant -lock, and the process lock on -.Fa p , +functions acquire the process lock on +.Fa p for the duration of the call. .Sh RETURN VALUES The From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 22:44:20 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 803DE179; Thu, 10 Jan 2013 22:44:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 64C7EE68; Thu, 10 Jan 2013 22:44:20 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0AMiKHM059600; Thu, 10 Jan 2013 22:44:20 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0AMiJ1k059594; Thu, 10 Jan 2013 22:44:19 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201301102244.r0AMiJ1k059594@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 10 Jan 2013 22:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245269 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 22:44:20 -0000 Author: des Date: Thu Jan 10 22:44:19 2013 New Revision: 245269 URL: http://svnweb.freebsd.org/changeset/base/245269 Log: Remove all support for legacy NOFOO and NO_FOO build options. Deleted: head/share/mk/bsd.compat.mk Modified: head/share/mk/Makefile head/share/mk/bsd.init.mk head/share/mk/bsd.own.mk head/share/mk/sys.mk Modified: head/share/mk/Makefile ============================================================================== --- head/share/mk/Makefile Thu Jan 10 22:36:30 2013 (r245268) +++ head/share/mk/Makefile Thu Jan 10 22:44:19 2013 (r245269) @@ -6,7 +6,6 @@ FILES= \ bsd.README \ bsd.arch.inc.mk \ - bsd.compat.mk \ bsd.compiler.mk \ bsd.cpu.mk \ bsd.crunchgen.mk \ Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Thu Jan 10 22:36:30 2013 (r245268) +++ head/share/mk/bsd.init.mk Thu Jan 10 22:44:19 2013 (r245269) @@ -9,7 +9,6 @@ ____: .if exists(${.CURDIR}/../Makefile.inc) .include "${.CURDIR}/../Makefile.inc" .endif -.include .include .MAIN: all .endif # !target(____) Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Thu Jan 10 22:36:30 2013 (r245268) +++ head/share/mk/bsd.own.mk Thu Jan 10 22:44:19 2013 (r245269) @@ -216,80 +216,6 @@ WITHOUT_${var}= .endfor # -# Compat NO_* options (same as above, except their use is deprecated). -# -.if !defined(BURN_BRIDGES) -.for var in \ - ACPI \ - ATM \ - AUDIT \ - AUTHPF \ - BIND \ - BIND_DNSSEC \ - BIND_ETC \ - BIND_LIBS_LWRES \ - BIND_MTREE \ - BIND_NAMED \ - BIND_UTILS \ - BLUETOOTH \ - BOOT \ - CALENDAR \ - CPP \ - CRYPT \ - CVS \ - CXX \ - DICT \ - DYNAMICROOT \ - EXAMPLES \ - FORTH \ - FP_LIBC \ - GAMES \ - GCOV \ - GDB \ - GNU \ - GPIB \ - GROFF \ - HTML \ - INET6 \ - INFO \ - IPFILTER \ - IPX \ - KDUMP \ - KERBEROS \ - LIB32 \ - LIBPTHREAD \ - LIBTHR \ - LOCALES \ - LPR \ - MAILWRAPPER \ - NETCAT \ - NIS \ - NLS \ - NLS_CATALOGS \ - NS_CACHING \ - OPENSSH \ - OPENSSL \ - PAM \ - PF \ - RCMDS \ - RCS \ - RESCUE \ - SENDMAIL \ - SETUID_LOGIN \ - SHAREDOCS \ - SYSCONS \ - TCSH \ - TOOLCHAIN \ - USB \ - WPA_SUPPLICANT_EAPOL -.if defined(NO_${var}) -#.warning NO_${var} is deprecated in favour of WITHOUT_${var}= -WITHOUT_${var}= -.endif -.endfor -.endif # !defined(BURN_BRIDGES) - -# # Older-style variables that enabled behaviour when set. # .if defined(YES_HESIOD) Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Thu Jan 10 22:36:30 2013 (r245268) +++ head/share/mk/sys.mk Thu Jan 10 22:44:19 2013 (r245269) @@ -346,5 +346,4 @@ OBJFORMAT?= elf .endif -.include .include From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 23:29:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 19FFBBC0; Thu, 10 Jan 2013 23:29:37 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 07078FCA; Thu, 10 Jan 2013 23:29:37 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ANTaCV071654; Thu, 10 Jan 2013 23:29:36 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ANTavG071653; Thu, 10 Jan 2013 23:29:36 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301102329.r0ANTavG071653@svn.freebsd.org> From: Brooks Davis Date: Thu, 10 Jan 2013 23:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245271 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 23:29:37 -0000 Author: brooks Date: Thu Jan 10 23:29:36 2013 New Revision: 245271 URL: http://svnweb.freebsd.org/changeset/base/245271 Log: Add xargs to the set of install tools when zoneinfo is not disabled. This fixes installworld which I had broken in r245265. Reported by: Nikolai Lifanov Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jan 10 23:06:32 2013 (r245270) +++ head/Makefile.inc1 Thu Jan 10 23:29:36 2013 (r245271) @@ -643,7 +643,7 @@ installcheck_UGID: _install-info= install-info .endif .if ${MK_ZONEINFO} != "no" -_zoneinfo= zic tzsetup +_zoneinfo= zic tzsetup xargs .endif ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 23:36:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7F41EE21; Thu, 10 Jan 2013 23:36:03 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 41E916C; Thu, 10 Jan 2013 23:36:03 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ANa38r073948; Thu, 10 Jan 2013 23:36:03 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ANa3IP073947; Thu, 10 Jan 2013 23:36:03 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201301102336.r0ANa3IP073947@svn.freebsd.org> From: Dimitry Andric Date: Thu, 10 Jan 2013 23:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245272 - head/contrib/gcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 23:36:03 -0000 Author: dim Date: Thu Jan 10 23:36:02 2013 New Revision: 245272 URL: http://svnweb.freebsd.org/changeset/base/245272 Log: Add an ugly hack to libgcc's unwind code, to make it behave properly at runtime on amd64, when it is compiled by clang. Some versions of clang don't save and restore all callee registers, if a __builtin_eh_return() intrinsic is used in a function. This is particularly bad on amd64. Until the problem gets fixed by upstream, use an asm statement to force clang to assume the registers in question are clobbered, when invoking __builtin_eh_return(), so it will emit code to save and restore them. This should fix the crashes reported on -current with some C++ programs, particularly those that throw exceptions over multiple function boundaries. Reported by: stefanf MFC after: 3 days Modified: head/contrib/gcc/unwind-dw2.c Modified: head/contrib/gcc/unwind-dw2.c ============================================================================== --- head/contrib/gcc/unwind-dw2.c Thu Jan 10 23:29:36 2013 (r245271) +++ head/contrib/gcc/unwind-dw2.c Thu Jan 10 23:36:02 2013 (r245272) @@ -1438,6 +1438,17 @@ uw_init_context_1 (struct _Unwind_Contex context->ra = __builtin_extract_return_addr (outer_ra); } +#if defined(__clang__) && defined(__amd64__) +/* Some versions of clang don't save and restore all callee registers, if a + __builtin_eh_return() intrinsic is used in a function. This is particularly + bad on amd64. For now, use the following ugly hack to force it to assume + those registers are clobbered, when invoking __builtin_eh_return(), so it + will emit code to save and restore them. */ +#define CLOBBER_REGS_HACK \ + __asm __volatile(" " : : : "r15", "r14", "r13", "r12", "rbx", "rdx", "rax"); +#else +#define CLOBBER_REGS_HACK +#endif /* __clang__ */ /* Install TARGET into CURRENT so that we can return to it. This is a macro because __builtin_eh_return must be invoked in the context of @@ -1448,6 +1459,7 @@ uw_init_context_1 (struct _Unwind_Contex { \ long offset = uw_install_context_1 ((CURRENT), (TARGET)); \ void *handler = __builtin_frob_return_addr ((TARGET)->ra); \ + CLOBBER_REGS_HACK \ __builtin_eh_return (offset, handler); \ } \ while (0) From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 23:41:09 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 54F122EF; Thu, 10 Jan 2013 23:41:09 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 923B8BC; Thu, 10 Jan 2013 23:41:08 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r0ANf8n3080494; Thu, 10 Jan 2013 17:41:08 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r0ANf832080493; Thu, 10 Jan 2013 17:41:08 -0600 (CST) (envelope-from brooks) Date: Thu, 10 Jan 2013 17:41:08 -0600 From: Brooks Davis To: Dimitry Andric Subject: Re: svn commit: r244401 - in head: contrib/libc-vis include lib/libc/gen Message-ID: <20130110234108.GB79810@lor.one-eyed-alien.net> References: <201212181637.qBIGbP7e084145@svn.freebsd.org> <50D65630.8010901@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7iMSBzlTiPOCCT2k" Content-Disposition: inline In-Reply-To: <50D65630.8010901@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Brooks Davis , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 23:41:09 -0000 --7iMSBzlTiPOCCT2k Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Dec 23, 2012 at 01:54:08AM +0100, Dimitry Andric wrote: > On 2012-12-18 17:37, Brooks Davis wrote: > > Author: brooks > > Date: Tue Dec 18 16:37:24 2012 > > New Revision: 244401 > > URL: http://svnweb.freebsd.org/changeset/base/244401 > > > > Log: > > Replace our implementation of the vis(3) and unvis(3) APIs with > > NetBSD's. This output size limited versions of vis and unvis functi= ons > > as well as a set of vis variants that allow arbitrary characters to = be > > specified for encoding. >=20 > This seems to break bootstrapping in some scenarios, in "stage 4.2: > building libraries"; for example, with a test run with gcc on > ref10-amd64.f.o I got this: >=20 > gcc -O2 -pipe -I/scratch2/tmp/dim/head/lib/libc/include -I/scratch2/tmp= /dim/head/lib/libc/../../include -I/scratch2/tmp/dim/head/lib/libc/amd64 -D= NLS -D__DBINTERFACE_PRIVATE -I/scratch2/tmp/dim/head/lib/libc/../../contri= b/gdtoa -DINET6 -I/scratch2/tmp/dim/obj/scratch2/tmp/dim/head/lib/libc -I/s= cratch2/tmp/dim/head/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/scra= tch2/tmp/dim/head/lib/libc/../../contrib/jemalloc/include -I/scratch2/tmp/d= im/head/lib/libc/../../contrib/tzcode/stdtime -I/scratch2/tmp/dim/head/lib/= libc/stdtime -I/scratch2/tmp/dim/head/lib/libc/locale -DBROKEN_DES -DPORTMA= P -DDES_BUILTIN -I/scratch2/tmp/dim/head/lib/libc/rpc -DYP -DNS_CACHING -D_= FREEFALL_CONFIG -DSYMBOL_VERSIONING -std=3Dgnu99 -fstack-protector -Wsystem= -headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign= -c /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/vis.c -o vis.o > /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c: In functi= on 'unvis': > /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error= : 'VIS_NOESCAPE' undeclared (first use in this function) > /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error= : (Each undeclared identifier is reported only once > /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:237: error= : for each function it appears in.) > /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:241: error= : 'VIS_HTTP1808' undeclared (first use in this function) > /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:245: error= : 'VIS_HTTP1866' undeclared (first use in this function) > /scratch2/tmp/dim/head/lib/libc/../../contrib/libc-vis/unvis.c:249: error= : 'VIS_MIMESTYLE' undeclared (first use in this function) >=20 > There should most likely be an explicit -I option to point the compiler > at the correct vis.h header during the early stages, otherwise it will > pick up /usr/include/vis.h, which does not have several of these new > VIS_XXX defines. Sorry for not following up on this sooner. I've not seen this at all and most of my builds are done on an 9.0-STABLE box so vis.h isn't updated. Adding CFLAGS+=3D -I${CURDIR}/../../contrib/libc-vis to lib/libc/gen/Makefile.inc seems like it should fix this, but I'm surprised not to have bumped into this or broken tinderbox. Is there anything odd about your buildworld command? -- Brooks --7iMSBzlTiPOCCT2k Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFQ71GTXY6L6fI4GtQRAnqBAJ0b0wLIEOTQhc2t5kIlsKPMIUeiMwCfVEQ/ J1QAJOfy29Hi7mJVT4UdGV4= =Gsm3 -----END PGP SIGNATURE----- --7iMSBzlTiPOCCT2k-- From owner-svn-src-head@FreeBSD.ORG Thu Jan 10 23:56:51 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 536A5A1E; Thu, 10 Jan 2013 23:56:51 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 36F421DA; Thu, 10 Jan 2013 23:56:51 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0ANup7e079664; Thu, 10 Jan 2013 23:56:51 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0ANuoRm079659; Thu, 10 Jan 2013 23:56:50 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301102356.r0ANuoRm079659@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 10 Jan 2013 23:56:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245274 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Jan 2013 23:56:51 -0000 Author: np Date: Thu Jan 10 23:56:50 2013 New Revision: 245274 URL: http://svnweb.freebsd.org/changeset/base/245274 Log: cxgbe(4): Add functions to help synchronize "slow" operations (those not on the fast data path) and use them instead of frobbing the adapter lock and busy flag directly. Other changes made while reworking all slow operations: - Wait for the reply to a filter request (add/delete). This guarantees that the operation is complete by the time the ioctl returns. - Tidy up the tid_info structure. - Do not allow the tx queue size to be set to something that's not a power of 2. MFC after: 1 week Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/tom/t4_tom.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Jan 10 23:39:28 2013 (r245273) +++ head/sys/dev/cxgbe/adapter.h Thu Jan 10 23:56:50 2013 (r245274) @@ -158,6 +158,16 @@ enum { }; enum { + /* flags understood by begin_synchronized_op */ + HOLD_LOCK = (1 << 0), + SLEEP_OK = (1 << 1), + INTR_OK = (1 << 2), + + /* flags understood by end_synchronized_op */ + LOCK_HELD = HOLD_LOCK, +}; + +enum { /* adapter flags */ FULL_INIT_DONE = (1 << 0), FW_OK = (1 << 1), @@ -174,11 +184,11 @@ enum { PORT_SYSCTL_CTX = (1 << 2), }; -#define IS_DOOMED(pi) (pi->flags & DOOMED) -#define SET_DOOMED(pi) do {pi->flags |= DOOMED;} while (0) -#define IS_BUSY(sc) (sc->flags & CXGBE_BUSY) -#define SET_BUSY(sc) do {sc->flags |= CXGBE_BUSY;} while (0) -#define CLR_BUSY(sc) do {sc->flags &= ~CXGBE_BUSY;} while (0) +#define IS_DOOMED(pi) ((pi)->flags & DOOMED) +#define SET_DOOMED(pi) do {(pi)->flags |= DOOMED;} while (0) +#define IS_BUSY(sc) ((sc)->flags & CXGBE_BUSY) +#define SET_BUSY(sc) do {(sc)->flags |= CXGBE_BUSY;} while (0) +#define CLR_BUSY(sc) do {(sc)->flags &= ~CXGBE_BUSY;} while (0) struct port_info { device_t dev; @@ -591,6 +601,11 @@ struct adapter { an_handler_t an_handler __aligned(CACHE_LINE_SIZE); fw_msg_handler_t fw_msg_handler[4]; /* NUM_FW6_TYPES */ cpl_handler_t cpl_handler[0xef]; /* NUM_CPL_CMDS */ + +#ifdef INVARIANTS + const char *last_op; + const void *last_op_thr; +#endif }; #define ADAPTER_LOCK(sc) mtx_lock(&(sc)->sc_lock) @@ -598,6 +613,12 @@ struct adapter { #define ADAPTER_LOCK_ASSERT_OWNED(sc) mtx_assert(&(sc)->sc_lock, MA_OWNED) #define ADAPTER_LOCK_ASSERT_NOTOWNED(sc) mtx_assert(&(sc)->sc_lock, MA_NOTOWNED) +/* XXX: not bulletproof, but much better than nothing */ +#define ASSERT_SYNCHRONIZED_OP(sc) \ + KASSERT(IS_BUSY(sc) && \ + (mtx_owned(&(sc)->sc_lock) || sc->last_op_thr == curthread), \ + ("%s: operation not synchronized.", __func__)) + #define PORT_LOCK(pi) mtx_lock(&(pi)->pi_lock) #define PORT_UNLOCK(pi) mtx_unlock(&(pi)->pi_lock) #define PORT_LOCK_ASSERT_OWNED(pi) mtx_assert(&(pi)->pi_lock, MA_OWNED) @@ -751,6 +772,8 @@ int t4_register_cpl_handler(struct adapt int t4_register_an_handler(struct adapter *, an_handler_t); int t4_register_fw_msg_handler(struct adapter *, int, fw_msg_handler_t); int t4_filter_rpl(struct sge_iq *, const struct rss_header *, struct mbuf *); +int begin_synchronized_op(struct adapter *, struct port_info *, int, char *); +void end_synchronized_op(struct adapter *, int); /* t4_sge.c */ void t4_sge_modload(void); Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Thu Jan 10 23:39:28 2013 (r245273) +++ head/sys/dev/cxgbe/offload.h Thu Jan 10 23:56:50 2013 (r245274) @@ -75,29 +75,27 @@ union aopen_entry { */ struct tid_info { void **tid_tab; - unsigned int ntids; + u_int ntids; + u_int tids_in_use; + struct mtx stid_lock __aligned(CACHE_LINE_SIZE); union serv_entry *stid_tab; - unsigned int nstids; - unsigned int stid_base; + u_int nstids; + u_int stid_base; + union serv_entry *sfree; + u_int stids_in_use; + struct mtx atid_lock __aligned(CACHE_LINE_SIZE); union aopen_entry *atid_tab; - unsigned int natids; - - struct filter_entry *ftid_tab; - unsigned int nftids; - unsigned int ftid_base; - unsigned int ftids_in_use; - - struct mtx atid_lock; + u_int natids; union aopen_entry *afree; - unsigned int atids_in_use; + u_int atids_in_use; - struct mtx stid_lock; - union serv_entry *sfree; - unsigned int stids_in_use; - - unsigned int tids_in_use; + struct mtx ftid_lock __aligned(CACHE_LINE_SIZE); + struct filter_entry *ftid_tab; + u_int nftids; + u_int ftid_base; + u_int ftids_in_use; }; struct t4_range { Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Jan 10 23:39:28 2013 (r245273) +++ head/sys/dev/cxgbe/t4_main.c Thu Jan 10 23:56:50 2013 (r245274) @@ -284,9 +284,7 @@ static int get_params__post_init(struct static void t4_set_desc(struct adapter *); static void build_medialist(struct port_info *); static int update_mac_settings(struct port_info *, int); -static int cxgbe_init_locked(struct port_info *); static int cxgbe_init_synchronized(struct port_info *); -static int cxgbe_uninit_locked(struct port_info *); static int cxgbe_uninit_synchronized(struct port_info *); static int setup_intr_handlers(struct adapter *); static int adapter_full_init(struct adapter *); @@ -348,6 +346,7 @@ static void clear_filter(struct filter_e static int set_filter_wr(struct adapter *, int); static int del_filter_wr(struct adapter *, int); static int get_sge_context(struct adapter *, struct t4_sge_context *); +static int load_fw(struct adapter *, struct t4_data *); static int read_card_mem(struct adapter *, struct t4_mem_range *); static int read_i2c(struct adapter *, struct t4_i2c_data *); #ifdef TCP_OFFLOAD @@ -820,6 +819,8 @@ t4_detach(device_t dev) mtx_destroy(&sc->sc_lock); } + if (mtx_initialized(&sc->tids.ftid_lock)) + mtx_destroy(&sc->tids.ftid_lock); if (mtx_initialized(&sc->sfl_lock)) mtx_destroy(&sc->sfl_lock); @@ -918,6 +919,10 @@ cxgbe_detach(device_t dev) while (IS_BUSY(sc)) mtx_sleep(&sc->flags, &sc->sc_lock, 0, "t4detach", 0); SET_BUSY(sc); +#ifdef INVARIANTS + sc->last_op = "t4detach"; + sc->last_op_thr = curthread; +#endif ADAPTER_UNLOCK(sc); if (pi->vlan_c) @@ -939,7 +944,7 @@ cxgbe_detach(device_t dev) ADAPTER_LOCK(sc); CLR_BUSY(sc); - wakeup_one(&sc->flags); + wakeup(&sc->flags); ADAPTER_UNLOCK(sc); return (0); @@ -951,9 +956,10 @@ cxgbe_init(void *arg) struct port_info *pi = arg; struct adapter *sc = pi->adapter; - ADAPTER_LOCK(sc); - cxgbe_init_locked(pi); /* releases adapter lock */ - ADAPTER_LOCK_ASSERT_NOTOWNED(sc); + if (begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4init") != 0) + return; + cxgbe_init_synchronized(pi); + end_synchronized_op(sc, 0); } static int @@ -967,81 +973,56 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned switch (cmd) { case SIOCSIFMTU: - ADAPTER_LOCK(sc); - rc = IS_DOOMED(pi) ? ENXIO : (IS_BUSY(sc) ? EBUSY : 0); - if (rc) { -fail: - ADAPTER_UNLOCK(sc); - return (rc); - } - mtu = ifr->ifr_mtu; - if ((mtu < ETHERMIN) || (mtu > ETHERMTU_JUMBO)) { - rc = EINVAL; - } else { - ifp->if_mtu = mtu; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - t4_update_fl_bufsize(ifp); - PORT_LOCK(pi); - rc = update_mac_settings(pi, XGMAC_MTU); - PORT_UNLOCK(pi); - } + if ((mtu < ETHERMIN) || (mtu > ETHERMTU_JUMBO)) + return (EINVAL); + + rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4mtu"); + if (rc) + return (rc); + ifp->if_mtu = mtu; + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + t4_update_fl_bufsize(ifp); + rc = update_mac_settings(pi, XGMAC_MTU); } - ADAPTER_UNLOCK(sc); + end_synchronized_op(sc, 0); break; case SIOCSIFFLAGS: - ADAPTER_LOCK(sc); - if (IS_DOOMED(pi)) { - rc = ENXIO; - goto fail; - } + rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4flg"); + if (rc) + return (rc); + if (ifp->if_flags & IFF_UP) { if (ifp->if_drv_flags & IFF_DRV_RUNNING) { flags = pi->if_flags; if ((ifp->if_flags ^ flags) & (IFF_PROMISC | IFF_ALLMULTI)) { - if (IS_BUSY(sc)) { - rc = EBUSY; - goto fail; - } - PORT_LOCK(pi); rc = update_mac_settings(pi, XGMAC_PROMISC | XGMAC_ALLMULTI); - PORT_UNLOCK(pi); } - ADAPTER_UNLOCK(sc); } else - rc = cxgbe_init_locked(pi); + rc = cxgbe_init_synchronized(pi); pi->if_flags = ifp->if_flags; } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) - rc = cxgbe_uninit_locked(pi); - else - ADAPTER_UNLOCK(sc); - - ADAPTER_LOCK_ASSERT_NOTOWNED(sc); + rc = cxgbe_uninit_synchronized(pi); + end_synchronized_op(sc, 0); break; case SIOCADDMULTI: - case SIOCDELMULTI: /* these two can be called with a mutex held :-( */ - ADAPTER_LOCK(sc); - rc = IS_DOOMED(pi) ? ENXIO : (IS_BUSY(sc) ? EBUSY : 0); + case SIOCDELMULTI: /* these two are called with a mutex held :-( */ + rc = begin_synchronized_op(sc, pi, HOLD_LOCK, "t4multi"); if (rc) - goto fail; - - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - PORT_LOCK(pi); + return (rc); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) rc = update_mac_settings(pi, XGMAC_MCADDRS); - PORT_UNLOCK(pi); - } - ADAPTER_UNLOCK(sc); + end_synchronized_op(sc, LOCK_HELD); break; case SIOCSIFCAP: - ADAPTER_LOCK(sc); - rc = IS_DOOMED(pi) ? ENXIO : (IS_BUSY(sc) ? EBUSY : 0); + rc = begin_synchronized_op(sc, pi, SLEEP_OK | INTR_OK, "t4cap"); if (rc) - goto fail; + return (rc); mask = ifr->ifr_reqcap ^ ifp->if_capenable; if (mask & IFCAP_TXCSUM) { @@ -1122,11 +1103,8 @@ fail: #endif if (mask & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable ^= IFCAP_VLAN_HWTAGGING; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - PORT_LOCK(pi); + if (ifp->if_drv_flags & IFF_DRV_RUNNING) rc = update_mac_settings(pi, XGMAC_VLANEX); - PORT_UNLOCK(pi); - } } if (mask & IFCAP_VLAN_MTU) { ifp->if_capenable ^= IFCAP_VLAN_MTU; @@ -1141,7 +1119,8 @@ fail: #ifdef VLAN_CAPABILITIES VLAN_CAPABILITIES(ifp); #endif - ADAPTER_UNLOCK(sc); +fail: + end_synchronized_op(sc, 0); break; case SIOCSIFMEDIA: @@ -2111,7 +2090,7 @@ update_mac_settings(struct port_info *pi struct adapter *sc = pi->adapter; int mtu = -1, promisc = -1, allmulti = -1, vlanex = -1; - PORT_LOCK_ASSERT_OWNED(pi); + ASSERT_SYNCHRONIZED_OP(sc); KASSERT(flags, ("%s: not told what to update.", __func__)); if (flags & XGMAC_MTU) @@ -2213,39 +2192,74 @@ mcfail: return (rc); } -static int -cxgbe_init_locked(struct port_info *pi) +int +begin_synchronized_op(struct adapter *sc, struct port_info *pi, int flags, + char *wmesg) { - struct adapter *sc = pi->adapter; - int rc = 0; + int rc, pri; + +#ifdef WITNESS + /* the caller thinks it's ok to sleep, but is it really? */ + if (flags & SLEEP_OK) + pause("t4slptst", 1); +#endif + + if (INTR_OK) + pri = PCATCH; + else + pri = 0; + + ADAPTER_LOCK(sc); + for (;;) { + + if (pi && IS_DOOMED(pi)) { + rc = ENXIO; + goto done; + } + + if (!IS_BUSY(sc)) { + rc = 0; + break; + } - ADAPTER_LOCK_ASSERT_OWNED(sc); + if (!(flags & SLEEP_OK)) { + rc = EBUSY; + goto done; + } - while (!IS_DOOMED(pi) && IS_BUSY(sc)) { - if (mtx_sleep(&sc->flags, &sc->sc_lock, PCATCH, "t4init", 0)) { + if (mtx_sleep(&sc->flags, &sc->sc_lock, pri, wmesg, 0)) { rc = EINTR; goto done; } } - if (IS_DOOMED(pi)) { - rc = ENXIO; - goto done; - } - KASSERT(!IS_BUSY(sc), ("%s: controller busy.", __func__)); - /* Give up the adapter lock, port init code can sleep. */ + KASSERT(!IS_BUSY(sc), ("%s: controller busy.", __func__)); SET_BUSY(sc); - ADAPTER_UNLOCK(sc); - - rc = cxgbe_init_synchronized(pi); +#ifdef INVARIANTS + sc->last_op = wmesg; + sc->last_op_thr = curthread; +#endif done: - ADAPTER_LOCK(sc); + if (!(flags & HOLD_LOCK) || rc) + ADAPTER_UNLOCK(sc); + + return (rc); +} + +void +end_synchronized_op(struct adapter *sc, int flags) +{ + + if (flags & LOCK_HELD) + ADAPTER_LOCK_ASSERT_OWNED(sc); + else + ADAPTER_LOCK(sc); + KASSERT(IS_BUSY(sc), ("%s: controller not busy.", __func__)); CLR_BUSY(sc); - wakeup_one(&sc->flags); + wakeup(&sc->flags); ADAPTER_UNLOCK(sc); - return (rc); } static int @@ -2255,7 +2269,7 @@ cxgbe_init_synchronized(struct port_info struct ifnet *ifp = pi->ifp; int rc = 0; - ADAPTER_LOCK_ASSERT_NOTOWNED(sc); + ASSERT_SYNCHRONIZED_OP(sc); if (isset(&sc->open_device_map, pi->port_id)) { KASSERT(ifp->if_drv_flags & IFF_DRV_RUNNING, @@ -2271,9 +2285,7 @@ cxgbe_init_synchronized(struct port_info ((rc = port_full_init(pi)) != 0)) return (rc); /* error message displayed already */ - PORT_LOCK(pi); rc = update_mac_settings(pi, XGMAC_ALL); - PORT_UNLOCK(pi); if (rc) goto done; /* error message displayed already */ @@ -2291,7 +2303,9 @@ cxgbe_init_synchronized(struct port_info /* all ok */ setbit(&sc->open_device_map, pi->port_id); + PORT_LOCK(pi); ifp->if_drv_flags |= IFF_DRV_RUNNING; + PORT_UNLOCK(pi); callout_reset(&pi->tick, hz, cxgbe_tick, pi); done: @@ -2301,39 +2315,6 @@ done: return (rc); } -static int -cxgbe_uninit_locked(struct port_info *pi) -{ - struct adapter *sc = pi->adapter; - int rc; - - ADAPTER_LOCK_ASSERT_OWNED(sc); - - while (!IS_DOOMED(pi) && IS_BUSY(sc)) { - if (mtx_sleep(&sc->flags, &sc->sc_lock, PCATCH, "t4uninit", 0)) { - rc = EINTR; - goto done; - } - } - if (IS_DOOMED(pi)) { - rc = ENXIO; - goto done; - } - KASSERT(!IS_BUSY(sc), ("%s: controller busy.", __func__)); - SET_BUSY(sc); - ADAPTER_UNLOCK(sc); - - rc = cxgbe_uninit_synchronized(pi); - - ADAPTER_LOCK(sc); - KASSERT(IS_BUSY(sc), ("%s: controller not busy.", __func__)); - CLR_BUSY(sc); - wakeup_one(&sc->flags); -done: - ADAPTER_UNLOCK(sc); - return (rc); -} - /* * Idempotent. */ @@ -2344,7 +2325,7 @@ cxgbe_uninit_synchronized(struct port_in struct ifnet *ifp = pi->ifp; int rc; - ADAPTER_LOCK_ASSERT_NOTOWNED(sc); + ASSERT_SYNCHRONIZED_OP(sc); /* * Disable the VI so that all its data in either direction is discarded @@ -2360,7 +2341,9 @@ cxgbe_uninit_synchronized(struct port_in } clrbit(&sc->open_device_map, pi->port_id); + PORT_LOCK(pi); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + PORT_UNLOCK(pi); pi->link_cfg.link_ok = 0; pi->link_cfg.speed = 0; @@ -2539,7 +2522,7 @@ port_full_init(struct port_info *pi) struct sge_rxq *rxq; int rc, i; - ADAPTER_LOCK_ASSERT_NOTOWNED(sc); + ASSERT_SYNCHRONIZED_OP(sc); KASSERT((pi->flags & PORT_INIT_DONE) == 0, ("%s: PORT_INIT_DONE already", __func__)); @@ -3524,6 +3507,8 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_AR struct port_info *pi = arg1; struct adapter *sc = pi->adapter; int idx, rc, i; + struct sge_rxq *rxq; + uint8_t v; idx = pi->tmr_idx; @@ -3534,25 +3519,23 @@ sysctl_holdoff_tmr_idx(SYSCTL_HANDLER_AR if (idx < 0 || idx >= SGE_NTIMERS) return (EINVAL); - ADAPTER_LOCK(sc); - rc = IS_DOOMED(pi) ? ENXIO : (IS_BUSY(sc) ? EBUSY : 0); - if (rc == 0) { - struct sge_rxq *rxq; - uint8_t v; + rc = begin_synchronized_op(sc, pi, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4tmr"); + if (rc) + return (rc); - v = V_QINTR_TIMER_IDX(idx) | V_QINTR_CNT_EN(pi->pktc_idx != -1); - for_each_rxq(pi, i, rxq) { + v = V_QINTR_TIMER_IDX(idx) | V_QINTR_CNT_EN(pi->pktc_idx != -1); + for_each_rxq(pi, i, rxq) { #ifdef atomic_store_rel_8 - atomic_store_rel_8(&rxq->iq.intr_params, v); + atomic_store_rel_8(&rxq->iq.intr_params, v); #else - rxq->iq.intr_params = v; + rxq->iq.intr_params = v; #endif - } - pi->tmr_idx = idx; } + pi->tmr_idx = idx; - ADAPTER_UNLOCK(sc); - return (rc); + end_synchronized_op(sc, LOCK_HELD); + return (0); } static int @@ -3571,15 +3554,17 @@ sysctl_holdoff_pktc_idx(SYSCTL_HANDLER_A if (idx < -1 || idx >= SGE_NCOUNTERS) return (EINVAL); - ADAPTER_LOCK(sc); - rc = IS_DOOMED(pi) ? ENXIO : (IS_BUSY(sc) ? EBUSY : 0); - if (rc == 0 && pi->flags & PORT_INIT_DONE) - rc = EBUSY; /* cannot be changed once the queues are created */ + rc = begin_synchronized_op(sc, pi, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4pktc"); + if (rc) + return (rc); - if (rc == 0) + if (pi->flags & PORT_INIT_DONE) + rc = EBUSY; /* cannot be changed once the queues are created */ + else pi->pktc_idx = idx; - ADAPTER_UNLOCK(sc); + end_synchronized_op(sc, LOCK_HELD); return (rc); } @@ -3599,15 +3584,17 @@ sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS) if (qsize < 128 || (qsize & 7)) return (EINVAL); - ADAPTER_LOCK(sc); - rc = IS_DOOMED(pi) ? ENXIO : (IS_BUSY(sc) ? EBUSY : 0); - if (rc == 0 && pi->flags & PORT_INIT_DONE) - rc = EBUSY; /* cannot be changed once the queues are created */ + rc = begin_synchronized_op(sc, pi, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4rxqs"); + if (rc) + return (rc); - if (rc == 0) + if (pi->flags & PORT_INIT_DONE) + rc = EBUSY; /* cannot be changed once the queues are created */ + else pi->qsize_rxq = qsize; - ADAPTER_UNLOCK(sc); + end_synchronized_op(sc, LOCK_HELD); return (rc); } @@ -3624,18 +3611,21 @@ sysctl_qsize_txq(SYSCTL_HANDLER_ARGS) if (rc != 0 || req->newptr == NULL) return (rc); - if (qsize < 128) + /* bufring size must be powerof2 */ + if (qsize < 128 || !powerof2(qsize)) return (EINVAL); - ADAPTER_LOCK(sc); - rc = IS_DOOMED(pi) ? ENXIO : (IS_BUSY(sc) ? EBUSY : 0); - if (rc == 0 && pi->flags & PORT_INIT_DONE) - rc = EBUSY; /* cannot be changed once the queues are created */ + rc = begin_synchronized_op(sc, pi, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4txqs"); + if (rc) + return (rc); - if (rc == 0) + if (pi->flags & PORT_INIT_DONE) + rc = EBUSY; /* cannot be changed once the queues are created */ + else pi->qsize_txq = qsize; - ADAPTER_UNLOCK(sc); + end_synchronized_op(sc, LOCK_HELD); return (rc); } @@ -4674,8 +4664,14 @@ fspec_to_fconf(struct t4_filter_specific static int get_filter_mode(struct adapter *sc, uint32_t *mode) { + int rc; uint32_t fconf; + rc = begin_synchronized_op(sc, NULL, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4getfm"); + if (rc) + return (rc); + t4_read_indirect(sc, A_TP_PIO_ADDR, A_TP_PIO_DATA, &fconf, 1, A_TP_VLAN_PRI_MAP); @@ -4687,6 +4683,7 @@ get_filter_mode(struct adapter *sc, uint *mode = fconf_to_mode(sc->filter_mode); + end_synchronized_op(sc, LOCK_HELD); return (0); } @@ -4698,11 +4695,10 @@ set_filter_mode(struct adapter *sc, uint fconf = mode_to_fconf(mode); - ADAPTER_LOCK(sc); - if (IS_BUSY(sc)) { - rc = EAGAIN; - goto done; - } + rc = begin_synchronized_op(sc, NULL, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4setfm"); + if (rc) + return (rc); if (sc->tids.ftids_in_use > 0) { rc = EBUSY; @@ -4725,7 +4721,7 @@ set_filter_mode(struct adapter *sc, uint #endif done: - ADAPTER_UNLOCK(sc); + end_synchronized_op(sc, LOCK_HELD); return (rc); } @@ -4746,18 +4742,18 @@ get_filter_hits(struct adapter *sc, uint static int get_filter(struct adapter *sc, struct t4_filter *t) { - int i, nfilters = sc->tids.nftids; + int i, rc, nfilters = sc->tids.nftids; struct filter_entry *f; - ADAPTER_LOCK_ASSERT_OWNED(sc); - - if (IS_BUSY(sc)) - return (EAGAIN); + rc = begin_synchronized_op(sc, NULL, HOLD_LOCK | SLEEP_OK | INTR_OK, + "t4getf"); + if (rc) + return (rc); if (sc->tids.ftids_in_use == 0 || sc->tids.ftid_tab == NULL || t->idx >= nfilters) { t->idx = 0xffffffff; - return (0); + goto done; } f = &sc->tids.ftid_tab[t->idx]; @@ -4772,11 +4768,13 @@ get_filter(struct adapter *sc, struct t4 t->hits = UINT64_MAX; t->fs = f->fs; - return (0); + goto done; } } t->idx = 0xffffffff; +done: + end_synchronized_op(sc, LOCK_HELD); return (0); } @@ -4785,40 +4783,58 @@ set_filter(struct adapter *sc, struct t4 { unsigned int nfilters, nports; struct filter_entry *f; - int i; + int i, rc; - ADAPTER_LOCK_ASSERT_OWNED(sc); + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4setf"); + if (rc) + return (rc); nfilters = sc->tids.nftids; nports = sc->params.nports; - if (nfilters == 0) - return (ENOTSUP); + if (nfilters == 0) { + rc = ENOTSUP; + goto done; + } - if (!(sc->flags & FULL_INIT_DONE)) - return (EAGAIN); + if (!(sc->flags & FULL_INIT_DONE)) { + rc = EAGAIN; + goto done; + } - if (t->idx >= nfilters) - return (EINVAL); + if (t->idx >= nfilters) { + rc = EINVAL; + goto done; + } /* Validate against the global filter mode */ - if ((sc->filter_mode | fspec_to_fconf(&t->fs)) != sc->filter_mode) - return (E2BIG); + if ((sc->filter_mode | fspec_to_fconf(&t->fs)) != sc->filter_mode) { + rc = E2BIG; + goto done; + } - if (t->fs.action == FILTER_SWITCH && t->fs.eport >= nports) - return (EINVAL); + if (t->fs.action == FILTER_SWITCH && t->fs.eport >= nports) { + rc = EINVAL; + goto done; + } - if (t->fs.val.iport >= nports) - return (EINVAL); + if (t->fs.val.iport >= nports) { + rc = EINVAL; + goto done; + } /* Can't specify an iq if not steering to it */ - if (!t->fs.dirsteer && t->fs.iq) - return (EINVAL); + if (!t->fs.dirsteer && t->fs.iq) { + rc = EINVAL; + goto done; + } /* IPv6 filter idx must be 4 aligned */ if (t->fs.type == 1 && - ((t->idx & 0x3) || t->idx + 4 >= nfilters)) - return (EINVAL); + ((t->idx & 0x3) || t->idx + 4 >= nfilters)) { + rc = EINVAL; + goto done; + } if (sc->tids.ftid_tab == NULL) { KASSERT(sc->tids.ftids_in_use == 0, @@ -4827,17 +4843,24 @@ set_filter(struct adapter *sc, struct t4 sc->tids.ftid_tab = malloc(sizeof (struct filter_entry) * nfilters, M_CXGBE, M_NOWAIT | M_ZERO); - if (sc->tids.ftid_tab == NULL) - return (ENOMEM); + if (sc->tids.ftid_tab == NULL) { + rc = ENOMEM; + goto done; + } + mtx_init(&sc->tids.ftid_lock, "T4 filters", 0, MTX_DEF); } for (i = 0; i < 4; i++) { f = &sc->tids.ftid_tab[t->idx + i]; - if (f->pending || f->valid) - return (EBUSY); - if (f->locked) - return (EPERM); + if (f->pending || f->valid) { + rc = EBUSY; + goto done; + } + if (f->locked) { + rc = EPERM; + goto done; + } if (t->fs.type == 0) break; @@ -4846,7 +4869,27 @@ set_filter(struct adapter *sc, struct t4 f = &sc->tids.ftid_tab[t->idx]; f->fs = t->fs; - return set_filter_wr(sc, t->idx); + rc = set_filter_wr(sc, t->idx); +done: + end_synchronized_op(sc, 0); + + if (rc == 0) { + mtx_lock(&sc->tids.ftid_lock); + for (;;) { + if (f->pending == 0) { + rc = f->valid ? 0 : EIO; + break; + } + + if (mtx_sleep(&sc->tids.ftid_tab, &sc->tids.ftid_lock, + PCATCH, "t4setfw", 0)) { + rc = EINPROGRESS; + break; + } + } + mtx_unlock(&sc->tids.ftid_lock); + } + return (rc); } static int @@ -4854,37 +4897,67 @@ del_filter(struct adapter *sc, struct t4 { unsigned int nfilters; struct filter_entry *f; + int rc; - ADAPTER_LOCK_ASSERT_OWNED(sc); - - if (IS_BUSY(sc)) - return (EAGAIN); + rc = begin_synchronized_op(sc, NULL, SLEEP_OK | INTR_OK, "t4delf"); + if (rc) + return (rc); nfilters = sc->tids.nftids; - if (nfilters == 0) - return (ENOTSUP); + if (nfilters == 0) { + rc = ENOTSUP; + goto done; + } if (sc->tids.ftid_tab == NULL || sc->tids.ftids_in_use == 0 || - t->idx >= nfilters) - return (EINVAL); + t->idx >= nfilters) { + rc = EINVAL; + goto done; + } - if (!(sc->flags & FULL_INIT_DONE)) - return (EAGAIN); + if (!(sc->flags & FULL_INIT_DONE)) { + rc = EAGAIN; + goto done; + } f = &sc->tids.ftid_tab[t->idx]; - if (f->pending) - return (EBUSY); - if (f->locked) - return (EPERM); + if (f->pending) { + rc = EBUSY; + goto done; + } + if (f->locked) { + rc = EPERM; + goto done; + } if (f->valid) { t->fs = f->fs; /* extra info for the caller */ - return del_filter_wr(sc, t->idx); + rc = del_filter_wr(sc, t->idx); } - return (0); +done: + end_synchronized_op(sc, 0); + + if (rc == 0) { + mtx_lock(&sc->tids.ftid_lock); + for (;;) { + if (f->pending == 0) { + rc = f->valid ? EIO : 0; + break; + } + + if (mtx_sleep(&sc->tids.ftid_tab, &sc->tids.ftid_lock, + PCATCH, "t4delfw", 0)) { + rc = EINPROGRESS; + break; + } + } + mtx_unlock(&sc->tids.ftid_lock); + } + + return (rc); } static void @@ -4904,7 +4977,7 @@ set_filter_wr(struct adapter *sc, int fi struct fw_filter_wr *fwr; unsigned int ftid; - ADAPTER_LOCK_ASSERT_OWNED(sc); + ASSERT_SYNCHRONIZED_OP(sc); if (f->fs.newdmac || f->fs.newvlan) { /* This filter needs an L2T entry; allocate one. */ @@ -5007,8 +5080,6 @@ del_filter_wr(struct adapter *sc, int fi struct fw_filter_wr *fwr; unsigned int ftid; - ADAPTER_LOCK_ASSERT_OWNED(sc); - ftid = sc->tids.ftid_base + fidx; wr = alloc_wrqe(sizeof(*fwr), &sc->sge.mgmtq); @@ -5039,8 +5110,10 @@ t4_filter_rpl(struct sge_iq *iq, const s unsigned int rc = G_COOKIE(rpl->cookie); struct filter_entry *f = &sc->tids.ftid_tab[idx]; - ADAPTER_LOCK(sc); + mtx_lock(&sc->tids.ftid_lock); if (rc == FW_FILTER_WR_FLT_ADDED) { + KASSERT(f->pending, ("%s: filter[%u] isn't pending.", + __func__, idx)); f->smtidx = (be64toh(rpl->oldval) >> 24) & 0xff; f->pending = 0; /* asynchronous setup completed */ f->valid = 1; @@ -5055,7 +5128,8 @@ t4_filter_rpl(struct sge_iq *iq, const s clear_filter(f); sc->tids.ftids_in_use--; } - ADAPTER_UNLOCK(sc); + wakeup(&sc->tids.ftid_tab); + mtx_unlock(&sc->tids.ftid_lock); } return (0); @@ -5064,29 +5138,63 @@ t4_filter_rpl(struct sge_iq *iq, const s static int get_sge_context(struct adapter *sc, struct t4_sge_context *cntxt) { - int rc = EINVAL; + int rc; if (cntxt->cid > M_CTXTQID) - return (rc); + return (EINVAL); if (cntxt->mem_id != CTXT_EGRESS && cntxt->mem_id != CTXT_INGRESS && cntxt->mem_id != CTXT_FLM && cntxt->mem_id != CTXT_CNM) - return (rc); + return (EINVAL); if (sc->flags & FW_OK) { - ADAPTER_LOCK(sc); /* Avoid parallel t4_wr_mbox */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 00:03:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A42DDC35; Fri, 11 Jan 2013 00:03:19 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 96240235; Fri, 11 Jan 2013 00:03:19 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0B03JLa082188; Fri, 11 Jan 2013 00:03:19 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0B03JaJ082187; Fri, 11 Jan 2013 00:03:19 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301110003.r0B03JaJ082187@svn.freebsd.org> From: Warner Losh Date: Fri, 11 Jan 2013 00:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245275 - head/sys/dev/sym X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 00:03:19 -0000 Author: imp Date: Fri Jan 11 00:03:19 2013 New Revision: 245275 URL: http://svnweb.freebsd.org/changeset/base/245275 Log: Use better arm memory barrier Modified: head/sys/dev/sym/sym_hipd.c Modified: head/sys/dev/sym/sym_hipd.c ============================================================================== --- head/sys/dev/sym/sym_hipd.c Thu Jan 10 23:56:50 2013 (r245274) +++ head/sys/dev/sym/sym_hipd.c Fri Jan 11 00:03:19 2013 (r245275) @@ -86,6 +86,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef __sparc64__ #include @@ -136,7 +137,7 @@ typedef u_int32_t u32; #elif defined __sparc64__ #define MEMORY_BARRIER() __asm__ volatile("membar #Sync" : : : "memory") #elif defined __arm__ -#define MEMORY_BARRIER() __do_dmb() +#define MEMORY_BARRIER() dmb() #else #error "Not supported platform" #endif From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 00:07:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B57E2EC4; Fri, 11 Jan 2013 00:07:02 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9738B267; Fri, 11 Jan 2013 00:07:02 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0B072tF082791; Fri, 11 Jan 2013 00:07:02 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0B0714k082786; Fri, 11 Jan 2013 00:07:01 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201301110007.r0B0714k082786@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 11 Jan 2013 00:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245276 - in head/sys/dev/cxgbe: . tom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 00:07:02 -0000 Author: np Date: Fri Jan 11 00:07:01 2013 New Revision: 245276 URL: http://svnweb.freebsd.org/changeset/base/245276 Log: Overhaul the stid allocator so that it can be used for IPv6 servers too. The entry for an IPv6 server in the TCAM takes up the equivalent of two ordinary stids and must be properly aligned too. MFC after: 1 week Modified: head/sys/dev/cxgbe/offload.h head/sys/dev/cxgbe/tom/t4_listen.c head/sys/dev/cxgbe/tom/t4_tom.c head/sys/dev/cxgbe/tom/t4_tom.h Modified: head/sys/dev/cxgbe/offload.h ============================================================================== --- head/sys/dev/cxgbe/offload.h Fri Jan 11 00:03:19 2013 (r245275) +++ head/sys/dev/cxgbe/offload.h Fri Jan 11 00:07:01 2013 (r245276) @@ -54,16 +54,20 @@ OPCODE_TID(w) = htonl(MK_OPCODE_TID(cpl, tid)); \ } while (0) +TAILQ_HEAD(stid_head, stid_region); +struct listen_ctx; + +struct stid_region { + TAILQ_ENTRY(stid_region) link; + int used; /* # of stids used by this region */ + int free; /* # of contiguous stids free right after this region */ +}; + /* * Max # of ATIDs. The absolute HW max is 16K but we keep it lower. */ #define MAX_ATIDS 8192U -union serv_entry { - void *data; - union serv_entry *next; -}; - union aopen_entry { void *data; union aopen_entry *next; @@ -79,11 +83,12 @@ struct tid_info { u_int tids_in_use; struct mtx stid_lock __aligned(CACHE_LINE_SIZE); - union serv_entry *stid_tab; + struct listen_ctx **stid_tab; u_int nstids; u_int stid_base; - union serv_entry *sfree; u_int stids_in_use; + u_int nstids_free_head; /* # of available stids at the begining */ + struct stid_head stids; struct mtx atid_lock __aligned(CACHE_LINE_SIZE); union aopen_entry *atid_tab; Modified: head/sys/dev/cxgbe/tom/t4_listen.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_listen.c Fri Jan 11 00:03:19 2013 (r245275) +++ head/sys/dev/cxgbe/tom/t4_listen.c Fri Jan 11 00:07:01 2013 (r245276) @@ -63,9 +63,9 @@ __FBSDID("$FreeBSD$"); #include "tom/t4_tom.h" /* stid services */ -static int alloc_stid(struct adapter *, void *); -static void *lookup_stid(struct adapter *, int); -static void free_stid(struct adapter *, int); +static int alloc_stid(struct adapter *, struct listen_ctx *, int); +static struct listen_ctx *lookup_stid(struct adapter *, int); +static void free_stid(struct adapter *, struct listen_ctx *); /* lctx services */ static struct listen_ctx *alloc_lctx(struct adapter *, struct inpcb *, @@ -81,45 +81,105 @@ static inline void save_qids_in_mbuf(str static inline void get_qids_from_mbuf(struct mbuf *m, int *, int *); static void send_reset_synqe(struct toedev *, struct synq_entry *); -/* XXX: won't work for IPv6 */ static int -alloc_stid(struct adapter *sc, void *ctx) +alloc_stid(struct adapter *sc, struct listen_ctx *lctx, int isipv6) { struct tid_info *t = &sc->tids; - int stid = -1; + u_int stid, n, f, mask; + struct stid_region *sr = &lctx->stid_region; + + /* + * An IPv6 server needs 2 naturally aligned stids (1 stid = 4 cells) in + * the TCAM. The start of the stid region is properly aligned (the chip + * requires each region to be 128-cell aligned). + */ + n = isipv6 ? 2 : 1; + mask = n - 1; + KASSERT((t->stid_base & mask) == 0 && (t->nstids & mask) == 0, + ("%s: stid region (%u, %u) not properly aligned. n = %u", + __func__, t->stid_base, t->nstids, n)); mtx_lock(&t->stid_lock); - if (t->sfree) { - union serv_entry *p = t->sfree; + if (n > t->nstids - t->stids_in_use) { + mtx_unlock(&t->stid_lock); + return (-1); + } - stid = p - t->stid_tab; - stid += t->stid_base; - t->sfree = p->next; - p->data = ctx; - t->stids_in_use++; + if (t->nstids_free_head >= n) { + /* + * This allocation will definitely succeed because the region + * starts at a good alignment and we just checked we have enough + * stids free. + */ + f = t->nstids_free_head & mask; + t->nstids_free_head -= n + f; + stid = t->nstids_free_head; + TAILQ_INSERT_HEAD(&t->stids, sr, link); + } else { + struct stid_region *s; + + stid = t->nstids_free_head; + TAILQ_FOREACH(s, &t->stids, link) { + stid += s->used + s->free; + f = stid & mask; + if (n <= s->free - f) { + stid -= n + f; + s->free -= n + f; + TAILQ_INSERT_AFTER(&t->stids, s, sr, link); + goto allocated; + } + } + + if (__predict_false(stid != t->nstids)) { + panic("%s: stids TAILQ (%p) corrupt." + " At %d instead of %d at the end of the queue.", + __func__, &t->stids, stid, t->nstids); + } + + mtx_unlock(&t->stid_lock); + return (-1); } + +allocated: + sr->used = n; + sr->free = f; + t->stids_in_use += n; + t->stid_tab[stid] = lctx; mtx_unlock(&t->stid_lock); - return (stid); + + KASSERT(((stid + t->stid_base) & mask) == 0, + ("%s: EDOOFUS.", __func__)); + return (stid + t->stid_base); } -static void * +static struct listen_ctx * lookup_stid(struct adapter *sc, int stid) { struct tid_info *t = &sc->tids; - return (t->stid_tab[stid - t->stid_base].data); + return (t->stid_tab[stid - t->stid_base]); } static void -free_stid(struct adapter *sc, int stid) +free_stid(struct adapter *sc, struct listen_ctx *lctx) { struct tid_info *t = &sc->tids; - union serv_entry *p = &t->stid_tab[stid - t->stid_base]; + struct stid_region *sr = &lctx->stid_region; + struct stid_region *s; + + KASSERT(sr->used > 0, ("%s: nonsense free (%d)", __func__, sr->used)); mtx_lock(&t->stid_lock); - p->next = t->sfree; - t->sfree = p; - t->stids_in_use--; + s = TAILQ_PREV(sr, stid_head, link); + if (s != NULL) + s->free += sr->used + sr->free; + else + t->nstids_free_head += sr->used + sr->free; + KASSERT(t->stids_in_use >= sr->used, + ("%s: stids_in_use (%u) < stids being freed (%u)", __func__, + t->stids_in_use, sr->used)); + t->stids_in_use -= sr->used; + TAILQ_REMOVE(&t->stids, sr, link); mtx_unlock(&t->stid_lock); } @@ -134,7 +194,7 @@ alloc_lctx(struct adapter *sc, struct in if (lctx == NULL) return (NULL); - lctx->stid = alloc_stid(sc, lctx); + lctx->stid = alloc_stid(sc, lctx, inp->inp_inc.inc_flags & INC_ISIPV6); if (lctx->stid < 0) { free(lctx, M_CXGBE); return (NULL); @@ -167,7 +227,7 @@ free_lctx(struct adapter *sc, struct lis CTR4(KTR_CXGBE, "%s: stid %u, lctx %p, inp %p", __func__, lctx->stid, lctx, lctx->inp); - free_stid(sc, lctx->stid); + free_stid(sc, lctx); free(lctx, M_CXGBE); return (in_pcbrele_wlocked(inp)); Modified: head/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.c Fri Jan 11 00:03:19 2013 (r245275) +++ head/sys/dev/cxgbe/tom/t4_tom.c Fri Jan 11 00:07:01 2013 (r245276) @@ -536,12 +536,10 @@ alloc_tid_tabs(struct tid_info *t) t->atid_tab[t->natids - 1].next = NULL; mtx_init(&t->stid_lock, "stid lock", NULL, MTX_DEF); - t->stid_tab = (union serv_entry *)&t->atid_tab[t->natids]; - t->sfree = t->stid_tab; + t->stid_tab = (struct listen_ctx **)&t->atid_tab[t->natids]; t->stids_in_use = 0; - for (i = 1; i < t->nstids; i++) - t->stid_tab[i - 1].next = &t->stid_tab[i]; - t->stid_tab[t->nstids - 1].next = NULL; + TAILQ_INIT(&t->stids); + t->nstids_free_head = t->nstids; atomic_store_rel_int(&t->tids_in_use, 0); Modified: head/sys/dev/cxgbe/tom/t4_tom.h ============================================================================== --- head/sys/dev/cxgbe/tom/t4_tom.h Fri Jan 11 00:03:19 2013 (r245275) +++ head/sys/dev/cxgbe/tom/t4_tom.h Fri Jan 11 00:07:01 2013 (r245276) @@ -174,6 +174,7 @@ struct listen_ctx { LIST_ENTRY(listen_ctx) link; /* listen hash linkage */ volatile int refcount; int stid; + struct stid_region stid_region; int flags; struct inpcb *inp; /* listening socket's inp */ struct sge_wrq *ctrlq; From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 02:25:40 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6CF31E1D; Fri, 11 Jan 2013 02:25:40 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48F068BE; Fri, 11 Jan 2013 02:25:40 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0B2PeDf022893; Fri, 11 Jan 2013 02:25:40 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0B2Pe4p022892; Fri, 11 Jan 2013 02:25:40 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201301110225.r0B2Pe4p022892@svn.freebsd.org> From: Adrian Chadd Date: Fri, 11 Jan 2013 02:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245281 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 02:25:40 -0000 Author: adrian Date: Fri Jan 11 02:25:39 2013 New Revision: 245281 URL: http://svnweb.freebsd.org/changeset/base/245281 Log: Place-holders for enable/active parameter flags. Modified: head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Jan 11 00:46:40 2013 (r245280) +++ head/sys/dev/ath/ath_hal/ah.h Fri Jan 11 02:25:39 2013 (r245281) @@ -941,6 +941,8 @@ typedef struct { int8_t ss_nf_cal[AH_MAX_CHAINS*2]; /* nf calibrated values for ctl+ext from eeprom */ int8_t ss_nf_pwr[AH_MAX_CHAINS*2]; /* nf pwr values for ctl+ext from eeprom */ int32_t ss_nf_temp_data; /* temperature data taken during nf scan */ + int ss_enabled; + int ss_active; } HAL_SPECTRAL_PARAM; #define HAL_SPECTRAL_PARAM_NOVAL 0xFFFF #define HAL_SPECTRAL_PARAM_ENABLE 0x8000 /* Enable/Disable if applicable */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 06:08:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 860E928F; Fri, 11 Jan 2013 06:08:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 600F1160; Fri, 11 Jan 2013 06:08:34 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0B68YFe088612; Fri, 11 Jan 2013 06:08:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0B68WFh088604; Fri, 11 Jan 2013 06:08:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201301110608.r0B68WFh088604@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 11 Jan 2013 06:08:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245286 - in head/sys: geom/journal kern sys ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 06:08:34 -0000 Author: kib Date: Fri Jan 11 06:08:32 2013 New Revision: 245286 URL: http://svnweb.freebsd.org/changeset/base/245286 Log: Add flags argument to vfs_write_resume() and remove vfs_write_resume_flags(). Sponsored by: The FreeBSD Foundation Modified: head/sys/geom/journal/g_journal.c head/sys/kern/vfs_vnops.c head/sys/sys/vnode.h head/sys/ufs/ffs/ffs_snapshot.c head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/ffs_suspend.c head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Fri Jan 11 06:04:46 2013 (r245285) +++ head/sys/geom/journal/g_journal.c Fri Jan 11 06:08:32 2013 (r245286) @@ -2976,7 +2976,7 @@ g_journal_do_switch(struct g_class *clas g_journal_switch_wait(sc); mtx_unlock(&sc->sc_mtx); - vfs_write_resume(mp); + vfs_write_resume(mp, 0); next: mtx_lock(&mountlist_mtx); vfs_unbusy(mp); Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Jan 11 06:04:46 2013 (r245285) +++ head/sys/kern/vfs_vnops.c Fri Jan 11 06:08:32 2013 (r245286) @@ -1642,7 +1642,7 @@ vfs_write_suspend(mp) else MNT_IUNLOCK(mp); if ((error = VFS_SYNC(mp, MNT_SUSPEND)) != 0) - vfs_write_resume(mp); + vfs_write_resume(mp, 0); return (error); } @@ -1650,7 +1650,7 @@ vfs_write_suspend(mp) * Request a filesystem to resume write operations. */ void -vfs_write_resume_flags(struct mount *mp, int flags) +vfs_write_resume(struct mount *mp, int flags) { MNT_ILOCK(mp); @@ -1677,13 +1677,6 @@ vfs_write_resume_flags(struct mount *mp, } } -void -vfs_write_resume(struct mount *mp) -{ - - vfs_write_resume_flags(mp, 0); -} - /* * Implement kqueues for files by translating it to vnode operation. */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Fri Jan 11 06:04:46 2013 (r245285) +++ head/sys/sys/vnode.h Fri Jan 11 06:08:32 2013 (r245286) @@ -703,8 +703,7 @@ int vn_io_fault_uiomove(char *data, int int vfs_cache_lookup(struct vop_lookup_args *ap); void vfs_timestamp(struct timespec *); -void vfs_write_resume(struct mount *mp); -void vfs_write_resume_flags(struct mount *mp, int flags); +void vfs_write_resume(struct mount *mp, int flags); int vfs_write_suspend(struct mount *mp); int vop_stdbmap(struct vop_bmap_args *); int vop_stdfsync(struct vop_fsync_args *); Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Fri Jan 11 06:04:46 2013 (r245285) +++ head/sys/ufs/ffs/ffs_snapshot.c Fri Jan 11 06:08:32 2013 (r245286) @@ -687,7 +687,7 @@ out1: /* * Resume operation on filesystem. */ - vfs_write_resume_flags(vp->v_mount, VR_START_WRITE | VR_NO_SUSPCLR); + vfs_write_resume(vp->v_mount, VR_START_WRITE | VR_NO_SUSPCLR); if (collectsnapstats && starttime.tv_sec > 0) { nanotime(&endtime); timespecsub(&endtime, &starttime); Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Jan 11 06:04:46 2013 (r245285) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Jan 11 06:08:32 2013 (r245286) @@ -2802,7 +2802,7 @@ journal_unsuspend(struct ufsmount *ump) jblocks->jb_suspended = 0; FREE_LOCK(&lk); mp->mnt_susp_owner = curthread; - vfs_write_resume(mp); + vfs_write_resume(mp, 0); ACQUIRE_LOCK(&lk); return (1); } Modified: head/sys/ufs/ffs/ffs_suspend.c ============================================================================== --- head/sys/ufs/ffs/ffs_suspend.c Fri Jan 11 06:04:46 2013 (r245285) +++ head/sys/ufs/ffs/ffs_suspend.c Fri Jan 11 06:08:32 2013 (r245286) @@ -252,7 +252,7 @@ ffs_susp_dtor(void *data) */ mp->mnt_susp_owner = curthread; - vfs_write_resume(mp); + vfs_write_resume(mp, 0); vfs_unbusy(mp); ump->um_writesuspended = 0; Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Fri Jan 11 06:04:46 2013 (r245285) +++ head/sys/ufs/ffs/ffs_vfsops.c Fri Jan 11 06:08:32 2013 (r245286) @@ -292,7 +292,7 @@ ffs_mount(struct mount *mp) error = ffs_flushfiles(mp, flags, td); } if (error) { - vfs_write_resume(mp); + vfs_write_resume(mp, 0); return (error); } if (fs->fs_pendingblocks != 0 || @@ -309,7 +309,7 @@ ffs_mount(struct mount *mp) if ((error = ffs_sbupdate(ump, MNT_WAIT, 0)) != 0) { fs->fs_ronly = 0; fs->fs_clean = 0; - vfs_write_resume(mp); + vfs_write_resume(mp, 0); return (error); } if (MOUNTEDSOFTDEP(mp)) @@ -330,7 +330,7 @@ ffs_mount(struct mount *mp) * Allow the writers to note that filesystem * is ro now. */ - vfs_write_resume(mp); + vfs_write_resume(mp, 0); } if ((mp->mnt_flag & MNT_RELOAD) && (error = ffs_reload(mp, td, 0)) != 0) @@ -1294,10 +1294,8 @@ ffs_unmount(mp, mntflags) goto fail; } } - if (susp) { - vfs_write_resume(mp); - vn_start_write(NULL, &mp, V_WAIT); - } + if (susp) + vfs_write_resume(mp, VR_START_WRITE); DROP_GIANT(); g_topology_lock(); if (ump->um_fsckpid > 0) { @@ -1329,10 +1327,8 @@ ffs_unmount(mp, mntflags) return (error); fail: - if (susp) { - vfs_write_resume(mp); - vn_start_write(NULL, &mp, V_WAIT); - } + if (susp) + vfs_write_resume(mp, VR_START_WRITE); #ifdef UFS_EXTATTR if (e_restart) { ufs_extattr_uepm_init(&ump->um_extattr); From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 09:44:33 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D2E153CB; Fri, 11 Jan 2013 09:44:33 +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 8DE23D67; Fri, 11 Jan 2013 09:44:33 +0000 (UTC) Received: from a91-153-116-96.elisa-laajakaista.fi (a91-153-116-96.elisa-laajakaista.fi [91.153.116.96]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 20967151738; Fri, 11 Jan 2013 11:44:14 +0200 (EET) Date: Fri, 11 Jan 2013 11:44:11 +0200 From: Jaakko Heinonen To: Warner Losh Subject: Re: svn commit: r244585 - in head: . sys/geom/label Message-ID: <20130111094410.GA1830@a91-153-116-96.elisa-laajakaista.fi> References: <201212221343.qBMDhCHa086834@svn.freebsd.org> <201301070927.07157.jhb@freebsd.org> <20130108193146.GA1815@a91-153-116-96.elisa-laajakaista.fi> <201301091417.37451.jhb@freebsd.org> <20130109234526.GL2561@kib.kiev.ua> 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: src-committers@freebsd.org, pjd@freebsd.org, John Baldwin , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Konstantin Belousov , imp@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 09:44:33 -0000 On 2013-01-09, Warner Losh wrote: > > I do not object, but IMHO having names with the spaces in /dev is weird > > and possibly problematic. I agree and my my preference was also to disallow spaces. However I expected that someone might complain. > > This was the reason of my initial request to > > disable spaces, together with the fact that it changes the devctl(4) > > protocol (there might be other /dev/devctl readers besides devd). > > I'm not sure that the protocol changes are quire right yet... Just for the record, usb(4) already uses quoted values for certain devctl variables. See usb_notify_addq() in sys/dev/usb/usb_device.c. -- Jaakko From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 09:58:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2A66EF1E; Fri, 11 Jan 2013 09:58:36 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A4F6A3; Fri, 11 Jan 2013 09:58:36 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0B9wZhm053602; Fri, 11 Jan 2013 09:58:35 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0B9wZVb053601; Fri, 11 Jan 2013 09:58:35 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201301110958.r0B9wZVb053601@svn.freebsd.org> From: Andrey Zonov Date: Fri, 11 Jan 2013 09:58:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245296 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 09:58:36 -0000 Author: zont Date: Fri Jan 11 09:58:35 2013 New Revision: 245296 URL: http://svnweb.freebsd.org/changeset/base/245296 Log: - Improve readability of sys_obreak(). Suggested by: alc Reviewed by: alc Approved by: kib (mentor) MFC after: 1 week Modified: head/sys/vm/vm_unix.c Modified: head/sys/vm/vm_unix.c ============================================================================== --- head/sys/vm/vm_unix.c Fri Jan 11 09:27:24 2013 (r245295) +++ head/sys/vm/vm_unix.c Fri Jan 11 09:58:35 2013 (r245296) @@ -76,6 +76,7 @@ sys_obreak(td, uap) struct obreak_args *uap; { struct vmspace *vm = td->td_proc->p_vmspace; + vm_map_t map = &vm->vm_map; vm_offset_t new, old, base; rlim_t datalim, lmemlim, vmemlim; int prot, rv; @@ -90,7 +91,7 @@ sys_obreak(td, uap) do_map_wirefuture = FALSE; new = round_page((vm_offset_t)uap->nsize); - vm_map_lock(&vm->vm_map); + vm_map_lock(map); base = round_page((vm_offset_t) vm->vm_daddr); old = base + ctob(vm->vm_dsize); @@ -103,7 +104,7 @@ sys_obreak(td, uap) error = ENOMEM; goto done; } - if (new > vm_map_max(&vm->vm_map)) { + if (new > vm_map_max(map)) { error = ENOMEM; goto done; } @@ -117,14 +118,14 @@ sys_obreak(td, uap) goto done; } if (new > old) { - if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { - if (ptoa(pmap_wired_count(vm->vm_map.pmap)) + + if (!old_mlock && map->flags & MAP_WIREFUTURE) { + if (ptoa(pmap_wired_count(map->pmap)) + (new - old) > lmemlim) { error = ENOMEM; goto done; } } - if (vm->vm_map.size + (new - old) > vmemlim) { + if (map->size + (new - old) > vmemlim) { error = ENOMEM; goto done; } @@ -137,22 +138,21 @@ sys_obreak(td, uap) goto done; } error = racct_set(td->td_proc, RACCT_VMEM, - vm->vm_map.size + (new - old)); + map->size + (new - old)); if (error != 0) { racct_set_force(td->td_proc, RACCT_DATA, old - base); PROC_UNLOCK(td->td_proc); error = ENOMEM; goto done; } - if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { + if (!old_mlock && map->flags & MAP_WIREFUTURE) { error = racct_set(td->td_proc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm->vm_map.pmap)) + - (new - old)); + ptoa(pmap_wired_count(map->pmap)) + (new - old)); if (error != 0) { racct_set_force(td->td_proc, RACCT_DATA, old - base); racct_set_force(td->td_proc, RACCT_VMEM, - vm->vm_map.size); + map->size); PROC_UNLOCK(td->td_proc); error = ENOMEM; goto done; @@ -167,16 +167,15 @@ sys_obreak(td, uap) prot |= VM_PROT_EXECUTE; #endif #endif - rv = vm_map_insert(&vm->vm_map, NULL, 0, old, new, - prot, VM_PROT_ALL, 0); + rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, 0); if (rv != KERN_SUCCESS) { #ifdef RACCT PROC_LOCK(td->td_proc); racct_set_force(td->td_proc, RACCT_DATA, old - base); - racct_set_force(td->td_proc, RACCT_VMEM, vm->vm_map.size); - if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { + racct_set_force(td->td_proc, RACCT_VMEM, map->size); + if (!old_mlock && map->flags & MAP_WIREFUTURE) { racct_set_force(td->td_proc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm->vm_map.pmap))); + ptoa(pmap_wired_count(map->pmap))); } PROC_UNLOCK(td->td_proc); #endif @@ -193,13 +192,13 @@ sys_obreak(td, uap) * * XXX If the pages cannot be wired, no error is returned. */ - if ((vm->vm_map.flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) { + if ((map->flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) { if (bootverbose) printf("obreak: MAP_WIREFUTURE set\n"); do_map_wirefuture = TRUE; } } else if (new < old) { - rv = vm_map_delete(&vm->vm_map, new, old); + rv = vm_map_delete(map, new, old); if (rv != KERN_SUCCESS) { error = ENOMEM; goto done; @@ -208,19 +207,19 @@ sys_obreak(td, uap) #ifdef RACCT PROC_LOCK(td->td_proc); racct_set_force(td->td_proc, RACCT_DATA, new - base); - racct_set_force(td->td_proc, RACCT_VMEM, vm->vm_map.size); - if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { + racct_set_force(td->td_proc, RACCT_VMEM, map->size); + if (!old_mlock && map->flags & MAP_WIREFUTURE) { racct_set_force(td->td_proc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm->vm_map.pmap))); + ptoa(pmap_wired_count(map->pmap))); } PROC_UNLOCK(td->td_proc); #endif } done: - vm_map_unlock(&vm->vm_map); + vm_map_unlock(map); if (do_map_wirefuture) - (void) vm_map_wire(&vm->vm_map, old, new, + (void) vm_map_wire(map, old, new, VM_MAP_WIRE_USER|VM_MAP_WIRE_NOHOLES); return (error); From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 10:22:10 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 11B23728; Fri, 11 Jan 2013 10:22:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03A921B7; Fri, 11 Jan 2013 10:22:10 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BAM972061634; Fri, 11 Jan 2013 10:22:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BAM9XE061633; Fri, 11 Jan 2013 10:22:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201301111022.r0BAM9XE061633@svn.freebsd.org> From: Xin LI Date: Fri, 11 Jan 2013 10:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245297 - head/sys/dev/wbwd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 10:22:10 -0000 Author: delphij Date: Fri Jan 11 10:22:09 2013 New Revision: 245297 URL: http://svnweb.freebsd.org/changeset/base/245297 Log: Add ID for Nuvoton WPCM450RA0BX found on Supermicro X9SCA-F motherboards. While I'm there, also make this driver to attach to devices that have an unknown device ID. MFC after: 1 month Modified: head/sys/dev/wbwd/wbwd.c Modified: head/sys/dev/wbwd/wbwd.c ============================================================================== --- head/sys/dev/wbwd/wbwd.c Fri Jan 11 09:58:35 2013 (r245296) +++ head/sys/dev/wbwd/wbwd.c Fri Jan 11 10:22:09 2013 (r245297) @@ -179,6 +179,12 @@ struct winbond_vendor_device_id { .device_rev = 0x73, .descr = "Winbond 83627DHG-P", }, + { + .vendor_id = 0x5ca3, + .device_id = 0xc3, + .device_rev = 0x33, + .descr = "Nuvoton WPCM450RA0BX", + }, }; static void @@ -596,6 +602,9 @@ wb_probe_enable(device_t dev, int probe) goto cleanup; } + if (dev_id == 0xff && dev_rev == 0xff) + goto cleanup; + for (j = 0; j < sizeof(wb_devs) / sizeof(*wb_devs); j++) { if (wb_devs[j].device_id == dev_id && wb_devs[j].device_rev == dev_rev) { @@ -605,6 +614,16 @@ wb_probe_enable(device_t dev, int probe) break; } } + + if (!found) { + if (probe && dev != NULL) { + device_set_desc(dev, "Unknown Winbond/Nuvoton model"); + device_printf(dev, "DevID 0x%02x DevRev 0x%02x, " + "please report this.\n", dev_id, dev_rev); + } + found++; + } + if (probe && found && bootverbose && dev != NULL) device_printf(dev, "%s EFER 0x%02x ID 0x%02x Rev 0x%02x" " CR26 0x%02x (probing)\n", device_get_desc(dev), From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 11:38:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2A48733; Fri, 11 Jan 2013 11:38:31 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) by mx1.freebsd.org (Postfix) with ESMTP id 7D3696B5; Fri, 11 Jan 2013 11:38:31 +0000 (UTC) Received: by mail-ob0-f175.google.com with SMTP id vb8so1599687obc.6 for ; Fri, 11 Jan 2013 03:38:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=p8JGpA2Wc8209lV+oQ/pMxbtiKwp7zgNtPP29C0HGd8=; b=sp47VUmgw0E4VJp2um89ysaLkq0N3rRYPaSFQqZG7cwj4NcZ+s7dXn41qhpIV6XJzG atgEvExd59DwQcVQe/yYdN9yB1FizAuUTbrScodvs+DTMFZW/qwligUG/reoG/Aa3Mjz XafCv89VpRPCmPouzwSGCc9AOTOyQ2iel+ozs8dcGnkF1BtYGd5TeOPBh+1KdYLLBV2i 84JfOFVtV79ccgaUrCsY8OISXsPxRh/JlYYggXKxATv7MPdh3TQIbf8bPEgFEmn1N6DL PNWoYw3ug2mf+58z6cghSoLGYIaJhU8geq7eLiQacM+Mfe+L5VBY2xI16I+4AwTgJ5la 2WVg== MIME-Version: 1.0 Received: by 10.182.38.69 with SMTP id e5mr54739976obk.79.1357904304943; Fri, 11 Jan 2013 03:38:24 -0800 (PST) Sender: c.jayachandran@gmail.com Received: by 10.182.111.197 with HTTP; Fri, 11 Jan 2013 03:38:24 -0800 (PST) In-Reply-To: <50EB415F.8020405@freebsd.org> References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> Date: Fri, 11 Jan 2013 17:08:24 +0530 X-Google-Sender-Auth: 4sQ3DDJKmx1hTtTZNjfhKtZ1XiA Message-ID: Subject: Re: svn commit: r243631 - in head/sys: kern sys From: "Jayachandran C." To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Oleksandr Tymoshenko , Alan Cox X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 11:38:32 -0000 On Tue, Jan 8, 2013 at 3:12 AM, Andre Oppermann wrote: > On 07.01.2013 20:32, Alan Cox wrote: >> >> On 01/07/2013 12:47, Oleksandr Tymoshenko wrote: >>> >>> On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: >>>> >>>> On 12/18/2012 1:59 AM, Alan Cox wrote: >>>>> >>>>> On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >>>>>> >>>>>> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >>>>>> >>>>>>> On 12/08/2012 14:32, Andre Oppermann wrote: >>>>>> >>>>>> .. skipped .. >>>>>> >>>>>>>> The trouble seems to come from NSFBUFS which is (512 + maxusers * >>>>>>>> 16) >>>>>>>> resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = >>>>>>>> 27MB. This >>>>>>>> seem to be pushing it with the smaller ARM kmap layout. >>>>>>>> >>>>>>>> Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500? >>>>>>>> >>>>>>>> ARM does have a direct map mode as well which doesn't require the >>>>>>>> allocation >>>>>>>> of sfbufs. I'm not sure which other problems that approach has. >>>>>>>> >>>>>>> Only a few (3?) platforms use it. It reduces the size of the user >>>>>>> address space, and translation between physical addresses and >>>>>>> direct map >>>>>>> addresses is not computationally trivial as it is on other >>>>>>> architectures, e.g., amd64, ia64. However, it does try to use large >>>>>>> page mappings. >>>>>>> >>>>>>> >>>>>>>> Hopefully alc@ (added to cc) can answer that and also why the >>>>>>>> kmap of >>>>>>>> 27MB >>>>>>>> manages to wrench the ARM kernel. >>>>>>>> >>>>>>> Arm does not define caps on either the buffer map size (param.h) >>>>>>> or the >>>>>>> kmem map size (vmparam.h). It would probably make sense to copy >>>>>>> these >>>>>>> definitions from i386. >>>>>> >>>>>> Adding caps didn't help. I did some digging and found out that >>>>>> although address range >>>>>> 0xc0000000 .. 0xffffffff is indeed valid for ARM in general actual >>>>>> KVA space varies for >>>>>> each specific hardware platform. This "real" KVA is defined by >>>>>> >>>>>> pair and ifI use them instead of >>>>> VM_MAX_KERNEL_ADDRESS> >>>>>> in init_param2 function my pandaboard successfully boots. Since >>>>>> former pair is used for defining >>>>>> kernel_map boundaries I believe it should be used for auto tuning >>>>>> as well. >>>>> >>>>> >>>>> That makes sense. However, "virtual_avail" isn't the start of the >>>>> kernel address space. The kernel map always starts at >>>>> VM_MIN_KERNEL_ADDRESS. (See kmem_init().) "virtual_avail" represents >>>>> the next unallocated virtual address in the kernel address space at an >>>>> early point in initialization. "virtual_avail" and "virtual_end" >>>>> aren't >>>>> used after that, or outside the VM system. Please use >>>>> vm_map_min(kernel_map) and vm_map_max(kernel_map) instead. >>>> >>>> >>>> I checked: kernel_map is not available (NULL) at this point. So we >>>> can't use it to >>>> determine real KVA size. Closest thing we can get is >>>> virtual_avail/virtual_end pair. >>>> >>>> Andre, could you approve attached patch for commit or suggest better >>>> solution? >>> >>> >>> Any update on this one? Can I proceed with commit? >>> >> >> Sorry, I've been away from my e-mail since the 30th, and I'm now in the >> process of getting caught up. Give me a day or so to look at this. I see an issue with commit on MIPS XLP platform as well. With 16 GB physical memory, the ncallout is calculated to be 538881 (since it is based on maxfiles - which is now based on the physical memory). Due to this, the callwheel allocation per cpu is 16MB (callwheelsize is 1MB). And on a 32 CPU machine, the total allocation for callouts comes to 32*16MB = 512MB. I have worked around this issue for now by increasing VM_KMEM_SIZE_MAX (which is 200MB now) - but I think a better fix is needed for this. JC. From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 15:05:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D94B696A; Fri, 11 Jan 2013 15:05:56 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CC274F7A; Fri, 11 Jan 2013 15:05:56 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BF5unS038532; Fri, 11 Jan 2013 15:05:56 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BF5uQO038527; Fri, 11 Jan 2013 15:05:56 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201301111505.r0BF5uQO038527@svn.freebsd.org> From: David Chisnall Date: Fri, 11 Jan 2013 15:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245304 - head/contrib/libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 15:05:56 -0000 Author: theraven Date: Fri Jan 11 15:05:55 2013 New Revision: 245304 URL: http://svnweb.freebsd.org/changeset/base/245304 Log: Merge new version of libcxxrt. This brings in three fixes: - Don't treat pointers to members as pointers in catch blocks (they're usually fat pointers). - Correctly catch foreign exceptions in catchalls. - Ensure that a happens-before relationship is established when setting terminate handlers in one thread and calling them in another. Added: head/contrib/libcxxrt/atomic.h - copied unchanged from r245303, vendor/libcxxrt/dist/atomic.h Modified: head/contrib/libcxxrt/exception.cc head/contrib/libcxxrt/memory.cc head/contrib/libcxxrt/typeinfo.h Directory Properties: head/contrib/libcxxrt/ (props changed) Copied: head/contrib/libcxxrt/atomic.h (from r245303, vendor/libcxxrt/dist/atomic.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libcxxrt/atomic.h Fri Jan 11 15:05:55 2013 (r245304, copy of r245303, vendor/libcxxrt/dist/atomic.h) @@ -0,0 +1,29 @@ + +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif +#ifndef __has_feature +#define __has_feature(x) 0 +#endif +/** + * Swap macro that enforces a happens-before relationship with a corresponding + * ATOMIC_LOAD. + */ +#if __has_feature(cxx_atomic) +#define ATOMIC_SWAP(addr, val)\ + __atomic_exchange(addr, val, __ATOMIC_ACQ_REL) +#elif __has_builtin(__sync_swap) +#define ATOMIC_SWAP(addr, val)\ + __sync_swap(addr, val) +#else +#define ATOMIC_SWAP(addr, val)\ + __sync_lock_test_and_set(addr, val) +#endif + +#if __has_feature(cxx_atomic) +#define ATOMIC_LOAD(addr)\ + __atomic_load(addr, __ATOMIC_ACQUIRE) +#else +#define ATOMIC_LOAD(addr)\ + (__sync_synchronize(), *addr) +#endif Modified: head/contrib/libcxxrt/exception.cc ============================================================================== --- head/contrib/libcxxrt/exception.cc Fri Jan 11 15:01:43 2013 (r245303) +++ head/contrib/libcxxrt/exception.cc Fri Jan 11 15:05:55 2013 (r245304) @@ -32,6 +32,7 @@ #include #include "typeinfo.h" #include "dwarf_eh.h" +#include "atomic.h" #include "cxxabi.h" #pragma weak pthread_key_create @@ -155,6 +156,17 @@ struct __cxa_thread_info */ _Unwind_Exception *currentCleanup; /** + * Our state with respect to foreign exceptions. Usually none, set to + * caught if we have just caught an exception and rethrown if we are + * rethrowing it. + */ + enum + { + none, + caught, + rethrown + } foreign_exception_state; + /** * The public part of this structure, accessible from outside of this * module. */ @@ -308,7 +320,16 @@ static void thread_cleanup(void* thread_ __cxa_thread_info *info = (__cxa_thread_info*)thread_info; if (info->globals.caughtExceptions) { - free_exception_list(info->globals.caughtExceptions); + // If this is a foreign exception, ask it to clean itself up. + if (info->foreign_exception_state != __cxa_thread_info::none) + { + _Unwind_Exception *e = (_Unwind_Exception*)info->globals.caughtExceptions; + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + } + else + { + free_exception_list(info->globals.caughtExceptions); + } } free(thread_info); } @@ -780,7 +801,8 @@ extern "C" void __cxa_decrement_exceptio */ extern "C" void __cxa_rethrow() { - __cxa_eh_globals *globals = __cxa_get_globals(); + __cxa_thread_info *ti = thread_info_fast(); + __cxa_eh_globals *globals = &ti->globals; // Note: We don't remove this from the caught list here, because // __cxa_end_catch will be called when we unwind out of the try block. We // could probably make this faster by providing an alternative rethrow @@ -795,6 +817,15 @@ extern "C" void __cxa_rethrow() std::terminate(); } + if (ti->foreign_exception_state != __cxa_thread_info::none) + { + ti->foreign_exception_state = __cxa_thread_info::rethrown; + _Unwind_Exception *e = (_Unwind_Exception*)ex; + _Unwind_Reason_Code err = _Unwind_Resume_or_Rethrow(e); + report_failure(err, ex); + return; + } + assert(ex->handlerCount > 0 && "Rethrowing uncaught exception!"); // ex->handlerCount will be decremented in __cxa_end_catch in enclosing @@ -848,9 +879,9 @@ static bool check_type_signature(__cxa_e void *&adjustedPtr) { void *exception_ptr = (void*)(ex+1); - const std::type_info *ex_type = ex->exceptionType; + const std::type_info *ex_type = ex ? ex->exceptionType : 0; - bool is_ptr = ex_type->__is_pointer_p(); + bool is_ptr = ex ? ex_type->__is_pointer_p() : false; if (is_ptr) { exception_ptr = *(void**)exception_ptr; @@ -911,8 +942,8 @@ static handler_type check_action_record( action_record = displacement ? action_record_offset_base + displacement : 0; // We only check handler types for C++ exceptions - foreign exceptions - // are only allowed for cleanup. - if (filter > 0 && 0 != ex) + // are only allowed for cleanups and catchalls. + if (filter > 0) { std::type_info *handler_type = get_type_info_entry(context, lsda, filter); if (check_type_signature(ex, handler_type, adjustedPtr)) @@ -1133,8 +1164,10 @@ extern "C" void *__cxa_begin_catch(void extern "C" void *__cxa_begin_catch(void *e) #endif { - // Decrement the uncaught exceptions count - __cxa_eh_globals *globals = __cxa_get_globals(); + // We can't call the fast version here, because if the first exception that + // we see is a foreign exception then we won't have called it yet. + __cxa_thread_info *ti = thread_info(); + __cxa_eh_globals *globals = &ti->globals; globals->uncaughtExceptions--; _Unwind_Exception *exceptionObject = (_Unwind_Exception*)e; @@ -1177,9 +1210,22 @@ extern "C" void *__cxa_begin_catch(void { ex->handlerCount++; } + ti->foreign_exception_state = __cxa_thread_info::none; return ex->adjustedPtr; } + else + { + // If this is a foreign exception, then we need to be able to + // store it. We can't chain foreign exceptions, so we give up + // if there are already some outstanding ones. + if (globals->caughtExceptions != 0) + { + std::terminate(); + } + globals->caughtExceptions = (__cxa_exception*)exceptionObject; + ti->foreign_exception_state = __cxa_thread_info::caught; + } // exceptionObject is the pointer to the _Unwind_Exception within the // __cxa_exception. The throw object is after this return ((char*)exceptionObject + sizeof(_Unwind_Exception)); @@ -1195,10 +1241,23 @@ extern "C" void __cxa_end_catch() { // We can call the fast version here because the slow version is called in // __cxa_throw(), which must have been called before we end a catch block - __cxa_eh_globals *globals = __cxa_get_globals_fast(); + __cxa_thread_info *ti = thread_info_fast(); + __cxa_eh_globals *globals = &ti->globals; __cxa_exception *ex = globals->caughtExceptions; assert(0 != ex && "Ending catch when no exception is on the stack!"); + + if (ti->foreign_exception_state != __cxa_thread_info::none) + { + globals->caughtExceptions = 0; + if (ti->foreign_exception_state != __cxa_thread_info::rethrown) + { + _Unwind_Exception *e = (_Unwind_Exception*)ti->globals.caughtExceptions; + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + } + ti->foreign_exception_state = __cxa_thread_info::none; + return; + } bool deleteException = true; @@ -1328,7 +1387,7 @@ namespace std { if (thread_local_handlers) { return pathscale::set_unexpected(f); } - return __sync_lock_test_and_set(&unexpectedHandler, f); + return ATOMIC_SWAP(&terminateHandler, f); } /** * Sets the function that is called to terminate the program. @@ -1336,7 +1395,8 @@ namespace std terminate_handler set_terminate(terminate_handler f) throw() { if (thread_local_handlers) { return pathscale::set_terminate(f); } - return __sync_lock_test_and_set(&terminateHandler, f); + + return ATOMIC_SWAP(&terminateHandler, f); } /** * Terminates the program, calling a custom terminate implementation if @@ -1390,7 +1450,7 @@ namespace std { return info->unexpectedHandler; } - return unexpectedHandler; + return ATOMIC_LOAD(&unexpectedHandler); } /** * Returns the current terminate handler. @@ -1402,7 +1462,7 @@ namespace std { return info->terminateHandler; } - return terminateHandler; + return ATOMIC_LOAD(&terminateHandler); } } #ifdef __arm__ Modified: head/contrib/libcxxrt/memory.cc ============================================================================== --- head/contrib/libcxxrt/memory.cc Fri Jan 11 15:01:43 2013 (r245303) +++ head/contrib/libcxxrt/memory.cc Fri Jan 11 15:05:55 2013 (r245304) @@ -36,14 +36,8 @@ #include #include #include "stdexcept.h" +#include "atomic.h" -#ifndef __has_builtin -#define __has_builtin(x) 0 -#endif - -#if !__has_builtin(__sync_swap) -#define __sync_swap __sync_lock_test_and_set -#endif namespace std { @@ -67,7 +61,12 @@ namespace std __attribute__((weak)) new_handler set_new_handler(new_handler handler) { - return __sync_swap(&new_handl, handler); + return ATOMIC_SWAP(&new_handl, handler); + } + __attribute__((weak)) + new_handler get_new_handler(void) + { + return ATOMIC_LOAD(&new_handl); } } @@ -75,12 +74,17 @@ namespace std __attribute__((weak)) void* operator new(size_t size) { + if (0 == size) + { + size = 1; + } void * mem = malloc(size); while (0 == mem) { - if (0 != new_handl) + new_handler h = std::get_new_handler(); + if (0 != h) { - new_handl(); + h(); } else { @@ -95,14 +99,19 @@ void* operator new(size_t size) __attribute__((weak)) void* operator new(size_t size, const std::nothrow_t &) throw() { + if (0 == size) + { + size = 1; + } void *mem = malloc(size); while (0 == mem) { - if (0 != new_handl) + new_handler h = std::get_new_handler(); + if (0 != h) { try { - new_handl(); + h(); } catch (...) { Modified: head/contrib/libcxxrt/typeinfo.h ============================================================================== --- head/contrib/libcxxrt/typeinfo.h Fri Jan 11 15:01:43 2013 (r245303) +++ head/contrib/libcxxrt/typeinfo.h Fri Jan 11 15:05:55 2013 (r245304) @@ -70,6 +70,14 @@ namespace std */ public: /** + * Returns true if this is some pointer type, false otherwise. + */ + virtual bool __is_pointer_p() const { return false; } + /** + * Returns true if this is some function type, false otherwise. + */ + virtual bool __is_function_p() const { return false; } + /** * Catch function. Allows external libraries to implement * their own basic types. This is used, for example, in the * GNUstep Objective-C runtime to allow Objective-C types to be @@ -95,14 +103,6 @@ namespace std { return false; } - /** - * Returns true if this is some pointer type, false otherwise. - */ - virtual bool __is_pointer_p() const { return false; } - /** - * Returns true if this is some function type, false otherwise. - */ - virtual bool __is_function_p() const { return false; } }; } @@ -284,7 +284,6 @@ namespace ABI_NAMESPACE /** Pointer is a pointer to a member of an incomplete class. */ __incomplete_class_mask = 0x10 }; - virtual bool __is_pointer_p() const { return true; } virtual bool __do_catch(const type_info *thrown_type, void **thrown_object, unsigned outer) const; @@ -296,6 +295,7 @@ namespace ABI_NAMESPACE struct __pointer_type_info : public __pbase_type_info { virtual ~__pointer_type_info(); + virtual bool __is_pointer_p() const { return true; } }; /** From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 15:50:02 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 248D5779; Fri, 11 Jan 2013 15:50:02 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17EF720A; Fri, 11 Jan 2013 15:50:02 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BFo1Gl049737; Fri, 11 Jan 2013 15:50:01 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BFo18d049736; Fri, 11 Jan 2013 15:50:01 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301111550.r0BFo18d049736@svn.freebsd.org> From: Brooks Davis Date: Fri, 11 Jan 2013 15:50:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245305 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 15:50:02 -0000 Author: brooks Date: Fri Jan 11 15:50:01 2013 New Revision: 245305 URL: http://svnweb.freebsd.org/changeset/base/245305 Log: In r244401 I accidently moved strunvis and strunvisx from version 1.0 to 1.3 breaking the libc ABI. Revert that change (breaking the ABI again for users who updated after December 18th). Modified: head/lib/libc/gen/Symbol.map Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Fri Jan 11 15:05:55 2013 (r245304) +++ head/lib/libc/gen/Symbol.map Fri Jan 11 15:50:01 2013 (r245305) @@ -298,6 +298,8 @@ FBSD_1.0 { ualarm; ulimit; uname; + strunvis; + strunvisx; usleep; utime; valloc; @@ -391,8 +393,6 @@ FBSD_1.3 { snvis; strnunvis; strnunvisx; - strunvis; - strunvisx; strnvis; strnvisx; strsnvis; From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 16:10:12 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 40EA7EB4; Fri, 11 Jan 2013 16:10:12 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 32FD2314; Fri, 11 Jan 2013 16:10:12 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BGACJw055310; Fri, 11 Jan 2013 16:10:12 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BGAClQ055309; Fri, 11 Jan 2013 16:10:12 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301111610.r0BGAClQ055309@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Jan 2013 16:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245306 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 16:10:12 -0000 Author: mav Date: Fri Jan 11 16:10:11 2013 New Revision: 245306 URL: http://svnweb.freebsd.org/changeset/base/245306 Log: Do not schedule periph for payload/TUR requests if reprobe is in progress to avoid sending extra READ CAPACITY requests by dastart(). Schedule periph again on reprobe completion, or otherwise it may stuck indefinitely long. This should fix USB explore thread hanging on device unplug, waiting for periph destruction. Reported by: hselasky Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Fri Jan 11 15:50:01 2013 (r245305) +++ head/sys/cam/scsi/scsi_da.c Fri Jan 11 16:10:11 2013 (r245306) @@ -1081,6 +1081,9 @@ daschedule(struct cam_periph *periph) struct da_softc *softc = (struct da_softc *)periph->softc; uint32_t prio; + if (softc->state != DA_STATE_NORMAL) + return; + /* Check if cam_periph_getccb() was called. */ prio = periph->immediate_priority; @@ -1425,10 +1428,10 @@ daasync(void *callback_arg, u_int32_t co } case AC_SCSI_AEN: softc = (struct da_softc *)periph->softc; - if (softc->state == DA_STATE_NORMAL && !softc->tur) { + if (!softc->tur) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + daschedule(periph); } } /* FALLTHROUGH */ @@ -2168,6 +2171,7 @@ dadone(struct cam_periph *periph, union struct da_softc *softc; struct ccb_scsiio *csio; u_int32_t priority; + da_ccb_state state; softc = (struct da_softc *)periph->softc; priority = done_ccb->ccb_h.pinfo.priority; @@ -2175,7 +2179,8 @@ dadone(struct cam_periph *periph, union CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone\n")); csio = &done_ccb->csio; - switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { + state = csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK; + switch (state) { case DA_CCB_BUFFER_IO: case DA_CCB_DELETE: { @@ -2273,8 +2278,7 @@ dadone(struct cam_periph *periph, union softc->outstanding_cmds); } - if ((csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) == - DA_CCB_DELETE) { + if (state == DA_CCB_DELETE) { while ((bp1 = bioq_takefirst(&softc->delete_run_queue)) != NULL) { bp1->bio_resid = bp->bio_resid; @@ -2300,7 +2304,7 @@ dadone(struct cam_periph *periph, union rdcap = NULL; rcaplong = NULL; - if (softc->state == DA_STATE_PROBE) + if (state == DA_CCB_PROBE) rdcap =(struct scsi_read_capacity_data *)csio->data_ptr; else rcaplong = (struct scsi_read_capacity_data_long *) @@ -2313,7 +2317,7 @@ dadone(struct cam_periph *periph, union u_int lbppbe; /* LB per physical block exponent. */ u_int lalba; /* Lowest aligned LBA. */ - if (softc->state == DA_STATE_PROBE) { + if (state == DA_CCB_PROBE) { block_size = scsi_4btoul(rdcap->length); maxsector = scsi_4btoul(rdcap->addr); lbppbe = 0; @@ -2426,7 +2430,7 @@ dadone(struct cam_periph *periph, union * If we tried READ CAPACITY(16) and failed, * fallback to READ CAPACITY(10). */ - if ((softc->state == DA_STATE_PROBE2) && + if ((state == DA_CCB_PROBE2) && (softc->flags & DA_FLAG_CAN_RC16) && (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) || @@ -2506,7 +2510,8 @@ dadone(struct cam_periph *periph, union * operation. */ xpt_release_ccb(done_ccb); - softc->state = DA_STATE_NORMAL; + softc->state = DA_STATE_NORMAL; + daschedule(periph); wakeup(&softc->disk->d_mediasize); if ((softc->flags & DA_FLAG_PROBED) == 0) { softc->flags |= DA_FLAG_PROBED; @@ -2631,7 +2636,7 @@ damediapoll(void *arg) struct cam_periph *periph = arg; struct da_softc *softc = periph->softc; - if (softc->state == DA_STATE_NORMAL && !softc->tur) { + if (!softc->tur && softc->outstanding_cmds == 0) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; daschedule(periph); From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 17:34:31 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30D3FF6A; Fri, 11 Jan 2013 17:34:31 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0B092860; Fri, 11 Jan 2013 17:34:31 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BHYUkT078876; Fri, 11 Jan 2013 17:34:30 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BHYUxR078875; Fri, 11 Jan 2013 17:34:30 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201301111734.r0BHYUxR078875@svn.freebsd.org> From: "David E. O'Brien" Date: Fri, 11 Jan 2013 17:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245307 - head/contrib/file/Magdir X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 17:34:31 -0000 Author: obrien Date: Fri Jan 11 17:34:30 2013 New Revision: 245307 URL: http://svnweb.freebsd.org/changeset/base/245307 Log: Add support for Lua 5.2. Submitted by: skreuzer Modified: head/contrib/file/Magdir/lua Modified: head/contrib/file/Magdir/lua ============================================================================== --- head/contrib/file/Magdir/lua Fri Jan 11 16:10:11 2013 (r245306) +++ head/contrib/file/Magdir/lua Fri Jan 11 17:34:30 2013 (r245307) @@ -19,3 +19,4 @@ 0 string \033Lua Lua bytecode, >4 byte 0x50 version 5.0 >4 byte 0x51 version 5.1 +>4 byte 0x52 version 5.2 From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 17:46:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C5F1E3BF; Fri, 11 Jan 2013 17:46:15 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id 9A9E58C3; Fri, 11 Jan 2013 17:46:15 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 2DE754C0248; Fri, 11 Jan 2013 11:46:15 -0600 (CST) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 2BFD54C01C5; Fri, 11 Jan 2013 11:46:15 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 7bGPqfKR7cmc; Fri, 11 Jan 2013 11:46:15 -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 mh11.mail.rice.edu (Postfix) with ESMTPSA id 7F13D4C0246; Fri, 11 Jan 2013 11:46:14 -0600 (CST) Message-ID: <50F04FE5.7010406@rice.edu> Date: Fri, 11 Jan 2013 11:46:13 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "Jayachandran C." Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> In-Reply-To: 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, Andre Oppermann , Oleksandr Tymoshenko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 17:46:15 -0000 On 01/11/2013 05:38, Jayachandran C. wrote: > On Tue, Jan 8, 2013 at 3:12 AM, Andre Oppermann wrote: >> On 07.01.2013 20:32, Alan Cox wrote: >>> On 01/07/2013 12:47, Oleksandr Tymoshenko wrote: >>>> On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: >>>>> On 12/18/2012 1:59 AM, Alan Cox wrote: >>>>>> On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >>>>>>> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >>>>>>> >>>>>>>> On 12/08/2012 14:32, Andre Oppermann wrote: >>>>>>> .. skipped .. >>>>>>> >>>>>>>>> The trouble seems to come from NSFBUFS which is (512 + maxusers * >>>>>>>>> 16) >>>>>>>>> resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = >>>>>>>>> 27MB. This >>>>>>>>> seem to be pushing it with the smaller ARM kmap layout. >>>>>>>>> >>>>>>>>> Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500? >>>>>>>>> >>>>>>>>> ARM does have a direct map mode as well which doesn't require the >>>>>>>>> allocation >>>>>>>>> of sfbufs. I'm not sure which other problems that approach has. >>>>>>>>> >>>>>>>> Only a few (3?) platforms use it. It reduces the size of the user >>>>>>>> address space, and translation between physical addresses and >>>>>>>> direct map >>>>>>>> addresses is not computationally trivial as it is on other >>>>>>>> architectures, e.g., amd64, ia64. However, it does try to use large >>>>>>>> page mappings. >>>>>>>> >>>>>>>> >>>>>>>>> Hopefully alc@ (added to cc) can answer that and also why the >>>>>>>>> kmap of >>>>>>>>> 27MB >>>>>>>>> manages to wrench the ARM kernel. >>>>>>>>> >>>>>>>> Arm does not define caps on either the buffer map size (param.h) >>>>>>>> or the >>>>>>>> kmem map size (vmparam.h). It would probably make sense to copy >>>>>>>> these >>>>>>>> definitions from i386. >>>>>>> Adding caps didn't help. I did some digging and found out that >>>>>>> although address range >>>>>>> 0xc0000000 .. 0xffffffff is indeed valid for ARM in general actual >>>>>>> KVA space varies for >>>>>>> each specific hardware platform. This "real" KVA is defined by >>>>>>> >>>>>>> pair and ifI use them instead of >>>>>> VM_MAX_KERNEL_ADDRESS> >>>>>>> in init_param2 function my pandaboard successfully boots. Since >>>>>>> former pair is used for defining >>>>>>> kernel_map boundaries I believe it should be used for auto tuning >>>>>>> as well. >>>>>> >>>>>> That makes sense. However, "virtual_avail" isn't the start of the >>>>>> kernel address space. The kernel map always starts at >>>>>> VM_MIN_KERNEL_ADDRESS. (See kmem_init().) "virtual_avail" represents >>>>>> the next unallocated virtual address in the kernel address space at an >>>>>> early point in initialization. "virtual_avail" and "virtual_end" >>>>>> aren't >>>>>> used after that, or outside the VM system. Please use >>>>>> vm_map_min(kernel_map) and vm_map_max(kernel_map) instead. >>>>> >>>>> I checked: kernel_map is not available (NULL) at this point. So we >>>>> can't use it to >>>>> determine real KVA size. Closest thing we can get is >>>>> virtual_avail/virtual_end pair. >>>>> >>>>> Andre, could you approve attached patch for commit or suggest better >>>>> solution? >>>> >>>> Any update on this one? Can I proceed with commit? >>>> >>> Sorry, I've been away from my e-mail since the 30th, and I'm now in the >>> process of getting caught up. Give me a day or so to look at this. > I see an issue with commit on MIPS XLP platform as well. > > With 16 GB physical memory, the ncallout is calculated to be 538881 > (since it is based on maxfiles - which is now based on the physical > memory). Due to this, the callwheel allocation per cpu is 16MB > (callwheelsize is 1MB). And on a 32 CPU machine, the total allocation > for callouts comes to 32*16MB = 512MB. > > I have worked around this issue for now by increasing VM_KMEM_SIZE_MAX > (which is 200MB now) - but I think a better fix is needed for this. > MIPS should use a definition for VM_KMEM_SIZE_MAX that scales with the kernel address space size, like amd64, i386, and sparc64, and not a fixed number. I think that the following should work for both 32- and 64-bit processors: Index: mips/include/vmparam.h =================================================================== --- mips/include/vmparam.h (revision 245229) +++ mips/include/vmparam.h (working copy) @@ -130,10 +130,11 @@ #endif /* - * Ceiling on amount of kmem_map kva space. + * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space. */ #ifndef VM_KMEM_SIZE_MAX -#define VM_KMEM_SIZE_MAX (200 * 1024 * 1024) +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif /* initial pagein size of beginning of executable file */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 17:51:04 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4843F567; Fri, 11 Jan 2013 17:51:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3831D8E5; Fri, 11 Jan 2013 17:51:04 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BHp4R7084260; Fri, 11 Jan 2013 17:51:04 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BHp40E084259; Fri, 11 Jan 2013 17:51:04 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301111751.r0BHp40E084259@svn.freebsd.org> From: Brooks Davis Date: Fri, 11 Jan 2013 17:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245308 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 17:51:04 -0000 Author: brooks Date: Fri Jan 11 17:51:03 2013 New Revision: 245308 URL: http://svnweb.freebsd.org/changeset/base/245308 Log: Add contrib/libc-vis to the include path so we reliably pick up the right version of vis.h. Reported by: dim Modified: head/lib/libc/gen/Makefile.inc Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Fri Jan 11 17:34:30 2013 (r245307) +++ head/lib/libc/gen/Makefile.inc Fri Jan 11 17:51:03 2013 (r245308) @@ -40,6 +40,7 @@ SRCS+= __getosreldate.c __xuname.c \ SRCS+= pwcache.c pwcache.h .PATH: ${.CURDIR}/../../contrib/libc-vis +CFLAGS+= -I${.CURDIR}/../../contrib/libc-vis SRCS+= unvis.c vis.c MISRCS+=modf.c From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 18:37:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6AE29BF1; Fri, 11 Jan 2013 18:37:52 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5C8ACA74; Fri, 11 Jan 2013 18:37:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BIbqxO095754; Fri, 11 Jan 2013 18:37:52 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BIbq3v095752; Fri, 11 Jan 2013 18:37:52 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301111837.r0BIbq3v095752@svn.freebsd.org> From: Brooks Davis Date: Fri, 11 Jan 2013 18:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245309 - in head: . share/zoneinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 18:37:52 -0000 Author: brooks Date: Fri Jan 11 18:37:51 2013 New Revision: 245309 URL: http://svnweb.freebsd.org/changeset/base/245309 Log: Use find -exec to install zoneinfo instead of requiring xargs to be an install tool. Suggested by: delphij Modified: head/Makefile.inc1 head/share/zoneinfo/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 11 17:51:03 2013 (r245308) +++ head/Makefile.inc1 Fri Jan 11 18:37:51 2013 (r245309) @@ -643,7 +643,7 @@ installcheck_UGID: _install-info= install-info .endif .if ${MK_ZONEINFO} != "no" -_zoneinfo= zic tzsetup xargs +_zoneinfo= zic tzsetup .endif ITOOLS= [ awk cap_mkdb cat chflags chmod chown \ Modified: head/share/zoneinfo/Makefile ============================================================================== --- head/share/zoneinfo/Makefile Fri Jan 11 17:51:03 2013 (r245308) +++ head/share/zoneinfo/Makefile Fri Jan 11 18:37:51 2013 (r245309) @@ -79,9 +79,9 @@ zoneinfo: yearistype ${TDATA} beforeinstall: cd ${TZBUILDDIR} && \ - find . -type f -print | xargs -I _FILE_ ${INSTALL} \ + find . -type f -print -exec ${INSTALL} \ -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ - _FILE_ ${DESTDIR}/usr/share/zoneinfo/_FILE_ + \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 19:11:57 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0E4A3268; Fri, 11 Jan 2013 19:11:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0003DB71; Fri, 11 Jan 2013 19:11:56 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BJBux5013868; Fri, 11 Jan 2013 19:11:56 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BJBulh013867; Fri, 11 Jan 2013 19:11:56 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301111911.r0BJBulh013867@svn.freebsd.org> From: Alexander Motin Date: Fri, 11 Jan 2013 19:11:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245310 - head/sys/cam/scsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 19:11:57 -0000 Author: mav Date: Fri Jan 11 19:11:56 2013 New Revision: 245310 URL: http://svnweb.freebsd.org/changeset/base/245310 Log: - Add missig xpt_schedule() call for cases when requested immediate CCB priority is lower then payload/TUR one. - Reduce TUR priority and avoid sending them if there are any other outstanding commands, alike to DA driver. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== --- head/sys/cam/scsi/scsi_cd.c Fri Jan 11 18:37:51 2013 (r245309) +++ head/sys/cam/scsi/scsi_cd.c Fri Jan 11 19:11:56 2013 (r245310) @@ -581,7 +581,7 @@ cdasync(void *callback_arg, u_int32_t co if (softc->state == CD_STATE_NORMAL && !softc->tur) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); } } /* FALLTHROUGH */ @@ -1612,9 +1612,11 @@ cdstart(struct cam_periph *periph, union xpt_action(start_ccb); } - if (bp != NULL || softc->tur) { + if (bp != NULL || softc->tur || + periph->immediate_priority != CAM_PRIORITY_NONE) { /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + xpt_schedule(periph, min(CAM_PRIORITY_NORMAL, + periph->immediate_priority)); } break; } @@ -3293,10 +3295,11 @@ cdmediapoll(void *arg) if (softc->flags & CD_FLAG_CHANGER) return; - if (softc->state == CD_STATE_NORMAL && !softc->tur) { + if (softc->state == CD_STATE_NORMAL && !softc->tur && + softc->outstanding_cmds == 0) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); } } /* Queue us up again */ From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 20:51:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42AD665E; Fri, 11 Jan 2013 20:51:03 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 34432EC; Fri, 11 Jan 2013 20:51:03 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BKp2Fl056907; Fri, 11 Jan 2013 20:51:02 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BKp2HX056906; Fri, 11 Jan 2013 20:51:02 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301112051.r0BKp2HX056906@svn.freebsd.org> From: Brooks Davis Date: Fri, 11 Jan 2013 20:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245311 - head/tools/build X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 20:51:03 -0000 Author: brooks Date: Fri Jan 11 20:51:02 2013 New Revision: 245311 URL: http://svnweb.freebsd.org/changeset/base/245311 Log: Add pwcache(3) and vis(3) to libegacy as install(1) is about to grow a dependency on them. Sponsored by: DARPA, AFRL Modified: head/tools/build/Makefile Modified: head/tools/build/Makefile ============================================================================== --- head/tools/build/Makefile Fri Jan 11 19:11:56 2013 (r245310) +++ head/tools/build/Makefile Fri Jan 11 20:51:02 2013 (r245311) @@ -21,6 +21,22 @@ config.h: ${.CURDIR}/../../lib/libmagic/ grep -v HAVE_GETLINE ${.ALLSRC} > ${.TARGET} .endif +_WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/pwd.h || true +.if ${_WITH_PWCACHEDB} == 0 +.PATH: ${.CURDIR}/../../contrib/libc-pwcache +CFLAGS+= -I${.CURDIR}/../../contrib/libc-pwcache \ + -I${.CURDIR}/../../lib/libc/include +SRCS+= pwcache.c +.endif + +_WITH_STRSVIS!= grep -c strsvis /usr/include/vis.h || true +.if ${_WITH_STRSVIS} == 0 +.PATH: ${.CURDIR}/../../contrib/libc-vis +SRCS+= vis.c +CFLAGS+= -I${.CURDIR}/../../contrib/libc-vis \ + -I${.CURDIR}/../../lib/libc/include +.endif + .if empty(SRCS) SRCS= dummy.c .endif From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 20:53:29 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1DD078AC; Fri, 11 Jan 2013 20:53:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A333110; Fri, 11 Jan 2013 20:53:29 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BKrSZI057182; Fri, 11 Jan 2013 20:53:28 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BKrSw0057178; Fri, 11 Jan 2013 20:53:28 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301112053.r0BKrSw0057178@svn.freebsd.org> From: Brooks Davis Date: Fri, 11 Jan 2013 20:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245312 - head/usr.bin/xinstall X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 20:53:29 -0000 Author: brooks Date: Fri Jan 11 20:53:28 2013 New Revision: 245312 URL: http://svnweb.freebsd.org/changeset/base/245312 Log: Implement the -N option which allows an alternate passwd and group file to be used. This is useful for installing on systems where a user or group does not currently exist. Sponsored by: DARPA, AFRL Obtained from: NetBSD MFC after: 5 days Modified: head/usr.bin/xinstall/Makefile head/usr.bin/xinstall/install.1 head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/Makefile ============================================================================== --- head/usr.bin/xinstall/Makefile Fri Jan 11 20:51:02 2013 (r245311) +++ head/usr.bin/xinstall/Makefile Fri Jan 11 20:53:28 2013 (r245312) @@ -3,6 +3,14 @@ PROG= xinstall PROGNAME= install +SRCS= xinstall.c getid.c MAN= install.1 +.PATH: ${.CURDIR}/../../contrib/mtree +CFLAGS+= -I${.CURDIR}/../../contrib/mtree +CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd + +DPADD+= ${LIBUTIL} +LDADD+= -lutil + .include Modified: head/usr.bin/xinstall/install.1 ============================================================================== --- head/usr.bin/xinstall/install.1 Fri Jan 11 20:51:02 2013 (r245311) +++ head/usr.bin/xinstall/install.1 Fri Jan 11 20:53:28 2013 (r245312) @@ -41,6 +41,7 @@ .Op Fl f Ar flags .Op Fl g Ar group .Op Fl m Ar mode +.Op Fl N Ar dbdir .Op Fl o Ar owner .Ar file1 file2 .Nm @@ -49,6 +50,7 @@ .Op Fl f Ar flags .Op Fl g Ar group .Op Fl m Ar mode +.Op Fl N Ar dbdir .Op Fl o Ar owner .Ar file1 ... fileN directory .Nm @@ -56,6 +58,7 @@ .Op Fl v .Op Fl g Ar group .Op Fl m Ar mode +.Op Fl N Ar dbdir .Op Fl o Ar owner .Ar directory ... .Sh DESCRIPTION @@ -124,6 +127,18 @@ The default mode is set to rwxr-xr-x (07 The specified mode may be either an octal or symbolic value; see .Xr chmod 1 for a description of possible mode values. +.It Fl N +Use the user database text file +.Pa master.passwd +and group database text file +.Pa group +from +.Ar dbdir , +rather than using the results from the system's +.Xr getpwnam 3 +and +.Xr getgrnam 3 +(and related) library calls. .It Fl o Specify an owner. A numeric UID is allowed. @@ -231,6 +246,8 @@ The default was changed to copy in .Xr mv 1 , .Xr strip 1 , .Xr mmap 2 , +.Xr getgrnam 3 , +.Xr getpwnam 3 , .Xr chown 8 .Sh HISTORY The Modified: head/usr.bin/xinstall/xinstall.c ============================================================================== --- head/usr.bin/xinstall/xinstall.c Fri Jan 11 20:51:02 2013 (r245311) +++ head/usr.bin/xinstall/xinstall.c Fri Jan 11 20:53:28 2013 (r245312) @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "mtree.h" + /* Bootstrap aid - this doesn't exist in most older releases */ #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1) /* from */ @@ -74,8 +76,6 @@ __FBSDID("$FreeBSD$"); #define NOCHANGEBITS (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND) #define BACKUP_SUFFIX ".old" -static struct passwd *pp; -static struct group *gp; static gid_t gid; static uid_t uid; static int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, @@ -89,7 +89,7 @@ static int create_newfile(const char *, static int create_tempfile(const char *, char *, size_t); static void install(const char *, const char *, u_long, u_int); static void install_dir(char *); -static u_long numeric_id(const char *, const char *); +static int parseid(const char *, id_t *); static void strip(const char *); static int trymmap(int); static void usage(void); @@ -107,7 +107,7 @@ main(int argc, char *argv[]) iflags = 0; group = owner = NULL; - while ((ch = getopt(argc, argv, "B:bCcdf:g:Mm:o:pSsv")) != -1) + while ((ch = getopt(argc, argv, "B:bCcdf:g:Mm:N:o:pSsv")) != -1) switch((char)ch) { case 'B': suffix = optarg; @@ -143,6 +143,11 @@ main(int argc, char *argv[]) mode = getmode(set, 0); free(set); break; + case 'N': + if (!setup_getid(optarg)) + err(1, "Unable to use user and group " + "databases in `%s'", optarg); + break; case 'o': owner = optarg; break; @@ -186,18 +191,22 @@ main(int argc, char *argv[]) /* get group and owner id's */ if (group != NULL) { - if ((gp = getgrnam(group)) != NULL) - gid = gp->gr_gid; - else - gid = (gid_t)numeric_id(group, "group"); + if (gid_from_group(group, &gid) == -1) { + id_t id; + if (!parseid(group, &id)) + errx(1, "unknown group %s", group); + gid = id; + } } else gid = (gid_t)-1; if (owner != NULL) { - if ((pp = getpwnam(owner)) != NULL) - uid = pp->pw_uid; - else - uid = (uid_t)numeric_id(owner, "user"); + if (uid_from_user(owner, &uid) == -1) { + id_t id; + if (!parseid(owner, &id)) + errx(1, "unknown user %s", owner); + uid = id; + } } else uid = (uid_t)-1; @@ -244,23 +253,19 @@ main(int argc, char *argv[]) /* NOTREACHED */ } -static u_long -numeric_id(const char *name, const char *type) +/* + * parseid -- + * parse uid or gid from arg into id, returning non-zero if successful + */ +static int +parseid(const char *name, id_t *id) { - u_long val; - char *ep; - - /* - * XXX - * We know that uid_t's and gid_t's are unsigned longs. - */ + char *ep; errno = 0; - val = strtoul(name, &ep, 10); - if (errno) - err(EX_NOUSER, "%s", name); - if (*ep != '\0') - errx(EX_NOUSER, "unknown %s %s", type, name); - return (val); + *id = (id_t)strtoul(name, &ep, 10); + if (errno || *ep != '\0') + return (0); + return (1); } /* @@ -786,10 +791,11 @@ usage(void) { (void)fprintf(stderr, "usage: install [-bCcMpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n" -" [-o owner] file1 file2\n" +" [-N dbdir] [-o owner] file1 file2\n" " install [-bCcMpSsv] [-B suffix] [-f flags] [-g group] [-m mode]\n" -" [-o owner] file1 ... fileN directory\n" -" install -d [-v] [-g group] [-m mode] [-o owner] directory ...\n"); +" [-N dbdir] [-o owner] file1 ... fileN directory\n" +" install -d [-v] [-g group] [-m mode] [-N dbdir] [-o owner]\n" +" directory ...\n"); exit(EX_USAGE); /* NOTREACHED */ } From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 21:11:01 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ED022C5B; Fri, 11 Jan 2013 21:11:01 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DEC181AA; Fri, 11 Jan 2013 21:11:01 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BLB1Gt062739; Fri, 11 Jan 2013 21:11:01 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BLB1SH062738; Fri, 11 Jan 2013 21:11:01 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301112111.r0BLB1SH062738@svn.freebsd.org> From: Brooks Davis Date: Fri, 11 Jan 2013 21:11:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245313 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 21:11:02 -0000 Author: brooks Date: Fri Jan 11 21:11:01 2013 New Revision: 245313 URL: http://svnweb.freebsd.org/changeset/base/245313 Log: Bump __FreeBSD_version for install -N and (belatedly) nmtree. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jan 11 20:53:28 2013 (r245312) +++ head/sys/sys/param.h Fri Jan 11 21:11:01 2013 (r245313) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000025 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000026 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 21:19:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7CDA9DD; Fri, 11 Jan 2013 21:19:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D34E238; Fri, 11 Jan 2013 21:19:46 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BLJkXH063718; Fri, 11 Jan 2013 21:19:46 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BLJkSN063717; Fri, 11 Jan 2013 21:19:46 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301112119.r0BLJkSN063717@svn.freebsd.org> From: Warner Losh Date: Fri, 11 Jan 2013 21:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245314 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 21:19:46 -0000 Author: imp Date: Fri Jan 11 21:19:45 2013 New Revision: 245314 URL: http://svnweb.freebsd.org/changeset/base/245314 Log: style(9) changes before I do more real changes. Modified: head/sys/dev/atkbdc/atkbd.c Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Fri Jan 11 21:11:01 2013 (r245313) +++ head/sys/dev/atkbdc/atkbd.c Fri Jan 11 21:19:45 2013 (r245314) @@ -401,7 +401,7 @@ atkbd_init(int unit, keyboard_t **kbdp, bcopy(&key_map, keymap, sizeof(key_map)); bcopy(&accent_map, accmap, sizeof(accent_map)); bcopy(fkey_tab, fkeymap, - imin(fkeymap_size*sizeof(fkeymap[0]), sizeof(fkey_tab))); + imin(fkeymap_size * sizeof(fkeymap[0]), sizeof(fkey_tab))); kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size); kbd->kb_data = (void *)state; @@ -424,8 +424,8 @@ atkbd_init(int unit, keyboard_t **kbdp, if (!KBD_IS_INITIALIZED(kbd) && !(flags & KB_CONF_PROBE_ONLY)) { kbd->kb_config = flags & ~KB_CONF_PROBE_ONLY; if (KBD_HAS_DEVICE(kbd) - && init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config) - && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) { + && init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config) + && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) { kbd_unregister(kbd); error = ENXIO; goto bad; @@ -485,8 +485,7 @@ atkbd_intr(keyboard_t *kbd, void *arg) * The keyboard was not detected before; * it must have been reconnected! */ - init_keyboard(state->kbdc, &kbd->kb_type, - kbd->kb_config); + init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config); KBD_FOUND_DEVICE(kbd); atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state); get_typematic(kbd); @@ -645,7 +644,7 @@ next_code: goto next_code; } break; - case 0xE0: /* 0xE0 prefix */ + case 0xE0: /* 0xE0 prefix */ state->ks_prefix = 0; switch (keycode) { case 0x1C: /* right enter key */ @@ -655,57 +654,57 @@ next_code: keycode = 0x5A; break; case 0x35: /* keypad divide key */ - keycode = 0x5B; - break; + keycode = 0x5B; + break; case 0x37: /* print scrn key */ - keycode = 0x5C; - break; + keycode = 0x5C; + break; case 0x38: /* right alt key (alt gr) */ - keycode = 0x5D; - break; + keycode = 0x5D; + break; case 0x46: /* ctrl-pause/break on AT 101 (see below) */ keycode = 0x68; - break; + break; case 0x47: /* grey home key */ - keycode = 0x5E; - break; + keycode = 0x5E; + break; case 0x48: /* grey up arrow key */ - keycode = 0x5F; - break; + keycode = 0x5F; + break; case 0x49: /* grey page up key */ - keycode = 0x60; - break; + keycode = 0x60; + break; case 0x4B: /* grey left arrow key */ - keycode = 0x61; - break; + keycode = 0x61; + break; case 0x4D: /* grey right arrow key */ - keycode = 0x62; - break; + keycode = 0x62; + break; case 0x4F: /* grey end key */ - keycode = 0x63; - break; + keycode = 0x63; + break; case 0x50: /* grey down arrow key */ - keycode = 0x64; - break; + keycode = 0x64; + break; case 0x51: /* grey page down key */ - keycode = 0x65; - break; + keycode = 0x65; + break; case 0x52: /* grey insert key */ - keycode = 0x66; - break; + keycode = 0x66; + break; case 0x53: /* grey delete key */ - keycode = 0x67; - break; - /* the following 3 are only used on the MS "Natural" keyboard */ + keycode = 0x67; + break; + /* the following 3 are only used on the MS "Natural" keyboard */ case 0x5b: /* left Window key */ - keycode = 0x69; - break; + keycode = 0x69; + break; case 0x5c: /* right Window key */ - keycode = 0x6a; - break; + keycode = 0x6a; + break; case 0x5d: /* menu key */ - keycode = 0x6b; - break; + keycode = 0x6b; + break; case 0x5e: /* power key */ keycode = 0x6d; break; @@ -716,10 +715,10 @@ next_code: keycode = 0x6f; break; default: /* ignore everything else */ - goto next_code; + goto next_code; } break; - case 0xE1: /* 0xE1 prefix */ + case 0xE1: /* 0xE1 prefix */ /* * The pause/break key on the 101 keyboard produces: * E1-1D-45 E1-9D-C5 @@ -728,10 +727,10 @@ next_code: */ state->ks_prefix = 0; if (keycode == 0x1D) - state->ks_prefix = 0x1D; + state->ks_prefix = 0x1D; goto next_code; /* NOT REACHED */ - case 0x1D: /* pause / break */ + case 0x1D: /* pause / break */ state->ks_prefix = 0; if (keycode != 0x45) goto next_code; @@ -743,7 +742,7 @@ next_code: switch (keycode) { case 0x37: /* *(numpad)/print screen */ if (state->ks_flags & SHIFTS) - keycode = 0x5c; /* print screen */ + keycode = 0x5c; /* print screen */ break; case 0x45: /* num lock/pause */ if (state->ks_flags & CTLS) @@ -1177,7 +1176,7 @@ get_kbd_echo(KBDC kbdc) */ return ENXIO; } - + return 0; } @@ -1275,7 +1274,7 @@ init_keyboard(KBDC kbdc, int *type, int } if (bootverbose) printf("atkbd: the current kbd controller command byte %04x\n", - c); + c); #if 0 /* override the keyboard lock switch */ c |= KBD_OVERRIDE_KBD_LOCK; @@ -1415,52 +1414,49 @@ init_keyboard(KBDC kbdc, int *type, int static int write_kbd(KBDC kbdc, int command, int data) { - int s; + int s; - /* prevent the timeout routine from polling the keyboard */ - if (!kbdc_lock(kbdc, TRUE)) - return EBUSY; + /* prevent the timeout routine from polling the keyboard */ + if (!kbdc_lock(kbdc, TRUE)) + return EBUSY; - /* disable the keyboard and mouse interrupt */ - s = spltty(); + /* disable the keyboard and mouse interrupt */ + s = spltty(); #if 0 - c = get_controller_command_byte(kbdc); - if ((c == -1) - || !set_controller_command_byte(kbdc, - kbdc_get_device_mask(kbdc), - KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT - | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) { - /* CONTROLLER ERROR */ - kbdc_lock(kbdc, FALSE); + c = get_controller_command_byte(kbdc); + if ((c == -1) + || !set_controller_command_byte(kbdc, + kbdc_get_device_mask(kbdc), + KBD_DISABLE_KBD_PORT | KBD_DISABLE_KBD_INT + | KBD_DISABLE_AUX_PORT | KBD_DISABLE_AUX_INT)) { + /* CONTROLLER ERROR */ + kbdc_lock(kbdc, FALSE); + splx(s); + return EIO; + } + /* + * Now that the keyboard controller is told not to generate + * the keyboard and mouse interrupts, call `splx()' to allow + * the other tty interrupts. The clock interrupt may also occur, + * but the timeout routine (`scrn_timer()') will be blocked + * by the lock flag set via `kbdc_lock()' + */ splx(s); - return EIO; - } - /* - * Now that the keyboard controller is told not to generate - * the keyboard and mouse interrupts, call `splx()' to allow - * the other tty interrupts. The clock interrupt may also occur, - * but the timeout routine (`scrn_timer()') will be blocked - * by the lock flag set via `kbdc_lock()' - */ - splx(s); #endif - - if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK) - send_kbd_command(kbdc, KBDC_ENABLE_KBD); - + if (send_kbd_command_and_data(kbdc, command, data) != KBD_ACK) + send_kbd_command(kbdc, KBDC_ENABLE_KBD); #if 0 - /* restore the interrupts */ - if (!set_controller_command_byte(kbdc, - kbdc_get_device_mask(kbdc), + /* restore the interrupts */ + if (!set_controller_command_byte(kbdc, kbdc_get_device_mask(kbdc), c & (KBD_KBD_CONTROL_BITS | KBD_AUX_CONTROL_BITS))) { - /* CONTROLLER ERROR */ - } + /* CONTROLLER ERROR */ + } #else - splx(s); + splx(s); #endif - kbdc_lock(kbdc, FALSE); + kbdc_lock(kbdc, FALSE); - return 0; + return 0; } static int From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 21:42:25 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B373544; Fri, 11 Jan 2013 21:42:25 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E197B2D5; Fri, 11 Jan 2013 21:42:24 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BLgOIA070744; Fri, 11 Jan 2013 21:42:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BLgOoN070741; Fri, 11 Jan 2013 21:42:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301112142.r0BLgOoN070741@svn.freebsd.org> From: Warner Losh Date: Fri, 11 Jan 2013 21:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245315 - head/sys/dev/atkbdc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 21:42:25 -0000 Author: imp Date: Fri Jan 11 21:42:23 2013 New Revision: 245315 URL: http://svnweb.freebsd.org/changeset/base/245315 Log: Pass the device_t into atkbd_{probe,attach}_unit and get the controller unit and keyboard unit from there. It will be needed for other things in the future as well... Modified: head/sys/dev/atkbdc/atkbd.c head/sys/dev/atkbdc/atkbd_atkbdc.c head/sys/dev/atkbdc/atkbdreg.h Modified: head/sys/dev/atkbdc/atkbd.c ============================================================================== --- head/sys/dev/atkbdc/atkbd.c Fri Jan 11 21:19:45 2013 (r245314) +++ head/sys/dev/atkbdc/atkbd.c Fri Jan 11 21:42:23 2013 (r245315) @@ -66,7 +66,7 @@ static timeout_t atkbd_timeout; static void atkbd_shutdown_final(void *v); int -atkbd_probe_unit(int unit, int ctlr, int irq, int flags) +atkbd_probe_unit(device_t dev, int irq, int flags) { keyboard_switch_t *sw; int args[2]; @@ -76,27 +76,29 @@ atkbd_probe_unit(int unit, int ctlr, int if (sw == NULL) return ENXIO; - args[0] = ctlr; + args[0] = device_get_unit(device_get_parent(dev)); args[1] = irq; - error = (*sw->probe)(unit, args, flags); + error = (*sw->probe)(device_get_unit(dev), args, flags); if (error) return error; return 0; } int -atkbd_attach_unit(int unit, keyboard_t **kbd, int ctlr, int irq, int flags) +atkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags) { keyboard_switch_t *sw; int args[2]; int error; + int unit; sw = kbd_get_switch(ATKBD_DRIVER_NAME); if (sw == NULL) return ENXIO; /* reset, initialize and enable the device */ - args[0] = ctlr; + unit = device_get_unit(dev); + args[0] = device_get_unit(device_get_parent(dev)); args[1] = irq; *kbd = NULL; error = (*sw->probe)(unit, args, flags); Modified: head/sys/dev/atkbdc/atkbd_atkbdc.c ============================================================================== --- head/sys/dev/atkbdc/atkbd_atkbdc.c Fri Jan 11 21:19:45 2013 (r245314) +++ head/sys/dev/atkbdc/atkbd_atkbdc.c Fri Jan 11 21:42:23 2013 (r245315) @@ -104,9 +104,7 @@ atkbdprobe(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, rid, res); /* probe the device */ - return atkbd_probe_unit(device_get_unit(dev), - device_get_unit(device_get_parent(dev)), - irq, flags); + return atkbd_probe_unit(dev, irq, flags); } static int @@ -124,9 +122,7 @@ atkbdattach(device_t dev) rid = KBDC_RID_KBD; irq = bus_get_resource_start(dev, SYS_RES_IRQ, rid); flags = device_get_flags(dev); - error = atkbd_attach_unit(device_get_unit(dev), &kbd, - device_get_unit(device_get_parent(dev)), - irq, flags); + error = atkbd_attach_unit(dev, &kbd, irq, flags); if (error) return error; Modified: head/sys/dev/atkbdc/atkbdreg.h ============================================================================== --- head/sys/dev/atkbdc/atkbdreg.h Fri Jan 11 21:19:45 2013 (r245314) +++ head/sys/dev/atkbdc/atkbdreg.h Fri Jan 11 21:42:23 2013 (r245315) @@ -39,9 +39,8 @@ #ifdef _KERNEL -int atkbd_probe_unit(int unit, int ctlr, int irq, int flags); -int atkbd_attach_unit(int unit, keyboard_t **kbd, - int ctlr, int irq, int flags); +int atkbd_probe_unit(device_t dev, int irq, int flags); +int atkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags); #endif From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 23:08:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E7C6CB1A; Fri, 11 Jan 2013 23:08:19 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CB9A0890; Fri, 11 Jan 2013 23:08:19 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BN8Jki093607; Fri, 11 Jan 2013 23:08:19 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BN8JP4093605; Fri, 11 Jan 2013 23:08:19 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301112308.r0BN8JP4093605@svn.freebsd.org> From: Brooks Davis Date: Fri, 11 Jan 2013 23:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245316 - in head: . etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 23:08:20 -0000 Author: brooks Date: Fri Jan 11 23:08:19 2013 New Revision: 245316 URL: http://svnweb.freebsd.org/changeset/base/245316 Log: Use the -N option to install and nmtree to eliminate the need for the checks for missing users and groups. Sponsored by: DARPA, AFRL Modified: head/Makefile.inc1 head/etc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 11 21:42:23 2013 (r245315) +++ head/Makefile.inc1 Fri Jan 11 23:08:19 2013 (r245316) @@ -340,12 +340,14 @@ LIB32WMAKEFLAGS+= \ LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML -LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS +LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \ + INSTALL="install -N ${.CURDIR}/etc" .endif -# install stage IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ + INSTALL="install -N ${.CURDIR}/etc" \ + MTREE_CMD="nmtree -N ${.CURDIR}/etc" .if empty(.MAKEFLAGS:M-n) IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ LD_LIBRARY_PATH=${INSTALLTMP} \ @@ -609,34 +611,6 @@ installcheck_DESTDIR: .endif # -# Check for missing UIDs/GIDs. -# -CHECK_UIDS= auditdistd -CHECK_GIDS= audit -.if ${MK_SENDMAIL} != "no" -CHECK_UIDS+= smmsp -CHECK_GIDS+= smmsp -.endif -.if ${MK_PF} != "no" -CHECK_UIDS+= proxy -CHECK_GIDS+= proxy authpf -.endif -installcheck: installcheck_UGID -installcheck_UGID: -.for uid in ${CHECK_UIDS} - @if ! `id -u ${uid} >/dev/null 2>&1`; then \ - echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ - false; \ - fi -.endfor -.for gid in ${CHECK_GIDS} - @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \ - echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \ - false; \ - fi -.endfor - -# # Required install tools to be saved in a scratch dir for safety. # .if ${MK_INFO} != "no" @@ -692,6 +666,7 @@ distributeworld installworld: installche done); \ cp $$libs $$progs ${INSTALLTMP} cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale + rm -f ${METALOG} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} -mkdir ${DESTDIR}/${DISTDIR}/${dist} @@ -753,7 +728,8 @@ redistribute: .endif distrib-dirs distribution: - cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET} + cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ + INSTALL="install -N ${.CURDIR}/etc" ${.TARGET} # # buildkernel and installkernel @@ -1059,6 +1035,11 @@ _lex= usr.bin/lex _yacc= usr.bin/yacc .endif +.if ${BOOTSTRAPPING} < 1000026 +_nmtree= lib/libnetbsd \ + usr.sbin/nmtree +.endif + .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 _awk= usr.bin/awk .endif @@ -1120,7 +1101,8 @@ bootstrap-tools: ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ - usr.sbin/config + usr.sbin/config \ + ${_nmtree} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Jan 11 21:42:23 2013 (r245315) +++ head/etc/Makefile Fri Jan 11 23:08:19 2013 (r245316) @@ -291,25 +291,27 @@ distribution: ${DESTDIR}/etc/nsswitch.conf .endif +MTREE_CMD?= mtree + distrib-dirs: - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ -p ${DESTDIR}/usr/include .if ${MK_BIND_LIBS} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ -p ${DESTDIR}/usr/include .endif .if ${MK_BIND_MTREE} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \ + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \ -p ${DESTDIR}/var/named .endif .if ${MK_GROFF} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr .endif .if ${MK_SENDMAIL} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/ + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/ .endif cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* . From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 23:19:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5403CDFB for ; Fri, 11 Jan 2013 23:19:48 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx1.freebsd.org (Postfix) with ESMTP id EAC448E8 for ; Fri, 11 Jan 2013 23:19:47 +0000 (UTC) Received: by mail-vc0-f175.google.com with SMTP id fy7so1972620vcb.34 for ; Fri, 11 Jan 2013 15:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ITby9RjG/ZMA2Q+iuAG6KRY5+2DOtS/VolRzo4MrwZM=; b=q9Qxoi3sNlpykBG5MCjcAqzLZAgILGui5qQYub/7vFl1feVSn7sUU30CHZSoM125jf 4EzcH9n9dYkZP4FmEjkUo7T9g/g5/qixCuFSwcQTUKyc0k0phJtWRyzpmEzebzHYsum9 MMeKja65+LGzQ10y3KbA5G0Y8kj9yKz8NspwY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=ITby9RjG/ZMA2Q+iuAG6KRY5+2DOtS/VolRzo4MrwZM=; b=B2tgoVoF0C/xmdmEyXvban6cCqrmd/3puyxFtPxNcIeEwxNw5GNPIfPsIMPr006vIG f6iUOxZaebgIw3zxYB0NYzkG4OkR1iBcS3+kYCSPkyywbWvZiImhLNZxzDUs0NCvnkge 6scSXHDzaShQKp1VPj0C/pDjuFj7GMcBKDC6IKaEngE5NQY6zPslqj3rGZFtoSmSlSw4 3wOThJA1EfXrF0wBZgWsEyjDnYShZTZi4V39ZgXbJZQo+D5dYIWHdfOVQtUSzfrbAKu2 oMljjnPPSRyOAVmBty3Vtq9L65cJPAPxTnAZqzZpjQx7mLuE7/R4PQF25zqgqg/aMz35 FQvA== MIME-Version: 1.0 Received: by 10.52.23.14 with SMTP id i14mr82762021vdf.130.1357946386963; Fri, 11 Jan 2013 15:19:46 -0800 (PST) Received: by 10.221.4.72 with HTTP; Fri, 11 Jan 2013 15:19:46 -0800 (PST) In-Reply-To: <201301112308.r0BN8JP4093605@svn.freebsd.org> References: <201301112308.r0BN8JP4093605@svn.freebsd.org> Date: Fri, 11 Jan 2013 15:19:46 -0800 Message-ID: Subject: Re: svn commit: r245316 - in head: . etc From: Peter Wemm To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQnRpTztE26cOO8fH6+rQEv5LDYNnBa13pEaPswfsN0qdIhSwbXS+5OfDQdj9jNkK/pf+HwW Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 23:19:48 -0000 On Fri, Jan 11, 2013 at 3:08 PM, Brooks Davis wrote: > -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 > +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ > + INSTALL="install -N ${.CURDIR}/etc" \ > + MTREE_CMD="nmtree -N ${.CURDIR}/etc" How does this work with worlds with different UID/GID assignments? Eg: the freebsd.org cluster? ${.CURDIR}/etc/master.passwd does not match the installed system. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV bitcoin:188ZjyYLFJiEheQZw4UtU27e2FMLmuRBUE From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 23:40:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0577C51B for ; Fri, 11 Jan 2013 23:40:37 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx1.freebsd.org (Postfix) with ESMTP id BB81A9AB for ; Fri, 11 Jan 2013 23:40:36 +0000 (UTC) Received: by mail-vc0-f174.google.com with SMTP id d16so1959926vcd.5 for ; Fri, 11 Jan 2013 15:40:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nETBgqdnuBgpHfGTSKeV5Gl/QG9lXZbtdbgor+kwn4U=; b=KvfsQwoyJUWZX/Mh6wRv/uzvdKylfy1ot6Op9MwuGdJv9jQmJb8bvyJzY1AR8YJJxY 5q1iZlIiTv9MTYw3o3ZbDUW1IOGhIm8/DOy5A9x36SAhVeJQDOUz4ycHC7fs50kmJJLI 5X2NAD/QMgdvQ3Oe2C5RRyWtl+ydznJso1bA8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=nETBgqdnuBgpHfGTSKeV5Gl/QG9lXZbtdbgor+kwn4U=; b=f8TmSHx/ajxUTp50PW6M3E+F3dHJhM4AdHBWMYGUqq3+OUK+PEbswttMcB5dDs35Ls nfjd7qF6CyEYOTNOIZ9ZvYv1aSVpeM3YipyNgr3b7MnmXQbZsaVdaM8JmbMGyghjuyih 6bjeSC3yzrStVv8/lLXzNV2oF8/1/30DAlIQHFlm//YP9lFn94HgE7sTtv8BBcZFUD5a kjNb2exbuV9hzktkph6Uf26tY2yirG4/Oe8kVuygH2v/0J8uVxUQ1oAOBIoUBG356u3D A5IFr0AGWlcd2brHDC0dq0NtnaAr9xsQFEL3g0hBeo4qZ2/IjiSbRpvaiwjfcI9h3uRP /ZOw== MIME-Version: 1.0 Received: by 10.220.209.74 with SMTP id gf10mr94358970vcb.10.1357947635677; Fri, 11 Jan 2013 15:40:35 -0800 (PST) Received: by 10.221.4.72 with HTTP; Fri, 11 Jan 2013 15:40:35 -0800 (PST) In-Reply-To: References: <201301112308.r0BN8JP4093605@svn.freebsd.org> Date: Fri, 11 Jan 2013 15:40:35 -0800 Message-ID: Subject: Re: svn commit: r245316 - in head: . etc From: Peter Wemm To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkMIwTvfkFjG6fmAe6j6ziW8B3BDY+1pqBwrY+eb7zUQGwl92rmSLXhZIXGxIjmMltxN/sY Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 23:40:37 -0000 On Fri, Jan 11, 2013 at 3:19 PM, Peter Wemm wrote: > On Fri, Jan 11, 2013 at 3:08 PM, Brooks Davis wrote: > >> -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 >> +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ >> + INSTALL="install -N ${.CURDIR}/etc" \ >> + MTREE_CMD="nmtree -N ${.CURDIR}/etc" > > How does this work with worlds with different UID/GID assignments? > Eg: the freebsd.org cluster? > > ${.CURDIR}/etc/master.passwd does not match the installed system. Case in point, the freebsd.org cluster has used postfix before sendmail gained its privilege separation. We had: postfix:*:25:postfix postdrop:*:26: .. long before sendmail added: smmsp:*:25: mailnull:*:26: On an existing machine we have: -r-xr-sr-x 1 root smmsp 719336 Jan 6 15:13 /usr/libexec/sendmail/sendmail But on the freebsd.org machines that have machines dating back to 1998, this change would cause: -r-xr-sr-x 1 root postfix 719336 Jan 6 15:13 /usr/libexec/sendmail/sendmail With a silent change like that, if the admin doesn't notice.. who can tell what would happen? Silently giving sendmail setgid access to another subsystem's gid is.. just POLA violation at every conceivable level and potentially dangerous. These tools from netbsd were meant for cross compiling.. ie: when DESTDIR != /. -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV bitcoin:188ZjyYLFJiEheQZw4UtU27e2FMLmuRBUE From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 23:42:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E89656C4; Fri, 11 Jan 2013 23:42:24 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B407D9BC; Fri, 11 Jan 2013 23:42:24 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BNgOOm003975; Fri, 11 Jan 2013 23:42:24 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BNgO1f003974; Fri, 11 Jan 2013 23:42:24 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201301112342.r0BNgO1f003974@svn.freebsd.org> From: Warner Losh Date: Fri, 11 Jan 2013 23:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245317 - head/sys/pc98/cbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 23:42:25 -0000 Author: imp Date: Fri Jan 11 23:42:24 2013 New Revision: 245317 URL: http://svnweb.freebsd.org/changeset/base/245317 Log: MFi386: Make similar changes that were made to atkbdc in r245315. Modified: head/sys/pc98/cbus/pckbd.c Modified: head/sys/pc98/cbus/pckbd.c ============================================================================== --- head/sys/pc98/cbus/pckbd.c Fri Jan 11 23:08:19 2013 (r245316) +++ head/sys/pc98/cbus/pckbd.c Fri Jan 11 23:42:24 2013 (r245317) @@ -77,9 +77,9 @@ DRIVER_MODULE(pckbd, isa, pckbd_driver, static bus_addr_t pckbd_iat[] = {0, 2}; -static int pckbd_probe_unit(int unit, int port, int irq, +static int pckbd_probe_unit(device_t dev, int port, int irq, int flags); -static int pckbd_attach_unit(int unit, keyboard_t **kbd, +static int pckbd_attach_unit(device_t dev, keyboard_t **kbd, int port, int irq, int flags); static timeout_t pckbd_timeout; @@ -103,7 +103,7 @@ pckbdprobe(device_t dev) return ENXIO; isa_load_resourcev(res, pckbd_iat, 2); - error = pckbd_probe_unit(device_get_unit(dev), + error = pckbd_probe_unit(dev, isa_get_port(dev), (1 << isa_get_irq(dev)), device_get_flags(dev)); @@ -128,7 +128,7 @@ pckbdattach(device_t dev) return ENXIO; isa_load_resourcev(res, pckbd_iat, 2); - error = pckbd_attach_unit(device_get_unit(dev), &kbd, + error = pckbd_attach_unit(dev, &kbd, isa_get_port(dev), (1 << isa_get_irq(dev)), device_get_flags(dev)); @@ -164,7 +164,7 @@ pckbd_isa_intr(void *arg) } static int -pckbd_probe_unit(int unit, int port, int irq, int flags) +pckbd_probe_unit(device_t dev, int port, int irq, int flags) { keyboard_switch_t *sw; int args[2]; @@ -176,24 +176,26 @@ pckbd_probe_unit(int unit, int port, int args[0] = port; args[1] = irq; - error = (*sw->probe)(unit, args, flags); + error = (*sw->probe)(device_get_unit(dev), args, flags); if (error) return error; return 0; } static int -pckbd_attach_unit(int unit, keyboard_t **kbd, int port, int irq, int flags) +pckbd_attach_unit(device_t dev, keyboard_t **kbd, int port, int irq, int flags) { keyboard_switch_t *sw; int args[2]; int error; + int unit; sw = kbd_get_switch(DRIVER_NAME); if (sw == NULL) return ENXIO; /* reset, initialize and enable the device */ + unit = device_get_unit(dev); args[0] = port; args[1] = irq; *kbd = NULL; From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 23:44:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F1E6B849; Fri, 11 Jan 2013 23:44:35 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D582B9D2; Fri, 11 Jan 2013 23:44:35 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0BNiZqp004229; Fri, 11 Jan 2013 23:44:35 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0BNiZx0004227; Fri, 11 Jan 2013 23:44:35 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201301112344.r0BNiZx0004227@svn.freebsd.org> From: Brooks Davis Date: Fri, 11 Jan 2013 23:44:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245318 - in head: . etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 23:44:36 -0000 Author: brooks Date: Fri Jan 11 23:44:35 2013 New Revision: 245318 URL: http://svnweb.freebsd.org/changeset/base/245318 Log: Revert r245316. Systems with non-standard uids/gids are more prevalent that I'd feared. Discussion is ongoing about the scope of a safer solution. Modified: head/Makefile.inc1 head/etc/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Jan 11 23:42:24 2013 (r245317) +++ head/Makefile.inc1 Fri Jan 11 23:44:35 2013 (r245318) @@ -340,14 +340,12 @@ LIB32WMAKEFLAGS+= \ LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML -LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \ - INSTALL="install -N ${.CURDIR}/etc" +LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS .endif +# install stage IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ - INSTALL="install -N ${.CURDIR}/etc" \ - MTREE_CMD="nmtree -N ${.CURDIR}/etc" +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 .if empty(.MAKEFLAGS:M-n) IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ LD_LIBRARY_PATH=${INSTALLTMP} \ @@ -611,6 +609,34 @@ installcheck_DESTDIR: .endif # +# Check for missing UIDs/GIDs. +# +CHECK_UIDS= auditdistd +CHECK_GIDS= audit +.if ${MK_SENDMAIL} != "no" +CHECK_UIDS+= smmsp +CHECK_GIDS+= smmsp +.endif +.if ${MK_PF} != "no" +CHECK_UIDS+= proxy +CHECK_GIDS+= proxy authpf +.endif +installcheck: installcheck_UGID +installcheck_UGID: +.for uid in ${CHECK_UIDS} + @if ! `id -u ${uid} >/dev/null 2>&1`; then \ + echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ + false; \ + fi +.endfor +.for gid in ${CHECK_GIDS} + @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \ + echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \ + false; \ + fi +.endfor + +# # Required install tools to be saved in a scratch dir for safety. # .if ${MK_INFO} != "no" @@ -666,7 +692,6 @@ distributeworld installworld: installche done); \ cp $$libs $$progs ${INSTALLTMP} cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale - rm -f ${METALOG} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} -mkdir ${DESTDIR}/${DISTDIR}/${dist} @@ -728,8 +753,7 @@ redistribute: .endif distrib-dirs distribution: - cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ - INSTALL="install -N ${.CURDIR}/etc" ${.TARGET} + cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET} # # buildkernel and installkernel @@ -1035,11 +1059,6 @@ _lex= usr.bin/lex _yacc= usr.bin/yacc .endif -.if ${BOOTSTRAPPING} < 1000026 -_nmtree= lib/libnetbsd \ - usr.sbin/nmtree -.endif - .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 _awk= usr.bin/awk .endif @@ -1101,8 +1120,7 @@ bootstrap-tools: ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ - usr.sbin/config \ - ${_nmtree} + usr.sbin/config ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Fri Jan 11 23:42:24 2013 (r245317) +++ head/etc/Makefile Fri Jan 11 23:44:35 2013 (r245318) @@ -291,27 +291,25 @@ distribution: ${DESTDIR}/etc/nsswitch.conf .endif -MTREE_CMD?= mtree - distrib-dirs: - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ + mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ + mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var + mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr + mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ -p ${DESTDIR}/usr/include .if ${MK_BIND_LIBS} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ + mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ -p ${DESTDIR}/usr/include .endif .if ${MK_BIND_MTREE} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \ + mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \ -p ${DESTDIR}/var/named .endif .if ${MK_GROFF} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr + mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr .endif .if ${MK_SENDMAIL} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/ + mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/ .endif cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* . From owner-svn-src-head@FreeBSD.ORG Fri Jan 11 23:51:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6F214D89; Fri, 11 Jan 2013 23:51:45 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 1A570A3F; Fri, 11 Jan 2013 23:51:43 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r0BNphbe091611; Fri, 11 Jan 2013 17:51:43 -0600 (CST) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r0BNphBZ091610; Fri, 11 Jan 2013 17:51:43 -0600 (CST) (envelope-from brooks) Date: Fri, 11 Jan 2013 17:51:43 -0600 From: Brooks Davis To: Peter Wemm Subject: Re: svn commit: r245316 - in head: . etc Message-ID: <20130111235143.GA91287@lor.one-eyed-alien.net> References: <201301112308.r0BN8JP4093605@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DocE+STaALJfprDB" 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, Brooks Davis , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2013 23:51:45 -0000 --DocE+STaALJfprDB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 11, 2013 at 03:40:35PM -0800, Peter Wemm wrote: > On Fri, Jan 11, 2013 at 3:19 PM, Peter Wemm wrote: > > On Fri, Jan 11, 2013 at 3:08 PM, Brooks Davis wrot= e: > > > >> -IMAKE=3D ${IMAKEENV} ${MAKE} -f Makefile.inc1 > >> +IMAKE=3D ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ > >> + INSTALL=3D"install -N ${.CURDIR}/etc" \ > >> + MTREE_CMD=3D"nmtree -N ${.CURDIR}/etc" > > > > How does this work with worlds with different UID/GID assignments? > > Eg: the freebsd.org cluster? > > > > ${.CURDIR}/etc/master.passwd does not match the installed system. >=20 > Case in point, the freebsd.org cluster has used postfix before > sendmail gained its privilege separation. We had: > postfix:*:25:postfix > postdrop:*:26: > .. long before sendmail added: > smmsp:*:25: > mailnull:*:26: >=20 > On an existing machine we have: > -r-xr-sr-x 1 root smmsp 719336 Jan 6 15:13 /usr/libexec/sendmail/send= mail >=20 > But on the freebsd.org machines that have machines dating back to > 1998, this change would cause: > -r-xr-sr-x 1 root postfix 719336 Jan 6 15:13 /usr/libexec/sendmail/se= ndmail >=20 > With a silent change like that, if the admin doesn't notice.. who can > tell what would happen? Silently giving sendmail setgid access to > another subsystem's gid is.. just POLA violation at every conceivable > level and potentially dangerous. >=20 > These tools from netbsd were meant for cross compiling.. ie: when DESTDIR= !=3D /. I've reverted this change. In my defense I'd note that NetBSD always uses -N. If you want non-standard uids and gids there you just end your source tree. -- Brooks --DocE+STaALJfprDB Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFQ8KWPXY6L6fI4GtQRAhEiAJ9ks8D1CY3aur8N9VHLBL3XgUqLfQCgg9SW qX5aju1Nou7QM5C0EoLpZ1M= =G/Bb -----END PGP SIGNATURE----- --DocE+STaALJfprDB-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 08:44:55 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5CA4364A; Sat, 12 Jan 2013 08:44:55 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 49CB9B4E; Sat, 12 Jan 2013 08:44:55 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0C8itEJ057858; Sat, 12 Jan 2013 08:44:55 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0C8isTa057855; Sat, 12 Jan 2013 08:44:54 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201301120844.r0C8isTa057855@svn.freebsd.org> From: Joel Dahl Date: Sat, 12 Jan 2013 08:44:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245323 - in head: share/man/man4 usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 08:44:55 -0000 Author: joel (doc committer) Date: Sat Jan 12 08:44:54 2013 New Revision: 245323 URL: http://svnweb.freebsd.org/changeset/base/245323 Log: Remove EOL whitespace. Modified: head/share/man/man4/stf.4 head/usr.sbin/bsdinstall/partedit/sade.8 Modified: head/share/man/man4/stf.4 ============================================================================== --- head/share/man/man4/stf.4 Sat Jan 12 04:36:40 2013 (r245322) +++ head/share/man/man4/stf.4 Sat Jan 12 08:44:54 2013 (r245323) @@ -190,8 +190,8 @@ The default value is shown next to each .It Va net.link.stf.permit_rfc1918 : No 0 The RFC3056 requires the use of globally unique 32-bit IPv4 addresses. This sysctl variable controls the behaviour of this -requirement. When it set to not 0, -.Nm stf +requirement. When it set to not 0, +.Nm stf allows the use of private IPv4 addresses described in the RFC1918. This may be useful for an Intranet environment or when some mechanisms of network address translation (NAT) are used. Modified: head/usr.sbin/bsdinstall/partedit/sade.8 ============================================================================== --- head/usr.sbin/bsdinstall/partedit/sade.8 Sat Jan 12 04:36:40 2013 (r245322) +++ head/usr.sbin/bsdinstall/partedit/sade.8 Sat Jan 12 08:44:54 2013 (r245323) @@ -56,7 +56,7 @@ in the post-installation environment. A program called .Nm first appeared in -.Fx 6.3 +.Fx 6.3 as a utility encapsulating features from the .Xr sysinstall 8 installer. It was replaced in From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 09:07:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9A6D8F5; Sat, 12 Jan 2013 09:07:19 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B8371C20; Sat, 12 Jan 2013 09:07:19 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0C97JV4064143; Sat, 12 Jan 2013 09:07:19 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0C97JvL064142; Sat, 12 Jan 2013 09:07:19 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201301120907.r0C97JvL064142@svn.freebsd.org> From: Joel Dahl Date: Sat, 12 Jan 2013 09:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245324 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 09:07:20 -0000 Author: joel (doc committer) Date: Sat Jan 12 09:07:19 2013 New Revision: 245324 URL: http://svnweb.freebsd.org/changeset/base/245324 Log: editrc only read from $HOME. Submitted by: LEVAI Daniel (via jmc@OpenBSD) Modified: head/lib/libedit/editline.3 Modified: head/lib/libedit/editline.3 ============================================================================== --- head/lib/libedit/editline.3 Sat Jan 12 08:44:54 2013 (r245323) +++ head/lib/libedit/editline.3 Sat Jan 12 09:07:19 2013 (r245324) @@ -526,8 +526,6 @@ If is .Dv NULL , try -.Pa $PWD/.editrc -then .Pa $HOME/.editrc . Refer to .Xr editrc 5 From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 09:08:38 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B5DAA6D; Sat, 12 Jan 2013 09:08:38 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39BD5C2B; Sat, 12 Jan 2013 09:08:38 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0C98cPO064381; Sat, 12 Jan 2013 09:08:38 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0C98c4l064379; Sat, 12 Jan 2013 09:08:38 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201301120908.r0C98c4l064379@svn.freebsd.org> From: Joel Dahl Date: Sat, 12 Jan 2013 09:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245325 - head/lib/libedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 09:08:38 -0000 Author: joel (doc committer) Date: Sat Jan 12 09:08:37 2013 New Revision: 245325 URL: http://svnweb.freebsd.org/changeset/base/245325 Log: Add FILES section. Submitted by: jmc@OpenBSD Modified: head/lib/libedit/editrc.5 Modified: head/lib/libedit/editrc.5 ============================================================================== --- head/lib/libedit/editrc.5 Sat Jan 12 09:07:19 2013 (r245324) +++ head/lib/libedit/editrc.5 Sat Jan 12 09:08:37 2013 (r245325) @@ -473,6 +473,13 @@ Move down one line. Editline extended command. .El .\" End of section automatically generated with makelist +.Sh FILES +.Bl -tag -width "~/.editrcXXX" +.It Pa ~/.editrc +User configuration file for the +.Xr editline 3 +library. +.El .Sh SEE ALSO .Xr editline 3 , .Xr regex 3 , From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 09:35:46 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B147E52; Sat, 12 Jan 2013 09:35:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F0649D58; Sat, 12 Jan 2013 09:35:45 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0C9Zjff072347; Sat, 12 Jan 2013 09:35:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0C9ZjuO072344; Sat, 12 Jan 2013 09:35:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301120935.r0C9ZjuO072344@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jan 2013 09:35:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245326 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 09:35:46 -0000 Author: mav Date: Sat Jan 12 09:35:44 2013 New Revision: 245326 URL: http://svnweb.freebsd.org/changeset/base/245326 Log: Add basic support for Intel Rapid Recover Technology (Intel RRT). It is alike to RAID1, but with dedicating master and recovery disks and providing manual control over synchronization. It allows to use recovery disk as snapshot of the master disk from the time of the last sync. This implementation is not functionaly complete comparing to Windows, but it is better then silent conversion to RAID1 on first boot. Modified: head/sys/geom/raid/g_raid.c head/sys/geom/raid/g_raid.h head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Sat Jan 12 09:08:37 2013 (r245325) +++ head/sys/geom/raid/g_raid.c Sat Jan 12 09:35:44 2013 (r245326) @@ -163,6 +163,8 @@ g_raid_disk_state2str(int state) return ("NONE"); case G_RAID_DISK_S_OFFLINE: return ("OFFLINE"); + case G_RAID_DISK_S_DISABLED: + return ("DISABLED"); case G_RAID_DISK_S_FAILED: return ("FAILED"); case G_RAID_DISK_S_STALE_FAILED: @@ -535,7 +537,9 @@ g_raid_report_disk_state(struct g_raid_d if (disk->d_consumer == NULL) return; - if (disk->d_state == G_RAID_DISK_S_FAILED || + if (disk->d_state == G_RAID_DISK_S_DISABLED) { + ; + } else if (disk->d_state == G_RAID_DISK_S_FAILED || disk->d_state == G_RAID_DISK_S_STALE_FAILED) { s = G_STATE_FAILED; } else { Modified: head/sys/geom/raid/g_raid.h ============================================================================== --- head/sys/geom/raid/g_raid.h Sat Jan 12 09:08:37 2013 (r245325) +++ head/sys/geom/raid/g_raid.h Sat Jan 12 09:35:44 2013 (r245326) @@ -140,11 +140,12 @@ struct g_raid_event { }; #define G_RAID_DISK_S_NONE 0x00 /* State is unknown. */ #define G_RAID_DISK_S_OFFLINE 0x01 /* Missing disk placeholder. */ -#define G_RAID_DISK_S_FAILED 0x02 /* Failed. */ -#define G_RAID_DISK_S_STALE_FAILED 0x03 /* Old failed. */ -#define G_RAID_DISK_S_SPARE 0x04 /* Hot-spare. */ -#define G_RAID_DISK_S_STALE 0x05 /* Old disk, unused now. */ -#define G_RAID_DISK_S_ACTIVE 0x06 /* Operational. */ +#define G_RAID_DISK_S_DISABLED 0x02 /* Disabled. */ +#define G_RAID_DISK_S_FAILED 0x03 /* Failed. */ +#define G_RAID_DISK_S_STALE_FAILED 0x04 /* Old failed. */ +#define G_RAID_DISK_S_SPARE 0x05 /* Hot-spare. */ +#define G_RAID_DISK_S_STALE 0x06 /* Old disk, unused now. */ +#define G_RAID_DISK_S_ACTIVE 0x07 /* Operational. */ #define G_RAID_DISK_E_DISCONNECTED 0x01 Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Sat Jan 12 09:08:37 2013 (r245325) +++ head/sys/geom/raid/md_intel.c Sat Jan 12 09:35:44 2013 (r245326) @@ -98,6 +98,8 @@ struct intel_raid_vol { uint8_t cng_master_disk; uint16_t cache_policy; uint8_t cng_state; +#define INTEL_SNGST_NEEDS_UPDATE 1 +#define INTEL_SNGST_MASTER_MISSING 2 uint8_t cng_sub_state; uint32_t filler_0[10]; @@ -130,6 +132,7 @@ struct intel_raid_disk { #define INTEL_F_ASSIGNED 0x02 #define INTEL_F_FAILED 0x04 #define INTEL_F_ONLINE 0x08 +#define INTEL_F_DISABLED 0x80 uint32_t owner_cfg_num; uint32_t sectors_hi; uint32_t filler[3]; @@ -187,6 +190,13 @@ struct g_raid_md_intel_perdisk { struct intel_raid_disk pd_disk_meta; }; +struct g_raid_md_intel_pervolume { + int pv_volume_pos; + int pv_cng; + int pv_cng_man_sync; + int pv_cng_master_disk; +}; + struct g_raid_md_intel_object { struct g_raid_md_object mdio_base; uint32_t mdio_config_id; @@ -206,6 +216,7 @@ static g_raid_md_ctl_t g_raid_md_ctl_int static g_raid_md_write_t g_raid_md_write_intel; static g_raid_md_fail_disk_t g_raid_md_fail_disk_intel; static g_raid_md_free_disk_t g_raid_md_free_disk_intel; +static g_raid_md_free_volume_t g_raid_md_free_volume_intel; static g_raid_md_free_t g_raid_md_free_intel; static kobj_method_t g_raid_md_intel_methods[] = { @@ -216,6 +227,7 @@ static kobj_method_t g_raid_md_intel_met KOBJMETHOD(g_raid_md_write, g_raid_md_write_intel), KOBJMETHOD(g_raid_md_fail_disk, g_raid_md_fail_disk_intel), KOBJMETHOD(g_raid_md_free_disk, g_raid_md_free_disk_intel), + KOBJMETHOD(g_raid_md_free_volume, g_raid_md_free_volume_intel), KOBJMETHOD(g_raid_md_free, g_raid_md_free_intel), { 0, 0 } }; @@ -369,8 +381,15 @@ g_raid_md_intel_print(struct intel_raid_ printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state %u\n", mvol->state); + printf(" state 0x%08x\n", mvol->state); printf(" reserved %u\n", mvol->reserved); + printf(" migr_priority %u\n", mvol->migr_priority); + printf(" num_sub_vols %u\n", mvol->num_sub_vols); + printf(" tid %u\n", mvol->tid); + printf(" cng_master_disk %u\n", mvol->cng_master_disk); + printf(" cache_policy %u\n", mvol->cache_policy); + printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); @@ -699,9 +718,11 @@ static struct g_raid_volume * g_raid_md_intel_get_volume(struct g_raid_softc *sc, int id) { struct g_raid_volume *mvol; + struct g_raid_md_intel_pervolume *pv; TAILQ_FOREACH(mvol, &sc->sc_volumes, v_next) { - if ((intptr_t)(mvol->v_md_data) == id) + pv = mvol->v_md_data; + if (pv->pv_volume_pos == id) break; } return (mvol); @@ -715,6 +736,7 @@ g_raid_md_intel_start_disk(struct g_raid struct g_raid_disk *olddisk, *tmpdisk; struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd, *oldpd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -732,6 +754,11 @@ g_raid_md_intel_start_disk(struct g_raid disk_pos = intel_meta_find_disk(meta, pd->pd_disk_meta.serial); if (disk_pos < 0) { G_RAID_DEBUG1(1, sc, "Unknown, probably new or stale disk"); + /* Disabled disk is useless for us. */ + if (pd->pd_disk_meta.flags & INTEL_F_DISABLED) { + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); + return (0); + } /* Failed stale disk is useless for us. */ if (pd->pd_disk_meta.flags & INTEL_F_FAILED) { g_raid_change_disk_state(disk, G_RAID_DISK_S_STALE_FAILED); @@ -826,6 +853,8 @@ nofit: /* Welcome the new disk. */ if (resurrection) g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); + else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) + g_raid_change_disk_state(disk, G_RAID_DISK_S_DISABLED); else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) g_raid_change_disk_state(disk, G_RAID_DISK_S_FAILED); else if (meta->disk[disk_pos].flags & INTEL_F_SPARE) @@ -833,8 +862,8 @@ nofit: else g_raid_change_disk_state(disk, G_RAID_DISK_S_ACTIVE); TAILQ_FOREACH(sd, &disk->d_subdisks, sd_next) { - mvol = intel_get_volume(meta, - (uintptr_t)(sd->sd_volume->v_md_data)); + pv = sd->sd_volume->v_md_data; + mvol = intel_get_volume(meta, pv->pv_volume_pos); mmap0 = intel_get_map(mvol, 0); if (mvol->migr_state) mmap1 = intel_get_map(mvol, 1); @@ -845,12 +874,17 @@ nofit: /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); + } else if (meta->disk[disk_pos].flags & INTEL_F_DISABLED) { + /* Disabled disk, useless. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NONE); } else if (meta->disk[disk_pos].flags & INTEL_F_FAILED) { /* Failed disk, almost useless. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_FAILED); } else if (mvol->migr_state == 0) { - if (mmap0->status == INTEL_S_UNINITIALIZED) { + if (mmap0->status == INTEL_S_UNINITIALIZED && + (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Freshly created uninitialized volume. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_UNINITIALIZED); @@ -858,7 +892,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -885,7 +920,8 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } - } else if (mvol->dirty) { + } else if (mvol->dirty && (!pv->pv_cng || + pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_STALE); @@ -1014,6 +1050,7 @@ g_raid_md_intel_start(struct g_raid_soft { struct g_raid_md_object *md; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -1032,7 +1069,13 @@ g_raid_md_intel_start(struct g_raid_soft mvol = intel_get_volume(meta, i); mmap = intel_get_map(mvol, 0); vol = g_raid_create_volume(sc, mvol->name, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + pv->pv_cng = (mvol->state & INTEL_ST_CLONE_N_GO) != 0; + pv->pv_cng_man_sync = (mvol->state & INTEL_ST_CLONE_MAN_SYNC) != 0; + if (mvol->cng_master_disk < mmap->total_disks) + pv->pv_cng_master_disk = mvol->cng_master_disk; + vol->v_md_data = pv; vol->v_raid_level_qualifier = G_RAID_VOLUME_RLQ_NONE; if (mmap->type == INTEL_T_RAID0) vol->v_raid_level = G_RAID_VOLUME_RL_RAID0; @@ -1450,6 +1493,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct g_consumer *cp; struct g_provider *pp; @@ -1621,7 +1665,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ mdi->mdio_started = 1; vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)0; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = 0; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -1814,7 +1860,9 @@ g_raid_md_ctl_intel(struct g_raid_md_obj /* We have all we need, create things: volume, ... */ vol = g_raid_create_volume(sc, volname, -1); - vol->v_md_data = (void *)(intptr_t)i; + pv = malloc(sizeof(*pv), M_MD_INTEL, M_WAITOK | M_ZERO); + pv->pv_volume_pos = i; + vol->v_md_data = pv; vol->v_raid_level = level; vol->v_raid_level_qualifier = qual; vol->v_strip_size = strip; @@ -2105,6 +2153,7 @@ g_raid_md_write_intel(struct g_raid_md_o struct g_raid_subdisk *sd; struct g_raid_disk *disk; struct g_raid_md_intel_object *mdi; + struct g_raid_md_intel_pervolume *pv; struct g_raid_md_intel_perdisk *pd; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; @@ -2133,7 +2182,11 @@ g_raid_md_write_intel(struct g_raid_md_o pd->pd_disk_meta.flags = INTEL_F_ONLINE | INTEL_F_ASSIGNED; } else if (disk->d_state == G_RAID_DISK_S_FAILED) { - pd->pd_disk_meta.flags = INTEL_F_FAILED | INTEL_F_ASSIGNED; + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED; + } else if (disk->d_state == G_RAID_DISK_S_DISABLED) { + pd->pd_disk_meta.flags = INTEL_F_FAILED | + INTEL_F_ASSIGNED | INTEL_F_DISABLED; } else { pd->pd_disk_meta.flags = INTEL_F_ASSIGNED; if (pd->pd_disk_meta.id != 0xffffffff) { @@ -2165,12 +2218,13 @@ g_raid_md_write_intel(struct g_raid_md_o vi = 0; version = INTEL_VERSION_1000; TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { + pv = vol->v_md_data; if (vol->v_stopping) continue; mvol = intel_get_volume(meta, vi); /* New metadata may have different volumes order. */ - vol->v_md_data = (void *)(intptr_t)vi; + pv->pv_volume_pos = vi; for (sdi = 0; sdi < vol->v_disks_count; sdi++) { sd = &vol->v_subdisks[sdi]; @@ -2192,8 +2246,8 @@ g_raid_md_write_intel(struct g_raid_md_o if (meta->attributes & INTEL_ATTR_2TB) cv = INTEL_VERSION_1300; -// else if (dev->status == DEV_CLONE_N_GO) -// cv = INTEL_VERSION_1206; + else if (pv->pv_cng) + cv = INTEL_VERSION_1206; else if (vol->v_disks_count > 4) cv = INTEL_VERSION_1204; else if (vol->v_raid_level == G_RAID_VOLUME_RL_RAID5) @@ -2211,6 +2265,17 @@ g_raid_md_write_intel(struct g_raid_md_o strlcpy(&mvol->name[0], vol->v_name, sizeof(mvol->name)); mvol->total_sectors = vol->v_mediasize / sectorsize; + if (pv->pv_cng) { + mvol->state |= INTEL_ST_CLONE_N_GO; + if (pv->pv_cng_man_sync) + mvol->state |= INTEL_ST_CLONE_MAN_SYNC; + mvol->cng_master_disk = pv->pv_cng_master_disk; + if (vol->v_subdisks[pv->pv_cng_master_disk].sd_state == + G_RAID_SUBDISK_S_NONE) + mvol->cng_state = INTEL_SNGST_MASTER_MISSING; + else if (vol->v_state != G_RAID_VOLUME_S_OPTIMAL) + mvol->cng_state = INTEL_SNGST_NEEDS_UPDATE; + } /* Check for any recovery in progress. */ state = G_RAID_SUBDISK_S_ACTIVE; @@ -2403,6 +2468,18 @@ g_raid_md_free_disk_intel(struct g_raid_ } static int +g_raid_md_free_volume_intel(struct g_raid_md_object *md, + struct g_raid_volume *vol) +{ + struct g_raid_md_intel_pervolume *pv; + + pv = (struct g_raid_md_intel_pervolume *)vol->v_md_data; + free(pv, M_MD_INTEL); + vol->v_md_data = NULL; + return (0); +} + +static int g_raid_md_free_intel(struct g_raid_md_object *md) { struct g_raid_md_intel_object *mdi; From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 10:07:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 28BF83FD; Sat, 12 Jan 2013 10:07:00 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 033A0E14; Sat, 12 Jan 2013 10:07:00 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CA6xlQ081247; Sat, 12 Jan 2013 10:06:59 GMT (envelope-from theraven@svn.freebsd.org) Received: (from theraven@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CA6xb7081245; Sat, 12 Jan 2013 10:06:59 GMT (envelope-from theraven@svn.freebsd.org) Message-Id: <201301121006.r0CA6xb7081245@svn.freebsd.org> From: David Chisnall Date: Sat, 12 Jan 2013 10:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245327 - head/contrib/libcxxrt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 10:07:00 -0000 Author: theraven Date: Sat Jan 12 10:06:59 2013 New Revision: 245327 URL: http://svnweb.freebsd.org/changeset/base/245327 Log: Fix libcxxrt / libc++ build with the clang in head. Pointy hat to: theraven Modified: head/contrib/libcxxrt/atomic.h Modified: head/contrib/libcxxrt/atomic.h ============================================================================== --- head/contrib/libcxxrt/atomic.h Sat Jan 12 09:35:44 2013 (r245326) +++ head/contrib/libcxxrt/atomic.h Sat Jan 12 10:06:59 2013 (r245327) @@ -11,7 +11,7 @@ */ #if __has_feature(cxx_atomic) #define ATOMIC_SWAP(addr, val)\ - __atomic_exchange(addr, val, __ATOMIC_ACQ_REL) + __c11_atomic_exchange((_Atomic(__typeof__(val))*)addr, val, __ATOMIC_ACQ_REL) #elif __has_builtin(__sync_swap) #define ATOMIC_SWAP(addr, val)\ __sync_swap(addr, val) @@ -22,7 +22,7 @@ #if __has_feature(cxx_atomic) #define ATOMIC_LOAD(addr)\ - __atomic_load(addr, __ATOMIC_ACQUIRE) + __c11_atomic_load((_Atomic(__typeof__(*addr))*)addr, __ATOMIC_ACQUIRE) #else #define ATOMIC_LOAD(addr)\ (__sync_synchronize(), *addr) From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 10:49:36 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D906FBA6; Sat, 12 Jan 2013 10:49:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 516E6FB2; Sat, 12 Jan 2013 10:49:36 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r0CAnStt065890; Sat, 12 Jan 2013 12:49:28 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r0CAnStt065890 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r0CAnSMi065889; Sat, 12 Jan 2013 12:49:28 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 12 Jan 2013 12:49:28 +0200 From: Konstantin Belousov To: Joel Dahl Subject: Re: svn commit: r245323 - in head: share/man/man4 usr.sbin/bsdinstall/partedit Message-ID: <20130112104928.GL2561@kib.kiev.ua> References: <201301120844.r0C8isTa057855@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k1whYXOlSGJlk+LY" Content-Disposition: inline In-Reply-To: <201301120844.r0C8isTa057855@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 10:49:36 -0000 --k1whYXOlSGJlk+LY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jan 12, 2013 at 08:44:54AM +0000, Joel Dahl wrote: > Author: joel (doc committer) > Date: Sat Jan 12 08:44:54 2013 > New Revision: 245323 > URL: http://svnweb.freebsd.org/changeset/base/245323 >=20 > Log: > Remove EOL whitespace. >=20 > Modified: > head/share/man/man4/stf.4 > head/usr.sbin/bsdinstall/partedit/sade.8 >=20 > Modified: head/share/man/man4/stf.4 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=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/share/man/man4/stf.4 Sat Jan 12 04:36:40 2013 (r245322) > +++ head/share/man/man4/stf.4 Sat Jan 12 08:44:54 2013 (r245323) > @@ -190,8 +190,8 @@ The default value is shown next to each=20 > .It Va net.link.stf.permit_rfc1918 : No 0 > The RFC3056 requires the use of globally unique 32-bit IPv4 > addresses. This sysctl variable controls the behaviour of this > -requirement. When it set to not 0,=20 > -.Nm stf=20 > +requirement. When it set to not 0, > +.Nm stf > allows the use of private IPv4 addresses described in the RFC1918. > This may be useful for an Intranet environment or when some mechanisms > of network address translation (NAT) are used. >=20 > Modified: head/usr.sbin/bsdinstall/partedit/sade.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=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/bsdinstall/partedit/sade.8 Sat Jan 12 04:36:40 2013 (r2= 45322) > +++ head/usr.sbin/bsdinstall/partedit/sade.8 Sat Jan 12 08:44:54 2013 (r2= 45323) > @@ -56,7 +56,7 @@ in the post-installation environment. > A program called > .Nm > first appeared in > -.Fx 6.3=20 > +.Fx 6.3 > as a utility encapsulating features from the > .Xr sysinstall 8 > installer. It was replaced in It seems that both fragments neglect to change new sentences from the new lines. --k1whYXOlSGJlk+LY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQ8T+3AAoJEJDCuSvBvK1BPccP/i2Wu7yds3Ed2ONTFxwdcDys o3V3BqoirIcQOLrdPgaKAc7ACDpC7QZIXAsr+cGEMx0oTtJHyizVZMbcqb/1Lost KkAWKma8la5cWT4qmBgRgPOl+dZaCcYotK1ITpzNfe6D0cgt0g8VozwqfkCc2BUn ab/VsF4o93dU7dAPoxZ5BX/Xt6rCSptUiwq+3kCo0GnGOjcW+dlqNwiG611d6YFh aTDeXiXY9u19K6MQK7v5GXQgCLCG3as0bVUi7eF7jRIRLf1p3Cab/jCUFE2ldiQ/ V7XBwCy19w4FhtgEcTRAiBJGGNcnHPQTcGR4wOcW5c5jdk0w4oIn0nu8FPicXc7n rOSpEMKSDhzCC0LuXaRHHCD8ws2lowOt98TTSAI7cWsfqIEzLZf/jqwITc02Eadz TRj3sC31k6zSuAOJZbnKZ8ZhFlttOqjCjpwfwUIr/sW+LysYhLNDeGVtpy/TSYvH PXtQE+LsquMEqLexO8QY0GIvKDA+Ocr3i7tui/aru1mtDiqXQNdXIL/gVb9frXE+ ZvtQhEopykl6m2RHDHhAHFYqJOPsUPJL+U2+glK8oz73AY51TmgHOTDNpts9MOtQ mT92/1iGF/b6PtplEqMAMC8Jv5FqHuqv/alP6oABmV9jWS6PWOwPig+Bl2cnnfgW IGCtV+TzpS9mdaE5NKvp =YfaE -----END PGP SIGNATURE----- --k1whYXOlSGJlk+LY-- From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 11:36:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 31243397; Sat, 12 Jan 2013 11:36:24 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A6D81E0; Sat, 12 Jan 2013 11:36:24 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CBaNd8006433; Sat, 12 Jan 2013 11:36:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CBaNid006432; Sat, 12 Jan 2013 11:36:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301121136.r0CBaNid006432@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jan 2013 11:36:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245328 - head/sys/dev/usb/storage X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 11:36:24 -0000 Author: mav Date: Sat Jan 12 11:36:23 2013 New Revision: 245328 URL: http://svnweb.freebsd.org/changeset/base/245328 Log: Freeze device queue before returning errors to CAM. This is required for proper error recovery, including keeping original request order. Reviewed by: hselasky Modified: head/sys/dev/usb/storage/umass.c Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Sat Jan 12 10:06:59 2013 (r245327) +++ head/sys/dev/usb/storage/umass.c Sat Jan 12 11:36:23 2013 (r245328) @@ -2251,8 +2251,11 @@ umass_cam_action(struct cam_sim *sim, un /*ascq*/ 0x00, /*extra args*/ SSD_ELEM_NONE); ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; - ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | - CAM_AUTOSNS_VALID; + ccb->ccb_h.status = + CAM_SCSI_STATUS_ERROR | + CAM_AUTOSNS_VALID | + CAM_DEV_QFRZN; + xpt_freeze_devq(ccb->ccb_h.path, 1); xpt_done(ccb); goto done; } @@ -2512,7 +2515,8 @@ umass_cam_cb(struct umass_softc *sc, uni * recovered. We return an error to CAM and let CAM * retry the command if necessary. */ - ccb->ccb_h.status = CAM_REQ_CMP_ERR; + xpt_freeze_devq(ccb->ccb_h.path, 1); + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; xpt_done(ccb); break; } @@ -2575,8 +2579,9 @@ umass_cam_sense_cb(struct umass_softc *s * usual. */ + xpt_freeze_devq(ccb->ccb_h.path, 1); ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR - | CAM_AUTOSNS_VALID; + | CAM_AUTOSNS_VALID | CAM_DEV_QFRZN; ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; #if 0 @@ -2587,17 +2592,18 @@ umass_cam_sense_cb(struct umass_softc *s /* the rest of the command was filled in at attach */ - if (umass_std_transform(sc, ccb, + if ((sc->sc_transform)(sc, &sc->cam_scsi_test_unit_ready.opcode, - sizeof(sc->cam_scsi_test_unit_ready))) { + sizeof(sc->cam_scsi_test_unit_ready)) == 1) { umass_command_start(sc, DIR_NONE, NULL, 0, ccb->ccb_h.timeout, &umass_cam_quirk_cb, ccb); + break; } - break; } else { + xpt_freeze_devq(ccb->ccb_h.path, 1); ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR - | CAM_AUTOSNS_VALID; + | CAM_AUTOSNS_VALID | CAM_DEV_QFRZN; ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; } xpt_done(ccb); @@ -2606,15 +2612,16 @@ umass_cam_sense_cb(struct umass_softc *s default: DPRINTF(sc, UDMASS_SCSI, "Autosense failed, " "status %d\n", status); - ccb->ccb_h.status = CAM_AUTOSENSE_FAIL; + xpt_freeze_devq(ccb->ccb_h.path, 1); + ccb->ccb_h.status = CAM_AUTOSENSE_FAIL | CAM_DEV_QFRZN; xpt_done(ccb); } } /* * This completion code just handles the fact that we sent a test-unit-ready - * after having previously failed a READ CAPACITY with CHECK_COND. Even - * though this command succeeded, we have to tell CAM to retry. + * after having previously failed a READ CAPACITY with CHECK_COND. The CCB + * status for CAM is already set earlier. */ static void umass_cam_quirk_cb(struct umass_softc *sc, union ccb *ccb, uint32_t residue, @@ -2623,9 +2630,6 @@ umass_cam_quirk_cb(struct umass_softc *s DPRINTF(sc, UDMASS_SCSI, "Test unit ready " "returned status %d\n", status); - ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR - | CAM_AUTOSNS_VALID; - ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND; xpt_done(ccb); } @@ -2914,7 +2918,8 @@ umass_std_transform(struct umass_softc * xpt_done(ccb); return (0); } else if (retval == 0) { - ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_freeze_devq(ccb->ccb_h.path, 1); + ccb->ccb_h.status = CAM_REQ_INVALID | CAM_DEV_QFRZN; xpt_done(ccb); return (0); } From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 12:35:00 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 404DE46F; Sat, 12 Jan 2013 12:35:00 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 32E8F6D1; Sat, 12 Jan 2013 12:35:00 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CCZ0Pu023726; Sat, 12 Jan 2013 12:35:00 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CCZ0dI023716; Sat, 12 Jan 2013 12:35:00 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301121235.r0CCZ0dI023716@svn.freebsd.org> From: Robert Watson Date: Sat, 12 Jan 2013 12:35:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245329 - head/sys/mips/beri X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 12:35:00 -0000 Author: rwatson Date: Sat Jan 12 12:34:59 2013 New Revision: 245329 URL: http://svnweb.freebsd.org/changeset/base/245329 Log: Merge Perforce change @219935 to head: Initialise Openfirmware/FDT code earlier in the FreeBSD/beri boot, so that the results will be available for configuring the console UART (eventually). Suggested by: thompsa Sponsored by: DARPA, AFRL Modified: head/sys/mips/beri/beri_machdep.c Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Sat Jan 12 11:36:23 2013 (r245328) +++ head/sys/mips/beri/beri_machdep.c Sat Jan 12 12:34:59 2013 (r245329) @@ -87,17 +87,6 @@ mips_init(void) { int i; -#ifdef FDT -#ifndef FDT_DTB_STATIC -#error "mips_init with FDT requires FDT_DTB_STATIC" -#endif - - if (OF_install(OFW_FDT, 0) == FALSE) - while (1); - if (OF_init(&fdt_static_dtb) != 0) - while (1); -#endif - for (i = 0; i < 10; i++) { phys_avail[i] = 0; } @@ -156,6 +145,17 @@ platform_start(__register_t a0, __regist mips_pcpu0_init(); +#ifdef FDT +#ifndef FDT_DTB_STATIC +#error "mips_init with FDT requires FDT_DTB_STATIC" +#endif + + if (OF_install(OFW_FDT, 0) == FALSE) + while (1); + if (OF_init(&fdt_static_dtb) != 0) + while (1); +#endif + /* * XXXRW: We have no way to compare wallclock time to cycle rate on * BERI, so for now assume we run at the MALTA default (100MHz). From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 13:20:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EA7E7E2F; Sat, 12 Jan 2013 13:20:22 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C3AF98A6; Sat, 12 Jan 2013 13:20:22 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CDKM8c035630; Sat, 12 Jan 2013 13:20:22 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CDKMtj035628; Sat, 12 Jan 2013 13:20:22 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301121320.r0CDKMtj035628@svn.freebsd.org> From: Robert Watson Date: Sat, 12 Jan 2013 13:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245330 - in head/sys/mips: beri include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 13:20:23 -0000 Author: rwatson Date: Sat Jan 12 13:20:21 2013 New Revision: 245330 URL: http://svnweb.freebsd.org/changeset/base/245330 Log: Merge Perforce change @219948 to head: Add code so that the BERI boot process can ask the kernel linker for DTB blobs that may have been left for it by the boot loader, as done on PowerPC and ARM. This will require both a more mature boot loader, and more mature boot loader argument passing mechanism, than currently supported on BERI. Sponsored by: DARPA, AFRL Modified: head/sys/mips/beri/beri_machdep.c head/sys/mips/include/metadata.h Modified: head/sys/mips/beri/beri_machdep.c ============================================================================== --- head/sys/mips/beri/beri_machdep.c Sat Jan 12 12:34:59 2013 (r245329) +++ head/sys/mips/beri/beri_machdep.c Sat Jan 12 13:20:21 2013 (r245330) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -135,6 +137,10 @@ platform_start(__register_t a0, __regist char **argv = (char **)a1; char **envp = (char **)a2; unsigned int memsize = a3; +#ifdef FDT + vm_offset_t dtbp; + void *kmdp; +#endif int i; /* clear the BSS and SBSS segments */ @@ -146,8 +152,24 @@ platform_start(__register_t a0, __regist mips_pcpu0_init(); #ifdef FDT -#ifndef FDT_DTB_STATIC -#error "mips_init with FDT requires FDT_DTB_STATIC" + /* + * Find the dtb passed in by the boot loader (currently fictional). + */ + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + else + dtbp = (vm_offset_t)NULL; + +#if defined(FDT_DTB_STATIC) + /* + * In case the device tree blob was not retrieved (from metadata) try + * to use the statically embedded one. + */ + if (dtbp == (vm_offset_t)NULL) + dtbp = (vm_offset_t)&fdt_static_dtb; +#else +#error "Non-static FDT not yet supported on BERI" #endif if (OF_install(OFW_FDT, 0) == FALSE) Modified: head/sys/mips/include/metadata.h ============================================================================== --- head/sys/mips/include/metadata.h Sat Jan 12 12:34:59 2013 (r245329) +++ head/sys/mips/include/metadata.h Sat Jan 12 13:20:21 2013 (r245330) @@ -30,5 +30,6 @@ #define _MACHINE_METADATA_H_ #define MODINFOMD_SMAP 0x1001 +#define MODINFOMD_DTBP 0x1002 #endif /* !_MACHINE_METADATA_H_ */ From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 15:46:19 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FA04793; Sat, 12 Jan 2013 15:46:19 +0000 (UTC) (envelope-from c.jayachandran@gmail.com) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx1.freebsd.org (Postfix) with ESMTP id 75BFDDA6; Sat, 12 Jan 2013 15:46:18 +0000 (UTC) Received: by mail-vb0-f44.google.com with SMTP id fc26so2408782vbb.3 for ; Sat, 12 Jan 2013 07:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Pj8ZY3ItucNaRAMJupGR5goRmdUhOduJNe59AkPRk8o=; b=fKjbGY/jrqq+wG20HeXsn2/tqbFi0/P9ly7PufQJXEpnJj7QenMaKi+i6FVM3fuBFJ F+qgvy7UYyqbsOYB2t+t/Hvjd0+3hGa+VEcUxoDCdqUNsed75eSnHnf3aZ3saeSKfnU7 WeeH+pEf76xTopQUMu69cjJTb9WLSMY8K2Klcwm91VAiWUm1Fw6i2Mg24+Uk3QUd3rY5 JO7iX2lp+bYM4s2ptOpNPjebyOL/vdgzl8Jvg5eKfxqcXYM9oSvy3+Gsab229kxMuOIX HueVgOK68L6I/GDd6JK5HYE3FS6SkUShbUrQ3nf+JYzt1vlx2Dhp/fUVDajvHG7itduC wdqA== MIME-Version: 1.0 Received: by 10.58.134.1 with SMTP id pg1mr12500837veb.55.1358005571269; Sat, 12 Jan 2013 07:46:11 -0800 (PST) Sender: c.jayachandran@gmail.com Received: by 10.58.161.135 with HTTP; Sat, 12 Jan 2013 07:46:11 -0800 (PST) In-Reply-To: <50F04FE5.7010406@rice.edu> References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> Date: Sat, 12 Jan 2013 21:16:11 +0530 X-Google-Sender-Auth: -90-T37_sXYJ9SPC83k1J1m5GwY Message-ID: Subject: Re: svn commit: r243631 - in head/sys: kern sys From: "Jayachandran C." To: Alan Cox Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann , Oleksandr Tymoshenko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 15:46:19 -0000 On Fri, Jan 11, 2013 at 11:16 PM, Alan Cox wrote: > On 01/11/2013 05:38, Jayachandran C. wrote: [...] >> I see an issue with commit on MIPS XLP platform as well. >> >> With 16 GB physical memory, the ncallout is calculated to be 538881 >> (since it is based on maxfiles - which is now based on the physical >> memory). Due to this, the callwheel allocation per cpu is 16MB >> (callwheelsize is 1MB). And on a 32 CPU machine, the total allocation >> for callouts comes to 32*16MB = 512MB. >> >> I have worked around this issue for now by increasing VM_KMEM_SIZE_MAX >> (which is 200MB now) - but I think a better fix is needed for this. >> > > MIPS should use a definition for VM_KMEM_SIZE_MAX that scales with the > kernel address space size, like amd64, i386, and sparc64, and not a > fixed number. I think that the following should work for both 32- and > 64-bit processors: > > Index: mips/include/vmparam.h > =================================================================== > --- mips/include/vmparam.h (revision 245229) > +++ mips/include/vmparam.h (working copy) > @@ -130,10 +130,11 @@ > #endif > > /* > - * Ceiling on amount of kmem_map kva space. > + * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA > space. > */ > #ifndef VM_KMEM_SIZE_MAX > -#define VM_KMEM_SIZE_MAX (200 * 1024 * 1024) > +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ > + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) > #endif > > /* initial pagein size of beginning of executable file */ This fix is needed, can you please check it in? I have tested it for 32 and 64 bit. But the second part of the problem - allocating 512MB out of 16GB at boot-time for callouts - might need a fix as well. Thanks, JC. From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 15:53:45 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B0E0FB1D; Sat, 12 Jan 2013 15:53:45 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 94AB6DF3; Sat, 12 Jan 2013 15:53:45 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CFrjgK080519; Sat, 12 Jan 2013 15:53:45 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CFrjRU080518; Sat, 12 Jan 2013 15:53:45 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301121553.r0CFrjRU080518@svn.freebsd.org> From: Robert Watson Date: Sat, 12 Jan 2013 15:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245331 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 15:53:45 -0000 Author: rwatson Date: Sat Jan 12 15:53:45 2013 New Revision: 245331 URL: http://svnweb.freebsd.org/changeset/base/245331 Log: Merge Perforce chance 219924 to head: In a sign of weakness, replicate the MIPS bus_space_generic.c to produce a new FDT version, which will perform necessary address space translation for bus_space -- the solution used in NLM's MIPS FDT support, but possibly not quite the right thing. This is inconsistent with regular I/O via the nexus and the generic bus_space, which instead perform translation via pmap_mapdev() when a resource is activated. However, it will work while I attempt to identify what the right way to reconcile possible approaches. (Another approach might be to make simplebus use Nexus's activate routine instead of a generic one?) Sponsored by: DARPA, AFRL Added: head/sys/mips/mips/bus_space_fdt.c - copied unchanged from r245330, head/sys/mips/mips/bus_space_generic.c Copied: head/sys/mips/mips/bus_space_fdt.c (from r245330, head/sys/mips/mips/bus_space_generic.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/mips/mips/bus_space_fdt.c Sat Jan 12 15:53:45 2013 (r245331, copy of r245330, head/sys/mips/mips/bus_space_generic.c) @@ -0,0 +1,681 @@ +/* $NetBSD: bus.h,v 1.12 1997/10/01 08:25:15 fvdl Exp $ */ +/*- + * $Id: bus.h,v 1.6 2007/08/09 11:23:32 katta Exp $ + * + * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility, + * NASA Ames Research Center. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the NetBSD + * Foundation, Inc. and its contributors. + * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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. + */ + +/* + * Copyright (c) 1996 Charles M. Hannum. All rights reserved. + * Copyright (c) 1996 Christopher G. Demetriou. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by Christopher G. Demetriou + * for the NetBSD Project. + * 4. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * from: src/sys/alpha/include/bus.h,v 1.5 1999/08/28 00:38:40 peter + * $FreeBSD$ + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +static struct bus_space generic_space = { + /* cookie */ + (void *) 0, + + /* mapping/unmapping */ + generic_bs_map, + generic_bs_unmap, + generic_bs_subregion, + + /* allocation/deallocation */ + generic_bs_alloc, + generic_bs_free, + + /* barrier */ + generic_bs_barrier, + + /* read (single) */ + generic_bs_r_1, + generic_bs_r_2, + generic_bs_r_4, + generic_bs_r_8, + + /* read multiple */ + generic_bs_rm_1, + generic_bs_rm_2, + generic_bs_rm_4, + generic_bs_rm_8, + + /* read region */ + generic_bs_rr_1, + generic_bs_rr_2, + generic_bs_rr_4, + generic_bs_rr_8, + + /* write (single) */ + generic_bs_w_1, + generic_bs_w_2, + generic_bs_w_4, + generic_bs_w_8, + + /* write multiple */ + generic_bs_wm_1, + generic_bs_wm_2, + generic_bs_wm_4, + generic_bs_wm_8, + + /* write region */ + generic_bs_wr_1, + generic_bs_wr_2, + generic_bs_wr_4, + generic_bs_wr_8, + + /* set multiple */ + generic_bs_sm_1, + generic_bs_sm_2, + generic_bs_sm_4, + generic_bs_sm_8, + + /* set region */ + generic_bs_sr_1, + generic_bs_sr_2, + generic_bs_sr_4, + generic_bs_sr_8, + + /* copy */ + generic_bs_c_1, + generic_bs_c_2, + generic_bs_c_4, + generic_bs_c_8, + + /* read (single) stream */ + generic_bs_r_1, + generic_bs_r_2, + generic_bs_r_4, + generic_bs_r_8, + + /* read multiple stream */ + generic_bs_rm_1, + generic_bs_rm_2, + generic_bs_rm_4, + generic_bs_rm_8, + + /* read region stream */ + generic_bs_rr_1, + generic_bs_rr_2, + generic_bs_rr_4, + generic_bs_rr_8, + + /* write (single) stream */ + generic_bs_w_1, + generic_bs_w_2, + generic_bs_w_4, + generic_bs_w_8, + + /* write multiple stream */ + generic_bs_wm_1, + generic_bs_wm_2, + generic_bs_wm_4, + generic_bs_wm_8, + + /* write region stream */ + generic_bs_wr_1, + generic_bs_wr_2, + generic_bs_wr_4, + generic_bs_wr_8, +}; + +/* Ultra-gross kludge */ +#if defined(CPU_CNMIPS) && (defined(__mips_n32) || defined(__mips_o32)) +#include +#define rd8(a) cvmx_read64_uint8(a) +#define rd16(a) cvmx_read64_uint16(a) +#define rd32(a) cvmx_read64_uint32(a) +#define wr8(a, v) cvmx_write64_uint8(a, v) +#define wr16(a, v) cvmx_write64_uint16(a, v) +#define wr32(a, v) cvmx_write64_uint32(a, v) +#elif defined(CPU_SB1) && _BYTE_ORDER == _BIG_ENDIAN +#include +#define rd8(a) sb_big_endian_read8(a) +#define rd16(a) sb_big_endian_read16(a) +#define rd32(a) sb_big_endian_read32(a) +#define wr8(a, v) sb_big_endian_write8(a, v) +#define wr16(a, v) sb_big_endian_write16(a, v) +#define wr32(a, v) sb_big_endian_write32(a, v) +#else +#define rd8(a) readb(a) +#define rd16(a) readw(a) +#define rd32(a) readl(a) +#define wr8(a, v) writeb(a, v) +#define wr16(a, v) writew(a, v) +#define wr32(a, v) writel(a, v) +#endif + +/* generic bus_space tag */ +bus_space_tag_t mips_bus_space_generic = &generic_space; + +int +generic_bs_map(void *t __unused, bus_addr_t addr, + bus_size_t size __unused, int flags __unused, + bus_space_handle_t *bshp) +{ + + *bshp = addr; + return (0); +} + +void +generic_bs_unmap(void *t __unused, bus_space_handle_t bh __unused, + bus_size_t size __unused) +{ + + /* Do nothing */ +} + +int +generic_bs_subregion(void *t __unused, bus_space_handle_t handle, + bus_size_t offset, bus_size_t size __unused, + bus_space_handle_t *bshp) +{ + + *bshp = handle + offset; + return (0); +} + +int +generic_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, + bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, + bus_addr_t *bpap, bus_space_handle_t *bshp) +{ + + panic("%s: not implemented", __func__); +} + +void +generic_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) +{ + + panic("%s: not implemented", __func__); +} + +uint8_t +generic_bs_r_1(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + + return (rd8(handle + offset)); +} + +uint16_t +generic_bs_r_2(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + + return (rd16(handle + offset)); +} + +uint32_t +generic_bs_r_4(void *t, bus_space_handle_t handle, + bus_size_t offset) +{ + + return (rd32(handle + offset)); +} + +uint64_t +generic_bs_r_8(void *t, bus_space_handle_t handle, bus_size_t offset) +{ + + panic("%s: not implemented", __func__); +} + +void +generic_bs_rm_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t *addr, size_t count) +{ + + while (count--) + *addr++ = rd8(bsh + offset); +} + +void +generic_bs_rm_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + *addr++ = rd16(baddr); +} + +void +generic_bs_rm_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + *addr++ = rd32(baddr); +} + +void +generic_bs_rm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t *addr, size_t count) +{ + + panic("%s: not implemented", __func__); +} + +/* + * Read `count' 1, 2, 4, or 8 byte quantities from bus space + * described by tag/handle and starting at `offset' and copy into + * buffer provided. + */ +void +generic_bs_rr_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = rd8(baddr); + baddr += 1; + } +} + +void +generic_bs_rr_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = rd16(baddr); + baddr += 2; + } +} + +void +generic_bs_rr_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + *addr++ = rd32(baddr); + baddr += 4; + } +} + +void +generic_bs_rr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t *addr, size_t count) +{ + + panic("%s: not implemented", __func__); +} + +/* + * Write the 1, 2, 4, or 8 byte value `value' to bus space + * described by tag/handle/offset. + */ +void +generic_bs_w_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t value) +{ + + wr8(bsh + offset, value); +} + +void +generic_bs_w_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t value) +{ + + wr16(bsh + offset, value); +} + +void +generic_bs_w_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t value) +{ + + wr32(bsh + offset, value); +} + +void +generic_bs_w_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t value) +{ + + panic("%s: not implemented", __func__); +} + +/* + * Write `count' 1, 2, 4, or 8 byte quantities from the buffer + * provided to bus space described by tag/handle/offset. + */ +void +generic_bs_wm_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint8_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + wr8(baddr, *addr++); +} + +void +generic_bs_wm_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint16_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + wr16(baddr, *addr++); +} + +void +generic_bs_wm_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint32_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) + wr32(baddr, *addr++); +} + +void +generic_bs_wm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + const uint64_t *addr, size_t count) +{ + + panic("%s: not implemented", __func__); +} + +/* + * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided + * to bus space described by tag/handle starting at `offset'. + */ +void +generic_bs_wr_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint8_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + wr8(baddr, *addr++); + baddr += 1; + } +} + +void +generic_bs_wr_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint16_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + wr16(baddr, *addr++); + baddr += 2; + } +} + +void +generic_bs_wr_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, const uint32_t *addr, size_t count) +{ + bus_addr_t baddr = bsh + offset; + + while (count--) { + wr32(baddr, *addr++); + baddr += 4; + } +} + +void +generic_bs_wr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + const uint64_t *addr, size_t count) +{ + + panic("%s: not implemented", __func__); +} + +/* + * Write the 1, 2, 4, or 8 byte value `val' to bus space described + * by tag/handle/offset `count' times. + */ +void +generic_bs_sm_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + while (count--) + wr8(addr, value); +} + +void +generic_bs_sm_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + while (count--) + wr16(addr, value); +} + +void +generic_bs_sm_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + while (count--) + wr32(addr, value); +} + +void +generic_bs_sm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t value, size_t count) +{ + + panic("%s: not implemented", __func__); +} + +/* + * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described + * by tag/handle starting at `offset'. + */ +void +generic_bs_sr_1(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint8_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr++) + wr8(addr, value); +} + +void +generic_bs_sr_2(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint16_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 2) + wr16(addr, value); +} + +void +generic_bs_sr_4(void *t, bus_space_handle_t bsh, + bus_size_t offset, uint32_t value, size_t count) +{ + bus_addr_t addr = bsh + offset; + + for (; count != 0; count--, addr += 4) + wr32(addr, value); +} + +void +generic_bs_sr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, + uint64_t value, size_t count) +{ + + panic("%s: not implemented", __func__); +} + +/* + * Copy `count' 1, 2, 4, or 8 byte values from bus space starting + * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. + */ +void +generic_bs_c_1(void *t, bus_space_handle_t bsh1, + bus_size_t off1, bus_space_handle_t bsh2, + bus_size_t off2, size_t count) +{ + bus_addr_t addr1 = bsh1 + off1; + bus_addr_t addr2 = bsh2 + off2; + + if (addr1 >= addr2) { + /* src after dest: copy forward */ + for (; count != 0; count--, addr1++, addr2++) + wr8(addr2, rd8(addr1)); + } else { + /* dest after src: copy backwards */ + for (addr1 += (count - 1), addr2 += (count - 1); + count != 0; count--, addr1--, addr2--) + wr8(addr2, rd8(addr1)); + } +} + +void +generic_bs_c_2(void *t, bus_space_handle_t bsh1, + bus_size_t off1, bus_space_handle_t bsh2, + bus_size_t off2, size_t count) +{ + bus_addr_t addr1 = bsh1 + off1; + bus_addr_t addr2 = bsh2 + off2; + + if (addr1 >= addr2) { + /* src after dest: copy forward */ + for (; count != 0; count--, addr1 += 2, addr2 += 2) + wr16(addr2, rd16(addr1)); + } else { + /* dest after src: copy backwards */ + for (addr1 += 2 * (count - 1), addr2 += 2 * (count - 1); + count != 0; count--, addr1 -= 2, addr2 -= 2) + wr16(addr2, rd16(addr1)); + } +} + +void +generic_bs_c_4(void *t, bus_space_handle_t bsh1, + bus_size_t off1, bus_space_handle_t bsh2, + bus_size_t off2, size_t count) +{ + bus_addr_t addr1 = bsh1 + off1; + bus_addr_t addr2 = bsh2 + off2; + + if (addr1 >= addr2) { + /* src after dest: copy forward */ + for (; count != 0; count--, addr1 += 4, addr2 += 4) + wr32(addr2, rd32(addr1)); + } else { + /* dest after src: copy backwards */ + for (addr1 += 4 * (count - 1), addr2 += 4 * (count - 1); + count != 0; count--, addr1 -= 4, addr2 -= 4) + wr32(addr2, rd32(addr1)); + } +} + +void +generic_bs_c_8(void *t, bus_space_handle_t bsh1, bus_size_t off1, + bus_space_handle_t bsh2, bus_size_t off2, size_t count) +{ + + panic("%s: not implemented", __func__); +} + +void +generic_bs_barrier(void *t __unused, + bus_space_handle_t bsh __unused, + bus_size_t offset __unused, bus_size_t len __unused, + int flags) +{ +#if 0 + if (flags & BUS_SPACE_BARRIER_WRITE) + mips_dcache_wbinv_all(); +#endif +} From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 15:58:21 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9BA6BD64; Sat, 12 Jan 2013 15:58:21 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8CEBFE19; Sat, 12 Jan 2013 15:58:21 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CFwLFv081145; Sat, 12 Jan 2013 15:58:21 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CFwKNS081140; Sat, 12 Jan 2013 15:58:20 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301121558.r0CFwKNS081140@svn.freebsd.org> From: Robert Watson Date: Sat, 12 Jan 2013 15:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245332 - in head/sys: conf mips/include mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 15:58:21 -0000 Author: rwatson Date: Sat Jan 12 15:58:20 2013 New Revision: 245332 URL: http://svnweb.freebsd.org/changeset/base/245332 Log: Merge Perforce changeset 219925 to head: Provided a bus_space implementation for FDT, modelled on bus_space_generic, but with a local version of the map address routine that does a P->V translation, as is the case with NLM's similar routine for XLP. It's not clear to me that this is the right solution -- possibly this belongs in simplebus -- however, it is sufficient to get the DE4 LED driver working. Sponsored by: DARPA, AFRL Modified: head/sys/conf/files.mips head/sys/mips/include/bus.h head/sys/mips/include/fdt.h head/sys/mips/mips/bus_space_fdt.c Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Sat Jan 12 15:53:45 2013 (r245331) +++ head/sys/conf/files.mips Sat Jan 12 15:58:20 2013 (r245332) @@ -7,6 +7,7 @@ # Arch dependent files mips/mips/autoconf.c standard mips/mips/bus_space_generic.c standard +mips/mips/bus_space_fdt.c optional fdt mips/mips/busdma_machdep.c standard mips/mips/cache.c standard mips/mips/cache_mipsNN.c standard Modified: head/sys/mips/include/bus.h ============================================================================== --- head/sys/mips/include/bus.h Sat Jan 12 15:53:45 2013 (r245331) +++ head/sys/mips/include/bus.h Sat Jan 12 15:58:20 2013 (r245332) @@ -728,6 +728,8 @@ void __bs_c(f,_bs_c_8) (void *t, bus_spa */ DECLARE_BUS_SPACE_PROTOTYPES(generic); extern bus_space_tag_t mips_bus_space_generic; +extern bus_space_tag_t mips_bus_space_fdt; + /* Special bus space for RMI processors */ #if defined(CPU_RMI) || defined (CPU_NLM) extern bus_space_tag_t rmi_bus_space; Modified: head/sys/mips/include/fdt.h ============================================================================== --- head/sys/mips/include/fdt.h Sat Jan 12 15:53:45 2013 (r245331) +++ head/sys/mips/include/fdt.h Sat Jan 12 15:58:20 2013 (r245332) @@ -51,7 +51,7 @@ #if defined(CPU_RMI) || defined(CPU_NLM) #define fdtbus_bs_tag rmi_uart_bus_space #else -#define fdtbus_bs_tag NULL +#define fdtbus_bs_tag mips_bus_space_fdt #endif #endif /* _MACHINE_FDT_H_ */ Modified: head/sys/mips/mips/bus_space_fdt.c ============================================================================== --- head/sys/mips/mips/bus_space_fdt.c Sat Jan 12 15:53:45 2013 (r245331) +++ head/sys/mips/mips/bus_space_fdt.c Sat Jan 12 15:58:20 2013 (r245332) @@ -89,12 +89,15 @@ __FBSDID("$FreeBSD$"); #include #include -static struct bus_space generic_space = { +static int fdt_bs_map(void *, bus_addr_t, bus_size_t, int, + bus_space_handle_t *); + +static struct bus_space fdt_space = { /* cookie */ (void *) 0, /* mapping/unmapping */ - generic_bs_map, + fdt_bs_map, generic_bs_unmap, generic_bs_subregion, @@ -196,486 +199,14 @@ static struct bus_space generic_space = generic_bs_wr_8, }; -/* Ultra-gross kludge */ -#if defined(CPU_CNMIPS) && (defined(__mips_n32) || defined(__mips_o32)) -#include -#define rd8(a) cvmx_read64_uint8(a) -#define rd16(a) cvmx_read64_uint16(a) -#define rd32(a) cvmx_read64_uint32(a) -#define wr8(a, v) cvmx_write64_uint8(a, v) -#define wr16(a, v) cvmx_write64_uint16(a, v) -#define wr32(a, v) cvmx_write64_uint32(a, v) -#elif defined(CPU_SB1) && _BYTE_ORDER == _BIG_ENDIAN -#include -#define rd8(a) sb_big_endian_read8(a) -#define rd16(a) sb_big_endian_read16(a) -#define rd32(a) sb_big_endian_read32(a) -#define wr8(a, v) sb_big_endian_write8(a, v) -#define wr16(a, v) sb_big_endian_write16(a, v) -#define wr32(a, v) sb_big_endian_write32(a, v) -#else -#define rd8(a) readb(a) -#define rd16(a) readw(a) -#define rd32(a) readl(a) -#define wr8(a, v) writeb(a, v) -#define wr16(a, v) writew(a, v) -#define wr32(a, v) writel(a, v) -#endif - /* generic bus_space tag */ -bus_space_tag_t mips_bus_space_generic = &generic_space; - -int -generic_bs_map(void *t __unused, bus_addr_t addr, - bus_size_t size __unused, int flags __unused, - bus_space_handle_t *bshp) -{ - - *bshp = addr; - return (0); -} - -void -generic_bs_unmap(void *t __unused, bus_space_handle_t bh __unused, - bus_size_t size __unused) -{ - - /* Do nothing */ -} +bus_space_tag_t mips_bus_space_fdt = &fdt_space; -int -generic_bs_subregion(void *t __unused, bus_space_handle_t handle, - bus_size_t offset, bus_size_t size __unused, - bus_space_handle_t *bshp) +static int +fdt_bs_map(void *t __unused, bus_addr_t addr, bus_size_t size __unused, + int flags __unused, bus_space_handle_t *bshp) { - *bshp = handle + offset; + *bshp = MIPS_PHYS_TO_DIRECT_UNCACHED(addr); return (0); } - -int -generic_bs_alloc(void *t, bus_addr_t rstart, bus_addr_t rend, - bus_size_t size, bus_size_t alignment, bus_size_t boundary, int flags, - bus_addr_t *bpap, bus_space_handle_t *bshp) -{ - - panic("%s: not implemented", __func__); -} - -void -generic_bs_free(void *t, bus_space_handle_t bsh, bus_size_t size) -{ - - panic("%s: not implemented", __func__); -} - -uint8_t -generic_bs_r_1(void *t, bus_space_handle_t handle, - bus_size_t offset) -{ - - return (rd8(handle + offset)); -} - -uint16_t -generic_bs_r_2(void *t, bus_space_handle_t handle, - bus_size_t offset) -{ - - return (rd16(handle + offset)); -} - -uint32_t -generic_bs_r_4(void *t, bus_space_handle_t handle, - bus_size_t offset) -{ - - return (rd32(handle + offset)); -} - -uint64_t -generic_bs_r_8(void *t, bus_space_handle_t handle, bus_size_t offset) -{ - - panic("%s: not implemented", __func__); -} - -void -generic_bs_rm_1(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint8_t *addr, size_t count) -{ - - while (count--) - *addr++ = rd8(bsh + offset); -} - -void -generic_bs_rm_2(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint16_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) - *addr++ = rd16(baddr); -} - -void -generic_bs_rm_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint32_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) - *addr++ = rd32(baddr); -} - -void -generic_bs_rm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, - uint64_t *addr, size_t count) -{ - - panic("%s: not implemented", __func__); -} - -/* - * Read `count' 1, 2, 4, or 8 byte quantities from bus space - * described by tag/handle and starting at `offset' and copy into - * buffer provided. - */ -void -generic_bs_rr_1(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint8_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - *addr++ = rd8(baddr); - baddr += 1; - } -} - -void -generic_bs_rr_2(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint16_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - *addr++ = rd16(baddr); - baddr += 2; - } -} - -void -generic_bs_rr_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint32_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - *addr++ = rd32(baddr); - baddr += 4; - } -} - -void -generic_bs_rr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, - uint64_t *addr, size_t count) -{ - - panic("%s: not implemented", __func__); -} - -/* - * Write the 1, 2, 4, or 8 byte value `value' to bus space - * described by tag/handle/offset. - */ -void -generic_bs_w_1(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint8_t value) -{ - - wr8(bsh + offset, value); -} - -void -generic_bs_w_2(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint16_t value) -{ - - wr16(bsh + offset, value); -} - -void -generic_bs_w_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint32_t value) -{ - - wr32(bsh + offset, value); -} - -void -generic_bs_w_8(void *t, bus_space_handle_t bsh, bus_size_t offset, - uint64_t value) -{ - - panic("%s: not implemented", __func__); -} - -/* - * Write `count' 1, 2, 4, or 8 byte quantities from the buffer - * provided to bus space described by tag/handle/offset. - */ -void -generic_bs_wm_1(void *t, bus_space_handle_t bsh, - bus_size_t offset, const uint8_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) - wr8(baddr, *addr++); -} - -void -generic_bs_wm_2(void *t, bus_space_handle_t bsh, - bus_size_t offset, const uint16_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) - wr16(baddr, *addr++); -} - -void -generic_bs_wm_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, const uint32_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) - wr32(baddr, *addr++); -} - -void -generic_bs_wm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, - const uint64_t *addr, size_t count) -{ - - panic("%s: not implemented", __func__); -} - -/* - * Write `count' 1, 2, 4, or 8 byte quantities from the buffer provided - * to bus space described by tag/handle starting at `offset'. - */ -void -generic_bs_wr_1(void *t, bus_space_handle_t bsh, - bus_size_t offset, const uint8_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - wr8(baddr, *addr++); - baddr += 1; - } -} - -void -generic_bs_wr_2(void *t, bus_space_handle_t bsh, - bus_size_t offset, const uint16_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - wr16(baddr, *addr++); - baddr += 2; - } -} - -void -generic_bs_wr_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, const uint32_t *addr, size_t count) -{ - bus_addr_t baddr = bsh + offset; - - while (count--) { - wr32(baddr, *addr++); - baddr += 4; - } -} - -void -generic_bs_wr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, - const uint64_t *addr, size_t count) -{ - - panic("%s: not implemented", __func__); -} - -/* - * Write the 1, 2, 4, or 8 byte value `val' to bus space described - * by tag/handle/offset `count' times. - */ -void -generic_bs_sm_1(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint8_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - while (count--) - wr8(addr, value); -} - -void -generic_bs_sm_2(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint16_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - while (count--) - wr16(addr, value); -} - -void -generic_bs_sm_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint32_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - while (count--) - wr32(addr, value); -} - -void -generic_bs_sm_8(void *t, bus_space_handle_t bsh, bus_size_t offset, - uint64_t value, size_t count) -{ - - panic("%s: not implemented", __func__); -} - -/* - * Write `count' 1, 2, 4, or 8 byte value `val' to bus space described - * by tag/handle starting at `offset'. - */ -void -generic_bs_sr_1(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint8_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - for (; count != 0; count--, addr++) - wr8(addr, value); -} - -void -generic_bs_sr_2(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint16_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - for (; count != 0; count--, addr += 2) - wr16(addr, value); -} - -void -generic_bs_sr_4(void *t, bus_space_handle_t bsh, - bus_size_t offset, uint32_t value, size_t count) -{ - bus_addr_t addr = bsh + offset; - - for (; count != 0; count--, addr += 4) - wr32(addr, value); -} - -void -generic_bs_sr_8(void *t, bus_space_handle_t bsh, bus_size_t offset, - uint64_t value, size_t count) -{ - - panic("%s: not implemented", __func__); -} - -/* - * Copy `count' 1, 2, 4, or 8 byte values from bus space starting - * at tag/bsh1/off1 to bus space starting at tag/bsh2/off2. - */ -void -generic_bs_c_1(void *t, bus_space_handle_t bsh1, - bus_size_t off1, bus_space_handle_t bsh2, - bus_size_t off2, size_t count) -{ - bus_addr_t addr1 = bsh1 + off1; - bus_addr_t addr2 = bsh2 + off2; - - if (addr1 >= addr2) { - /* src after dest: copy forward */ - for (; count != 0; count--, addr1++, addr2++) - wr8(addr2, rd8(addr1)); - } else { - /* dest after src: copy backwards */ - for (addr1 += (count - 1), addr2 += (count - 1); - count != 0; count--, addr1--, addr2--) - wr8(addr2, rd8(addr1)); - } -} - -void -generic_bs_c_2(void *t, bus_space_handle_t bsh1, - bus_size_t off1, bus_space_handle_t bsh2, - bus_size_t off2, size_t count) -{ - bus_addr_t addr1 = bsh1 + off1; - bus_addr_t addr2 = bsh2 + off2; - - if (addr1 >= addr2) { - /* src after dest: copy forward */ - for (; count != 0; count--, addr1 += 2, addr2 += 2) - wr16(addr2, rd16(addr1)); - } else { - /* dest after src: copy backwards */ - for (addr1 += 2 * (count - 1), addr2 += 2 * (count - 1); - count != 0; count--, addr1 -= 2, addr2 -= 2) - wr16(addr2, rd16(addr1)); - } -} - -void -generic_bs_c_4(void *t, bus_space_handle_t bsh1, - bus_size_t off1, bus_space_handle_t bsh2, - bus_size_t off2, size_t count) -{ - bus_addr_t addr1 = bsh1 + off1; - bus_addr_t addr2 = bsh2 + off2; - - if (addr1 >= addr2) { - /* src after dest: copy forward */ - for (; count != 0; count--, addr1 += 4, addr2 += 4) - wr32(addr2, rd32(addr1)); - } else { - /* dest after src: copy backwards */ - for (addr1 += 4 * (count - 1), addr2 += 4 * (count - 1); - count != 0; count--, addr1 -= 4, addr2 -= 4) - wr32(addr2, rd32(addr1)); - } -} - -void -generic_bs_c_8(void *t, bus_space_handle_t bsh1, bus_size_t off1, - bus_space_handle_t bsh2, bus_size_t off2, size_t count) -{ - - panic("%s: not implemented", __func__); -} - -void -generic_bs_barrier(void *t __unused, - bus_space_handle_t bsh __unused, - bus_size_t offset __unused, bus_size_t len __unused, - int flags) -{ -#if 0 - if (flags & BUS_SPACE_BARRIER_WRITE) - mips_dcache_wbinv_all(); -#endif -} From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 16:01:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DCDF810F; Sat, 12 Jan 2013 16:01:58 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF193E46; Sat, 12 Jan 2013 16:01:58 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CG1wdi083404; Sat, 12 Jan 2013 16:01:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CG1wPn083403; Sat, 12 Jan 2013 16:01:58 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201301121601.r0CG1wPn083403@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 12 Jan 2013 16:01:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245333 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 16:01:58 -0000 Author: nwhitehorn Date: Sat Jan 12 16:01:58 2013 New Revision: 245333 URL: http://svnweb.freebsd.org/changeset/base/245333 Log: Note that cpufreq(4) is not available on all hardware. PR: bin/175139 MFC after: 2 weeks Modified: head/usr.sbin/bsdinstall/scripts/services Modified: head/usr.sbin/bsdinstall/scripts/services ============================================================================== --- head/usr.sbin/bsdinstall/scripts/services Sat Jan 12 15:58:20 2013 (r245332) +++ head/usr.sbin/bsdinstall/scripts/services Sat Jan 12 16:01:58 2013 (r245333) @@ -45,7 +45,7 @@ DAEMONS=$(dialog --backtitle "FreeBSD In sshd "Secure shell daemon" ${sshd_enable:-off} \ moused "PS/2 mouse pointer on console" ${moused_enable:-off} \ ntpd "Synchronize system and network time" ${ntpd_enable:-off} \ - powerd "Adjust CPU frequency dynamically" ${powerd_enable:-off} \ + powerd "Adjust CPU frequency dynamically if supported" ${powerd_enable:-off} \ 2>&1 1>&3) exec 3>&- From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 16:05:56 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2542B39F; Sat, 12 Jan 2013 16:05:56 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 13CA7E6B; Sat, 12 Jan 2013 16:05:56 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CG5tDi084027; Sat, 12 Jan 2013 16:05:55 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CG5tcd084026; Sat, 12 Jan 2013 16:05:55 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201301121605.r0CG5tcd084026@svn.freebsd.org> From: Steven Hartland Date: Sat, 12 Jan 2013 16:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245334 - head/sys/dev/e1000 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 16:05:56 -0000 Author: smh Date: Sat Jan 12 16:05:55 2013 New Revision: 245334 URL: http://svnweb.freebsd.org/changeset/base/245334 Log: Fixed mbuf free when receive structures fail to allocate. This prevents quad igb card on high core machines, without any nmbcluster or igb queue tuning wedging the boot process if all nics are configured. Reviewed by: jfv Approved by: pjd (mentor) MFC after: 1 week Modified: head/sys/dev/e1000/if_igb.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Sat Jan 12 16:01:58 2013 (r245333) +++ head/sys/dev/e1000/if_igb.c Sat Jan 12 16:05:55 2013 (r245334) @@ -4330,8 +4330,8 @@ fail: * the rings that completed, the failing case will have * cleaned up for itself. 'i' is the endpoint. */ - for (int j = 0; j > i; ++j) { - rxr = &adapter->rx_rings[i]; + for (int j = 0; j < i; ++j) { + rxr = &adapter->rx_rings[j]; IGB_RX_LOCK(rxr); igb_free_receive_ring(rxr); IGB_RX_UNLOCK(rxr); From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 16:09:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 67E0A561; Sat, 12 Jan 2013 16:09:34 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4357DE81; Sat, 12 Jan 2013 16:09:34 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CG9YMP084614; Sat, 12 Jan 2013 16:09:34 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CG9YD1084613; Sat, 12 Jan 2013 16:09:34 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201301121609.r0CG9YD1084613@svn.freebsd.org> From: Robert Watson Date: Sat, 12 Jan 2013 16:09:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245335 - head/sys/dev/fdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 16:09:34 -0000 Author: rwatson Date: Sat Jan 12 16:09:33 2013 New Revision: 245335 URL: http://svnweb.freebsd.org/changeset/base/245335 Log: Merge Perforce changeset 219933 and portions of 219962 (omits changes to unmerged BERI DTS files) to head: Use the OFW compatible string "mips,mips4k" rather than "mips4k,cp0" for interrupt control using MIPS4k CP0. Suggested by: thompsa Implement a MIPS FDT PIC decode routine to use when no PIC has been configured, which assumes a cascade back to the nexus bus (e.g., the on-board CP0 interrupt management parts on the MIPS). If the soc bus in a MIPS DTS file is declared as "mips4k,cp0"-compatible, then this will be enabled. This is sufficient to allow IRQs to be configured on BERI. Sponsored by: DARPA, AFRL Modified: head/sys/dev/fdt/fdt_mips.c Modified: head/sys/dev/fdt/fdt_mips.c ============================================================================== --- head/sys/dev/fdt/fdt_mips.c Sat Jan 12 16:05:55 2013 (r245334) +++ head/sys/dev/fdt/fdt_mips.c Sat Jan 12 16:09:33 2013 (r245335) @@ -49,8 +49,26 @@ struct fdt_fixup_entry fdt_fixup_table[] { NULL, NULL } }; +/* + * For PIC-free boards, provide a PIC decoder to be used with mips4k CP0 + * interrupt control directly. + */ +static int +fdt_pic_decode_mips4k_cp0(phandle_t node, pcell_t *intr, int *interrupt, + int *trig, int *pol) +{ + + if (!fdt_is_compatible(node, "mips,mips4k")) + return (ENXIO); + + *interrupt = fdt32_to_cpu(intr[0]); + *trig = INTR_TRIGGER_CONFORM; + *pol = INTR_POLARITY_CONFORM; + + return (0); +} + fdt_pic_decode_t fdt_pic_table[] = { - NULL, - NULL, + &fdt_pic_decode_mips4k_cp0, NULL }; From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 16:23:17 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 057927E2; Sat, 12 Jan 2013 16:23:17 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E44E1EE6; Sat, 12 Jan 2013 16:23:16 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CGNGdu089552; Sat, 12 Jan 2013 16:23:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CGNGl4089551; Sat, 12 Jan 2013 16:23:16 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201301121623.r0CGNGl4089551@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 12 Jan 2013 16:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245336 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 16:23:17 -0000 Author: nwhitehorn Date: Sat Jan 12 16:23:16 2013 New Revision: 245336 URL: http://svnweb.freebsd.org/changeset/base/245336 Log: The new sade(8) is installed and works on all architectures, courtesy of gpart having better portability than libdisk. Don't mark sade(8) as obsolete on non-x86 systems. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat Jan 12 16:09:33 2013 (r245335) +++ head/ObsoleteFiles.inc Sat Jan 12 16:23:16 2013 (r245336) @@ -1201,12 +1201,6 @@ OLD_FILES+=usr/include/sys/linedisc.h OLD_FILES+=usr/share/man/man3/posix_openpt.3.gz # 20080725: sgtty.h removed OLD_FILES+=usr/include/sgtty.h -# 20080719: sade(8) removed on all but amd64, i386 and sparc64 -.if ${TARGET_ARCH} != "amd64" && ${TARGET_ARCH} != "i386" && \ - ${TARGET_ARCH} != "sparc64" -OLD_FILES+=usr/sbin/sade -OLD_FILES+=usr/share/man/man8/sade.8.gz -.endif # 20080706: bsdlabel(8) removed on powerpc .if ${TARGET_ARCH} == "powerpc" OLD_FILES+=sbin/bsdlabel From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 16:30:03 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD729EB6; Sat, 12 Jan 2013 16:30:03 +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 99568F3E; Sat, 12 Jan 2013 16:30:03 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII 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 <0MGI00202TTX7K00@smtpauth2.wiscmail.wisc.edu>; Sat, 12 Jan 2013 10:29:57 -0600 (CST) Received: from wanderer.tachypleus.net (c-24-63-204-107.hsd1.ct.comcast.net [24.63.204.107]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0MGI000RPTTVR900@smtpauth2.wiscmail.wisc.edu>; Sat, 12 Jan 2013 10:29:57 -0600 (CST) Date: Sat, 12 Jan 2013 08:29:55 -0800 From: Nathan Whitehorn Subject: Re: svn commit: r245331 - head/sys/mips/mips In-reply-to: <201301121553.r0CFrjRU080518@svn.freebsd.org> Sender: whitehorn@wisc.edu To: Robert Watson Message-id: <50F18F83.9080604@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=24.63.204.107 X-Spam-PmxInfo: Server=avs-15, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.12.161817, SenderIP=24.63.204.107 References: <201301121553.r0CFrjRU080518@svn.freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 16:30:03 -0000 On 01/12/13 07:53, Robert Watson wrote: > Author: rwatson > Date: Sat Jan 12 15:53:45 2013 > New Revision: 245331 > URL: http://svnweb.freebsd.org/changeset/base/245331 > > Log: > Merge Perforce chance 219924 to head: > > In a sign of weakness, replicate the MIPS bus_space_generic.c to > produce a new FDT version, which will perform necessary address > space translation for bus_space -- the solution used in NLM's MIPS > FDT support, but possibly not quite the right thing. This is > inconsistent with regular I/O via the nexus and the generic > bus_space, which instead perform translation via pmap_mapdev() > when a resource is activated. However, it will work while I > attempt to identify what the right way to reconcile possible > approaches. > > (Another approach might be to make simplebus use Nexus's activate > routine instead of a generic one?) > > Sponsored by: DARPA, AFRL > Using nexus's instead of having a parallel universe of "FDT" things is, in my opinion, the right way to go. It's what we do on PowerPC and SPARC with real Open Firmware and there is no reason to do things any differently with FDT. -Nathan From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 16:56:24 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 760E6373; Sat, 12 Jan 2013 16:56:24 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-x229.google.com (wi-in-x0229.1e100.net [IPv6:2a00:1450:400c:c05::229]) by mx1.freebsd.org (Postfix) with ESMTP id 2DE9BFF3; Sat, 12 Jan 2013 16:56:23 +0000 (UTC) Received: by mail-wi0-f169.google.com with SMTP id hq12so482973wib.0 for ; Sat, 12 Jan 2013 08:56:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=q+q0YjXkji2n4a1qWatdaZ3BA1azA7I4bjuw/XOLA0Q=; b=YN/nf2FrMlS3kfOrCtgYj3RNT2gFqD4lt49zdD9Xv0rzMii+vb447u1UM9UzrzHjSm V5F0fzw1wG+2uQwCsrzeutwENKDnnrj39Pn9F4DlcSK0H4sKs9xS4VE4TSmCUcoitWeZ 7Q+9s/YXWGZjle4WOYrEwOTzUdiwUSogw/2EI29EXSlrUxZ2SO86bOu6CZHvd/YusIG+ KEovTPBeNnaR3tZT1SnoXPDph8PhcKN92IolsTiqGXMcQTiw+X7BX54F89Bsqd65ZPmF aDjRDLBeLU4+5E5rd9Cfz1RJCzmeB0aHP4hVIBOwI5twnYeT7KZyxBjFxB4RMVMPtgrl lIyQ== MIME-Version: 1.0 Received: by 10.180.88.40 with SMTP id bd8mr4537826wib.33.1358009782041; Sat, 12 Jan 2013 08:56:22 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.217.57.9 with HTTP; Sat, 12 Jan 2013 08:56:21 -0800 (PST) In-Reply-To: References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> Date: Sat, 12 Jan 2013 08:56:21 -0800 X-Google-Sender-Auth: 2CBnz6-loTgqGKTy30-VMnQ25Jo Message-ID: Subject: Re: svn commit: r243631 - in head/sys: kern sys From: Adrian Chadd To: "Jayachandran C." Content-Type: text/plain; charset=ISO-8859-1 Cc: src-committers@freebsd.org, Andre Oppermann , Alan Cox , svn-src-all@freebsd.org, Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 16:56:24 -0000 Hi, I think this outlines a larger scale problem here, which is that way, way too many things are relying on maxfiles here and it wasn't properly reviewed or thought out before it made it into the tree. So, can we either: * review _all_ the places maxfiles is being used, and finally fix those; * .. or revert this work until said review and fixup is done? This is the kind of thing that we should just not mess up at this point.. Thanks, Adrian On 12 January 2013 07:46, Jayachandran C. wrote: > On Fri, Jan 11, 2013 at 11:16 PM, Alan Cox wrote: >> On 01/11/2013 05:38, Jayachandran C. wrote: > [...] >>> I see an issue with commit on MIPS XLP platform as well. >>> >>> With 16 GB physical memory, the ncallout is calculated to be 538881 >>> (since it is based on maxfiles - which is now based on the physical >>> memory). Due to this, the callwheel allocation per cpu is 16MB >>> (callwheelsize is 1MB). And on a 32 CPU machine, the total allocation >>> for callouts comes to 32*16MB = 512MB. >>> >>> I have worked around this issue for now by increasing VM_KMEM_SIZE_MAX >>> (which is 200MB now) - but I think a better fix is needed for this. >>> >> >> MIPS should use a definition for VM_KMEM_SIZE_MAX that scales with the >> kernel address space size, like amd64, i386, and sparc64, and not a >> fixed number. I think that the following should work for both 32- and >> 64-bit processors: >> >> Index: mips/include/vmparam.h >> =================================================================== >> --- mips/include/vmparam.h (revision 245229) >> +++ mips/include/vmparam.h (working copy) >> @@ -130,10 +130,11 @@ >> #endif >> >> /* >> - * Ceiling on amount of kmem_map kva space. >> + * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA >> space. >> */ >> #ifndef VM_KMEM_SIZE_MAX >> -#define VM_KMEM_SIZE_MAX (200 * 1024 * 1024) >> +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ >> + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) >> #endif >> >> /* initial pagein size of beginning of executable file */ > > This fix is needed, can you please check it in? I have tested it for > 32 and 64 bit. > > But the second part of the problem - allocating 512MB out of 16GB at > boot-time for callouts - might need a fix as well. > > Thanks, > JC. From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 18:06:22 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 278FB23D; Sat, 12 Jan 2013 18:06:22 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0741C23F; Sat, 12 Jan 2013 18:06:22 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CI6LxN017924; Sat, 12 Jan 2013 18:06:21 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CI6Ld1017923; Sat, 12 Jan 2013 18:06:21 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201301121806.r0CI6Ld1017923@svn.freebsd.org> From: Alan Cox Date: Sat, 12 Jan 2013 18:06:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245337 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 18:06:22 -0000 Author: alc Date: Sat Jan 12 18:06:21 2013 New Revision: 245337 URL: http://svnweb.freebsd.org/changeset/base/245337 Log: Define VM_KMEM_SIZE_MAX as a fraction of the kernel address space size rather than a constant so that VM_KMEM_SIZE_MAX will scale automatically with the kernel address space size. This is particularly important for MIPS because the same definition is used by both 32- and 64-bit kernels. Tested by: jchandra Modified: head/sys/mips/include/vmparam.h Modified: head/sys/mips/include/vmparam.h ============================================================================== --- head/sys/mips/include/vmparam.h Sat Jan 12 16:23:16 2013 (r245336) +++ head/sys/mips/include/vmparam.h Sat Jan 12 18:06:21 2013 (r245337) @@ -130,10 +130,11 @@ #endif /* - * Ceiling on amount of kmem_map kva space. + * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space. */ #ifndef VM_KMEM_SIZE_MAX -#define VM_KMEM_SIZE_MAX (200 * 1024 * 1024) +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif /* initial pagein size of beginning of executable file */ From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 18:25:48 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C0D68922; Sat, 12 Jan 2013 18:25:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A27BE327; Sat, 12 Jan 2013 18:25:48 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CIPmBU023199; Sat, 12 Jan 2013 18:25:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CIPm9q023198; Sat, 12 Jan 2013 18:25:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301121825.r0CIPm9q023198@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jan 2013 18:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245338 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 18:25:48 -0000 Author: mav Date: Sat Jan 12 18:25:48 2013 New Revision: 245338 URL: http://svnweb.freebsd.org/changeset/base/245338 Log: Implement migration from single disk to RAID1/IRRT for Intel metadata. Windows driver uses such migration when it creates new arrays. While GEOM RAID has no mechanism to implement migration in general case, this specifc case still can be handled easily via degraded RAID1 creation followed by regular rebuild. Modified: head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Sat Jan 12 18:06:21 2013 (r245337) +++ head/sys/geom/raid/md_intel.c Sat Jan 12 18:25:48 2013 (r245338) @@ -171,8 +171,13 @@ struct intel_raid_conf { uint8_t total_disks; uint8_t total_volumes; - uint8_t dummy_2[2]; - uint32_t filler_0[39]; + uint8_t error_log_pos; + uint8_t dummy_2[1]; + uint32_t cache_size; + uint32_t orig_family_num; + uint32_t pwr_cycle_count; + uint32_t bbm_log_size; + uint32_t filler_0[35]; struct intel_raid_disk disk[1]; /* total_disks entries. */ /* Here goes total_volumes of struct intel_raid_vol. */ } __packed; @@ -366,9 +371,12 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_size 0x%08x\n", meta->config_size); printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); + printf("error_log_size %d\n", meta->error_log_size); printf("attributes 0x%08x\n", meta->attributes); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); + printf("orig_family_num 0x%08x\n", meta->orig_family_num); + printf("bbm_log_size %u\n", meta->bbm_log_size); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags\n"); for (i = 0; i < meta->total_disks; i++ ) { printf(" %d <%.16s> %u %u 0x%08x 0x%08x\n", i, @@ -451,7 +459,7 @@ intel_meta_read(struct g_consumer *cp) struct g_provider *pp; struct intel_raid_conf *meta; struct intel_raid_vol *mvol; - struct intel_raid_map *mmap; + struct intel_raid_map *mmap, *mmap1; char *buf; int error, i, j, k, left, size; uint32_t checksum, *ptr; @@ -544,6 +552,8 @@ badsize: } } + g_raid_md_intel_print(meta); + /* Validate disk indexes. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); @@ -566,16 +576,39 @@ badsize: /* Validate migration types. */ for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); + /* Deny unknown migration types. */ if (mvol->migr_state && mvol->migr_type != INTEL_MT_INIT && mvol->migr_type != INTEL_MT_REBUILD && mvol->migr_type != INTEL_MT_VERIFY && + mvol->migr_type != INTEL_MT_GEN_MIGR && mvol->migr_type != INTEL_MT_REPAIR) { G_RAID_DEBUG(1, "Intel metadata has unsupported" " migration type %d", mvol->migr_type); free(meta, M_MD_INTEL); return (NULL); } + /* Deny general migrations except SINGLE->RAID1. */ + if (mvol->migr_state && + mvol->migr_type == INTEL_MT_GEN_MIGR) { + mmap = intel_get_map(mvol, 0); + mmap1 = intel_get_map(mvol, 1); + if (mmap1->total_disks != 1 || + mmap->type != INTEL_T_RAID1 || + mmap->total_disks != 2 || + mmap->offset != mmap1->offset || + mmap->disk_sectors != mmap1->disk_sectors || + mmap->total_domains != mmap->total_disks || + mmap->offset_hi != mmap1->offset_hi || + mmap->disk_sectors_hi != mmap1->disk_sectors_hi || + (mmap->disk_idx[0] != mmap1->disk_idx[0] && + mmap->disk_idx[0] != mmap1->disk_idx[1])) { + G_RAID_DEBUG(1, "Intel metadata has unsupported" + " variant of general migration"); + free(meta, M_MD_INTEL); + return (NULL); + } + } } return (meta); @@ -957,6 +990,16 @@ nofit: g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_ACTIVE); } + } else if (mvol->migr_type == INTEL_MT_GEN_MIGR) { + if ((mmap1->disk_idx[0] & INTEL_DI_IDX) != disk_pos) { + /* Freshly inserted disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_NEW); + } else { + /* Up to date disk. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_ACTIVE); + } } g_raid_event_send(sd, G_RAID_SUBDISK_E_NEW, G_RAID_EVENT_SUBDISK); @@ -1337,8 +1380,6 @@ g_raid_md_taste_intel(struct g_raid_md_o goto fail1; } - /* Metadata valid. Print it. */ - g_raid_md_intel_print(meta); G_RAID_DEBUG(1, "Intel disk position %d", disk_pos); spare = meta->disk[disk_pos].flags & INTEL_F_SPARE; @@ -2370,7 +2411,8 @@ g_raid_md_write_intel(struct g_raid_md_o mmap1->disk_idx[sdi] |= INTEL_DI_RBLD; } if ((sd->sd_state == G_RAID_SUBDISK_S_NONE || - sd->sd_state == G_RAID_SUBDISK_S_FAILED) && + sd->sd_state == G_RAID_SUBDISK_S_FAILED || + sd->sd_state == G_RAID_SUBDISK_S_REBUILD) && mmap0->failed_disk_num == 0xff) { mmap0->failed_disk_num = sdi; if (mvol->migr_state) From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 18:30:53 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 055B1BBA; Sat, 12 Jan 2013 18:30:53 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EBB9435D; Sat, 12 Jan 2013 18:30:52 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CIUq1V025279; Sat, 12 Jan 2013 18:30:52 GMT (envelope-from sbruno@svn.freebsd.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CIUq7u025276; Sat, 12 Jan 2013 18:30:52 GMT (envelope-from sbruno@svn.freebsd.org) Message-Id: <201301121830.r0CIUq7u025276@svn.freebsd.org> From: Sean Bruno Date: Sat, 12 Jan 2013 18:30:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245339 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 18:30:53 -0000 Author: sbruno Date: Sat Jan 12 18:30:52 2013 New Revision: 245339 URL: http://svnweb.freebsd.org/changeset/base/245339 Log: Quiesce a couple of clang warnings Submitted by: hiren panchasara Obtained from: Yahoo! Inc Modified: head/sys/dev/hwpmc/hwpmc_mod.c head/sys/dev/hwpmc/hwpmc_soft.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Sat Jan 12 18:25:48 2013 (r245338) +++ head/sys/dev/hwpmc/hwpmc_mod.c Sat Jan 12 18:30:52 2013 (r245339) @@ -3022,7 +3022,7 @@ pmc_syscall_handler(struct thread *td, v } nevent = 0; - for (ev = PMC_EV_SOFT_FIRST; ev <= PMC_EV_SOFT_LAST; ev++) { + for (ev = PMC_EV_SOFT_FIRST; (int)ev <= PMC_EV_SOFT_LAST; ev++) { ps = pmc_soft_ev_acquire(ev); if (ps == NULL) continue; Modified: head/sys/dev/hwpmc/hwpmc_soft.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_soft.c Sat Jan 12 18:25:48 2013 (r245338) +++ head/sys/dev/hwpmc/hwpmc_soft.c Sat Jan 12 18:30:52 2013 (r245339) @@ -116,7 +116,7 @@ soft_allocate_pmc(int cpu, int ri, struc return (EPERM); ev = pm->pm_event; - if (ev < PMC_EV_SOFT_FIRST || ev > PMC_EV_SOFT_LAST) + if ((int)ev < PMC_EV_SOFT_FIRST || (int)ev > PMC_EV_SOFT_LAST) return (EINVAL); /* Check if event is registered. */ From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 18:34:13 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 40F4ED98; Sat, 12 Jan 2013 18:34:13 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx1.freebsd.org (Postfix) with ESMTP id EE68C372; Sat, 12 Jan 2013 18:34:12 +0000 (UTC) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id B5BD44C027B; Sat, 12 Jan 2013 12:34:06 -0600 (CST) Received: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id B3EFE4C0256; Sat, 12 Jan 2013 12:34:06 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id ysi1Y7SHk_FK; Sat, 12 Jan 2013 12:34:06 -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 mh11.mail.rice.edu (Postfix) with ESMTPSA id 200094C021D; Sat, 12 Jan 2013 12:34:06 -0600 (CST) Message-ID: <50F1AC9D.1060101@rice.edu> Date: Sat, 12 Jan 2013 12:34:05 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "Jayachandran C." Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> In-Reply-To: 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, Andre Oppermann , Oleksandr Tymoshenko X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 18:34:13 -0000 On 01/12/2013 09:46, Jayachandran C. wrote: > On Fri, Jan 11, 2013 at 11:16 PM, Alan Cox wrote: >> On 01/11/2013 05:38, Jayachandran C. wrote: > [...] >>> I see an issue with commit on MIPS XLP platform as well. >>> >>> With 16 GB physical memory, the ncallout is calculated to be 538881 >>> (since it is based on maxfiles - which is now based on the physical >>> memory). Due to this, the callwheel allocation per cpu is 16MB >>> (callwheelsize is 1MB). And on a 32 CPU machine, the total allocation >>> for callouts comes to 32*16MB = 512MB. >>> >>> I have worked around this issue for now by increasing VM_KMEM_SIZE_MAX >>> (which is 200MB now) - but I think a better fix is needed for this. >>> >> MIPS should use a definition for VM_KMEM_SIZE_MAX that scales with the >> kernel address space size, like amd64, i386, and sparc64, and not a >> fixed number. I think that the following should work for both 32- and >> 64-bit processors: >> >> Index: mips/include/vmparam.h >> =================================================================== >> --- mips/include/vmparam.h (revision 245229) >> +++ mips/include/vmparam.h (working copy) >> @@ -130,10 +130,11 @@ >> #endif >> >> /* >> - * Ceiling on amount of kmem_map kva space. >> + * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA >> space. >> */ >> #ifndef VM_KMEM_SIZE_MAX >> -#define VM_KMEM_SIZE_MAX (200 * 1024 * 1024) >> +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ >> + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) >> #endif >> >> /* initial pagein size of beginning of executable file */ > This fix is needed, can you please check it in? I have tested it for > 32 and 64 bit. Done. Also, I suspect that 32-bit MIPS kernels should use these definitions (copied from i386/include/vmparam.h): #ifndef VM_MAX_AUTOTUNE_MAXUSERS #define VM_MAX_AUTOTUNE_MAXUSERS 384 #endif #ifndef VM_MAX_AUTOTUNE_NMBCLUSTERS /* old maxusers max value. */ #define VM_MAX_AUTOTUNE_NMBCLUSTERS (1024 + VM_MAX_AUTOTUNE_MAXUSERS * 64) #endif Could you look into this? > But the second part of the problem - allocating 512MB out of 16GB at > boot-time for callouts - might need a fix as well. > > Thanks, > JC. > From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 19:02:28 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 362D1217; Sat, 12 Jan 2013 19:02:28 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh10.mail.rice.edu (mh10.mail.rice.edu [128.42.201.30]) by mx1.freebsd.org (Postfix) with ESMTP id E0DC961B; Sat, 12 Jan 2013 19:02:27 +0000 (UTC) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id E9123603DF; Sat, 12 Jan 2013 13:02:20 -0600 (CST) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id E719B603DB; Sat, 12 Jan 2013 13:02:20 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh10.mail.rice.edu, auth channel Received: from mh10.mail.rice.edu ([127.0.0.1]) by mh10.mail.rice.edu (mh10.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id J9iE2IBZuJ6e; Sat, 12 Jan 2013 13:02:20 -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 mh10.mail.rice.edu (Postfix) with ESMTPSA id 3AAF8603D8; Sat, 12 Jan 2013 13:02:20 -0600 (CST) Message-ID: <50F1B33B.70401@rice.edu> Date: Sat, 12 Jan 2013 13:02:19 -0600 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Andre Oppermann , "Jayachandran C." , svn-src-all@freebsd.org, Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 19:02:28 -0000 On 01/12/2013 10:56, Adrian Chadd wrote: > Hi, > > I think this outlines a larger scale problem here, which is that way, > way too many things are relying on maxfiles here and it wasn't > properly reviewed or thought out before it made it into the tree. > > So, can we either: > > * review _all_ the places maxfiles is being used, and finally fix those; > * .. or revert this work until said review and fixup is done? > > This is the kind of thing that we should just not mess up at this point.. At this point, I think reverting the changes would be an overreaction. Moreover, the change that I just made to vmparam.h on MIPS should arguably have been made when 64-bit support was added to MIPS. For example, if someone had tried running ZFS on a 64-bit MIPS processor just a few weeks or months ago, we would have discovered that the same change was required. In other words, the autoconfiguration changes are bringing to light some problems that have been lurking within the param.h and vmparam.h files on some of the non-x86/sparc64 platforms. Alan P.S. That said, I think we should exercise much caution in MFCing these changes. From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 19:45:52 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4CCAAADB; Sat, 12 Jan 2013 19:45:52 +0000 (UTC) (envelope-from bright@mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE6C729; Sat, 12 Jan 2013 19:45:51 +0000 (UTC) Received: from Alfreds-MacBook-Pro-9.local (unknown [207.238.187.242]) by elvis.mu.org (Postfix) with ESMTPSA id 9026A1A3C55; Sat, 12 Jan 2013 11:45:46 -0800 (PST) Message-ID: <50F1BD69.4060104@mu.org> Date: Sat, 12 Jan 2013 14:45:45 -0500 From: Alfred Perlstein User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: Adrian Chadd Subject: Re: svn commit: r243631 - in head/sys: kern sys References: <201211272119.qARLJxXV061083@svn.freebsd.org> <50C1BC90.90106@freebsd.org> <50C25A27.4060007@bluezbox.com> <50C26331.6030504@freebsd.org> <50C26AE9.4020600@bluezbox.com> <50C3A3D3.9000804@freebsd.org> <50C3AF72.4010902@rice.edu> <330405A1-312A-45A5-BB86-4969478D8BBD@bluezbox.com> <50D03E83.8060908@rice.edu> <50DD081E.8000409@bluezbox.com> <50EB1841.5030006@bluezbox.com> <50EB22D2.6090103@rice.edu> <50EB415F.8020405@freebsd.org> <50F04FE5.7010406@rice.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Andre Oppermann , Alan Cox , "Jayachandran C." , svn-src-all@freebsd.org, Oleksandr Tymoshenko , freebsd-arch@freebsd.org, svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 19:45:52 -0000 On 1/12/13 11:56 AM, Adrian Chadd wrote: > Hi, > > I think this outlines a larger scale problem here, which is that way, > way too many things are relying on maxfiles here and it wasn't > properly reviewed or thought out before it made it into the tree. > > So, can we either: > > * review _all_ the places maxfiles is being used, and finally fix those; > * .. or revert this work until said review and fixup is done? > > This is the kind of thing that we should just not mess up at this point.. I'm not sure if regressing to the waterfall method of development is a good idea at this point. I see a light at the end of the tunnel and we to continue to just handle these minor corner cases as we progress. If we move to a model where a minor bug is grounds to completely remove helpful code then nothing will ever get done. -Alfred > Thanks, > > > > Adrian > > On 12 January 2013 07:46, Jayachandran C. wrote: >> On Fri, Jan 11, 2013 at 11:16 PM, Alan Cox wrote: >>> On 01/11/2013 05:38, Jayachandran C. wrote: >> [...] >>>> I see an issue with commit on MIPS XLP platform as well. >>>> >>>> With 16 GB physical memory, the ncallout is calculated to be 538881 >>>> (since it is based on maxfiles - which is now based on the physical >>>> memory). Due to this, the callwheel allocation per cpu is 16MB >>>> (callwheelsize is 1MB). And on a 32 CPU machine, the total allocation >>>> for callouts comes to 32*16MB = 512MB. >>>> >>>> I have worked around this issue for now by increasing VM_KMEM_SIZE_MAX >>>> (which is 200MB now) - but I think a better fix is needed for this. >>>> >>> MIPS should use a definition for VM_KMEM_SIZE_MAX that scales with the >>> kernel address space size, like amd64, i386, and sparc64, and not a >>> fixed number. I think that the following should work for both 32- and >>> 64-bit processors: >>> >>> Index: mips/include/vmparam.h >>> =================================================================== >>> --- mips/include/vmparam.h (revision 245229) >>> +++ mips/include/vmparam.h (working copy) >>> @@ -130,10 +130,11 @@ >>> #endif >>> >>> /* >>> - * Ceiling on amount of kmem_map kva space. >>> + * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA >>> space. >>> */ >>> #ifndef VM_KMEM_SIZE_MAX >>> -#define VM_KMEM_SIZE_MAX (200 * 1024 * 1024) >>> +#define VM_KMEM_SIZE_MAX ((VM_MAX_KERNEL_ADDRESS - \ >>> + VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) >>> #endif >>> >>> /* initial pagein size of beginning of executable file */ >> This fix is needed, can you please check it in? I have tested it for >> 32 and 64 bit. >> >> But the second part of the problem - allocating 512MB out of 16GB at >> boot-time for callouts - might need a fix as well. >> >> Thanks, >> JC. From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 21:51:50 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 83A9A2F9; Sat, 12 Jan 2013 21:51:50 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CDA9A8E; Sat, 12 Jan 2013 21:51:50 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CLposE083182; Sat, 12 Jan 2013 21:51:50 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CLpoBO083181; Sat, 12 Jan 2013 21:51:50 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201301122151.r0CLpoBO083181@svn.freebsd.org> From: Alexander Motin Date: Sat, 12 Jan 2013 21:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245341 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 21:51:50 -0000 Author: mav Date: Sat Jan 12 21:51:49 2013 New Revision: 245341 URL: http://svnweb.freebsd.org/changeset/base/245341 Log: Windows handles INIT and VERIFY as array-wide and it doesn't specify which disks should be rebuilt. Our rebuild code is same time disk-centric. To handle this situation properly check all disks for RBLD flags, and if no disk specified try rebuild/resync all of them except newly inserted. Modified: head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Sat Jan 12 19:05:49 2013 (r245340) +++ head/sys/geom/raid/md_intel.c Sat Jan 12 21:51:49 2013 (r245341) @@ -774,7 +774,7 @@ g_raid_md_intel_start_disk(struct g_raid struct intel_raid_conf *meta; struct intel_raid_vol *mvol; struct intel_raid_map *mmap0, *mmap1; - int disk_pos, resurrection = 0; + int disk_pos, resurrection = 0, migr_global, i; sc = disk->d_softc; md = sc->sc_md; @@ -903,6 +903,13 @@ nofit: else mmap1 = mmap0; + migr_global = 1; + for (i = 0; i < mmap0->total_disks; i++) { + if ((mmap0->disk_idx[i] & INTEL_DI_RBLD) == 0 && + (mmap1->disk_idx[i] & INTEL_DI_RBLD) != 0) + migr_global = 0; + } + if (resurrection) { /* Stale disk, almost same as new. */ g_raid_change_subdisk_state(sd, @@ -953,6 +960,11 @@ nofit: sd->sd_volume->v_strip_size * mmap0->total_domains; } + } else if (mvol->migr_type == INTEL_MT_INIT && + migr_global) { + /* Freshly created uninitialized volume. */ + g_raid_change_subdisk_state(sd, + G_RAID_SUBDISK_S_UNINITIALIZED); } else if (mvol->dirty && (!pv->pv_cng || pv->pv_cng_master_disk != disk_pos)) { /* Dirty volume (unclean shutdown). */ @@ -969,7 +981,8 @@ nofit: /* Freshly inserted disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_NEW); - } else if (mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) { + } else if ((mmap1->disk_idx[sd->sd_pos] & INTEL_DI_RBLD) || + migr_global) { /* Resyncing disk. */ g_raid_change_subdisk_state(sd, G_RAID_SUBDISK_S_RESYNC); From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 22:20:37 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CD91F963; Sat, 12 Jan 2013 22:20:37 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A8275B15; Sat, 12 Jan 2013 22:20:37 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CMKbDw092046; Sat, 12 Jan 2013 22:20:37 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CMKbNS092044; Sat, 12 Jan 2013 22:20:37 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201301122220.r0CMKbNS092044@svn.freebsd.org> From: Mateusz Guzik Date: Sat, 12 Jan 2013 22:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245345 - head/usr.bin/procstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 22:20:37 -0000 Author: mjg Date: Sat Jan 12 22:20:37 2013 New Revision: 245345 URL: http://svnweb.freebsd.org/changeset/base/245345 Log: procstat: only one mode flag can be specified, but required check for 'i' and 'j' modes was missing. Fix that. MFC after: 3 days Modified: head/usr.bin/procstat/procstat.c Modified: head/usr.bin/procstat/procstat.c ============================================================================== --- head/usr.bin/procstat/procstat.c Sat Jan 12 22:17:43 2013 (r245344) +++ head/usr.bin/procstat/procstat.c Sat Jan 12 22:20:37 2013 (r245345) @@ -216,8 +216,8 @@ main(int argc, char *argv[]) argv += optind; /* We require that either 0 or 1 mode flags be set. */ - tmp = bflag + cflag + eflag + fflag + (kflag ? 1 : 0) + lflag + sflag + - tflag + vflag + xflag; + tmp = bflag + cflag + eflag + fflag + iflag + jflag + (kflag ? 1 : 0) + + lflag + sflag + tflag + vflag + xflag; if (!(tmp == 0 || tmp == 1)) usage(); From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 22:41:30 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3E937CA0; Sat, 12 Jan 2013 22:41:30 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1A319BDF; Sat, 12 Jan 2013 22:41:30 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CMfTBL097759; Sat, 12 Jan 2013 22:41:29 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CMfTjp097758; Sat, 12 Jan 2013 22:41:29 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201301122241.r0CMfTjp097758@svn.freebsd.org> From: Hiroki Sato Date: Sat, 12 Jan 2013 22:41:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245346 - head/release X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 22:41:30 -0000 Author: hrs Date: Sat Jan 12 22:41:29 2013 New Revision: 245346 URL: http://svnweb.freebsd.org/changeset/base/245346 Log: Set WITHOUT_SVN=yes for textproc/docproj. Submitted by: gjb Modified: head/release/generate-release.sh Modified: head/release/generate-release.sh ============================================================================== --- head/release/generate-release.sh Sat Jan 12 22:20:37 2013 (r245345) +++ head/release/generate-release.sh Sat Jan 12 22:41:29 2013 (r245346) @@ -160,7 +160,7 @@ build_docports() { # Could not install textproc/docproj from pkg(8) or pkg_add(1). Build # the port as final fallback. - chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/textproc/docproj BATCH=yes WITH_JADETEX=no WITHOUT_X11=yes WITHOUT_PYTHON=yes install clean' || \ + chroot ${CHROOTDIR} /bin/sh -c 'make -C /usr/ports/textproc/docproj BATCH=yes WITHOUT_SVN=yes WITH_JADETEX=no WITHOUT_X11=yes WITHOUT_PYTHON=yes install clean' || \ { echo "*** Could not build the textproj/docproj port. Exiting."; exit 2; } } From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 22:55:15 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E4E56253 for ; Sat, 12 Jan 2013 22:55:15 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by mx1.freebsd.org (Postfix) with ESMTP id AA7CACB0 for ; Sat, 12 Jan 2013 22:55:15 +0000 (UTC) Received: by mail-vb0-f45.google.com with SMTP id p1so2546646vbi.32 for ; Sat, 12 Jan 2013 14:55:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=S5ou+0yOdFgnIUUEwCvFQZDFYO/5JUa9bC9NROyHUcY=; b=l5cl4yM+X/V8T4H6vKN7SiZMfMLofKkYrbBAS51OJ41mCIyy7zcZDQ5sRP06tKzawC OQIXWHMFc297tF924ILui2AtjCsxilP4Xo90iAHfdQGCVuyeLEQ2Hb50ihg6VeOCYFAb 0+qHmCTYoy1Ja+FhmGig7T6LHALgE+cG5vown7YXszXLZWf0651Nt/A/2MmX3SFD0NmX fpFyhr2PZEDAcWloFO1UDUS2yeosS0aavZDTfUDk7B9ekciQS07i3XVHsoc710JT+UaK 71w9ZV+kl5Ij9fr/FF4wbCTl+WSwugC1cD2NYygaShqNgyDXv/uTVHDo8N2i98R1Oq9C K8pw== MIME-Version: 1.0 Received: by 10.52.36.206 with SMTP id s14mr85618581vdj.93.1358031308781; Sat, 12 Jan 2013 14:55:08 -0800 (PST) Sender: andy@fud.org.nz Received: by 10.58.211.103 with HTTP; Sat, 12 Jan 2013 14:55:08 -0800 (PST) In-Reply-To: <201301121235.r0CCZ0dI023716@svn.freebsd.org> References: <201301121235.r0CCZ0dI023716@svn.freebsd.org> Date: Sun, 13 Jan 2013 11:55:08 +1300 X-Google-Sender-Auth: G65QMBybRzonyIWbWVrne64kqF0 Message-ID: Subject: Re: svn commit: r245329 - head/sys/mips/beri From: Andrew Thompson To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQkbwxiGd9ZD9lgTWUnq0axqt+GqSneIjc20d9RbKfDFFGc5COC9pWJW4ugruc9qAM5bEiwJ Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 22:55:16 -0000 On 13 January 2013 01:35, Robert Watson wrote: > Author: rwatson > Date: Sat Jan 12 12:34:59 2013 > New Revision: 245329 > URL: http://svnweb.freebsd.org/changeset/base/245329 > > Log: > Merge Perforce change @219935 to head: > > Initialise Openfirmware/FDT code earlier in the FreeBSD/beri boot, > so that the results will be available for configuring the console > UART (eventually). > > Suggested by: thompsa Two Andrew Ts down south, we always get mixed up. From owner-svn-src-head@FreeBSD.ORG Sat Jan 12 23:44:14 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3E6E7C7D; Sat, 12 Jan 2013 23:44:14 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 26B91DF1; Sat, 12 Jan 2013 23:44:14 +0000 (UTC) Received: from svn.freebsd.org (svn.FreeBSD.org [8.8.178.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0CNiEDw015775; Sat, 12 Jan 2013 23:44:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0CNiDsq015774; Sat, 12 Jan 2013 23:44:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201301122344.r0CNiDsq015774@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 12 Jan 2013 23:44:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r245347 - head/release/ia64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Jan 2013 23:44:14 -0000 Author: marcel Date: Sat Jan 12 23:44:13 2013 New Revision: 245347 URL: http://svnweb.freebsd.org/changeset/base/245347 Log: Add now missing color.4th. Modified: head/release/ia64/mkisoimages.sh Modified: head/release/ia64/mkisoimages.sh ============================================================================== --- head/release/ia64/mkisoimages.sh Sat Jan 12 22:41:29 2013 (r245346) +++ head/release/ia64/mkisoimages.sh Sat Jan 12 23:44:13 2013 (r245347) @@ -63,6 +63,7 @@ if [ $bootable = yes ]; then if [ -s $BASE/boot/mfsroot.gz ]; then cp $BASE/boot/mfsroot.gz $MNT/boot fi + cp $BASE/boot/color.4th $MNT/boot cp $BASE/boot/support.4th $MNT/boot cp $BASE/boot/check-password.4th $MNT/boot cp $BASE/boot/screen.4th $MNT/boot